Математика

Физика

Химия

Биология

Техника и    технологии

Скрипт для обработки

Загрузить исходник здесь WumonPlate.rar

fn drawLineBetweenTwoPoints pointA pointB =

 

(

 

ss = SplineShape pos:pointA

 

addNewSpline ss

 

addKnot ss 1 #corner #line PointA

 

addKnot ss 1 #corner #line PointB

 

updateShape ss

 

ss  

 

)

 

--****************************************************

 

--****************************************************

 

--Создаем первую выкойку

 

--****************************************************

 

--Создаем первую кривую1

spl = splineShape()

addNewSpline spl

addKnot spl 1 #smooth #curve [11.513,16.877,0]

addKnot spl 1 #smooth #curve [6.924,14.387,0]

addKnot spl 1 #smooth #curve [2.578,16.926,0]

updateshape spl

select spl

--Создаем прямую1

newSpline1 = drawLineBetweenTwoPoints [2.578,16.926,0] [-0.071,16.926,0]

--Создаем вторую кривую2

sp2 = splineShape()

addNewSpline sp2

addKnot sp2 1 #smooth #curve [-0.071,16.926,0]

addKnot sp2 1 #smooth #curve [0.283,12.532,0]

addKnot sp2 1 #smooth #curve [-1.355,9.002,0]

updateshape sp2

select sp2

--Создаем прямую2

newSpline2 = drawLineBetweenTwoPoints [-1.355,9.002,0] [-1.328,-3.045,0]

--Создаем прямую3

newSpline3 = drawLineBetweenTwoPoints [-1.328,-3.045,0] [14.931,-3.045,0]

--Создаем прямую4

newSpline4 = drawLineBetweenTwoPoints [14.931,-3.045,0] [14.931,9.003,0]

--Создаем третью кривую3

sp3 = splineShape()

addNewSpline sp3

addKnot sp3 1 #smooth #curve [14.931,9.003,0]

addKnot sp3 1 #smooth #curve [13.613,12.678,0]

addKnot sp3 1 #smooth #curve [13.978,16.877,0]

updateshape sp3

select sp3

--Создаем прямую5

newSpline5 = drawLineBetweenTwoPoints [13.978,16.877,0] [11.513,16.877,0]

--и объединяем все прямые и кревые

addAndWeld $Shape01 $Shape02 0.1  

addAndWeld $Shape01 $Shape03 0.1   

addAndWeld $Shape01 $Shape04 0.1    

addAndWeld $Shape01 $Shape05 0.1

addAndWeld $Shape01 $Shape06 0.1   

addAndWeld $Shape01 $Shape07 0.1    

addAndWeld $Shape01 $Shape08 0.1    

--получаем одну кревую $Shape01

--****************************************************

--Создаем вторую выкойку

--****************************************************

--Создаем третью кривую1

sp4 = splineShape()

 

addNewSpline sp4

 

addKnot sp4 1 #smooth #curve [-11.15,16.877,0]

 

addKnot sp4 1 #smooth #curve [-15.74,14.387,0]

 

addKnot sp4 1 #smooth #curve [-20.085,16.926,0]

 

updateshape sp4

 

select sp4

 

--Создаем прямую6

newSpline6 = drawLineBetweenTwoPoints [-20.085,16.926,0] [-22.734,16.926,0]

--Создаем пятую кривую2

sp5 = splineShape()

 

addNewSpline sp5

 

addKnot sp5 1 #smooth #curve [-22.734,16.926,0]

 

addKnot sp5 1 #smooth #curve [-22.38,12.532,0]

 

addKnot sp5 1 #smooth #curve [-24.018,9.002,0]

 

updateshape sp5

 

select sp5

--Создаем прямую7

newSpline7 = drawLineBetweenTwoPoints [-24.018,9.002,0] [-23.992,-3.045,0]

 

--Создаем прямую8

newSpline8 = drawLineBetweenTwoPoints [-23.992,-3.045,0] [-7.732,-3.045,0]

--Создаем прямую9

 

newSpline9 = drawLineBetweenTwoPoints [-7.732,-3.045,0] [-7.732,9.003,0]

 

--Создаем шестую кривую3

sp6 = splineShape()

 

addNewSpline sp6

 

addKnot sp6 1 #smooth #curve [-7.732,9.003,0]

 

addKnot sp6 1 #smooth #curve [-9.05,12.678,0]

 

addKnot sp6 1 #smooth #curve [-8.685,16.877,0]

 

updateshape sp6

 

select sp6

--Создаем прямую10

 

newSpline10 = drawLineBetweenTwoPoints [-8.685,16.877,0] [-11.15,16.877,0]

--и объединяем все прямые и кревые

 

addAndWeld $Shape02 $Shape03 0.1  

addAndWeld $Shape02 $Shape04 0.1   

addAndWeld $Shape02 $Shape05 0.1    

addAndWeld $Shape02 $Shape06 0.1

addAndWeld $Shape02 $Shape07 0.1   

addAndWeld $Shape02 $Shape08 0.1    

addAndWeld $Shape02 $Shape09 0.1    

--****************************************************

 

--Создаем третью выкойку

 

--****************************************************

--Создаем седьмую кривую

sp7 = splineShape()

 

addNewSpline sp7

 

addKnot sp7 1 #smooth #curve [17.339,20.534,0]

 

addKnot sp7 1 #smooth #curve [15.605,13.193,0]

 

addKnot sp7 1 #smooth #curve [16.964,5.529,0]

 

updateshape sp7

 

select sp7

 

--Создаем прямую11

 

newSpline11 = drawLineBetweenTwoPoints [16.964,5.529,0] [33.199,6.655,0]

--Создаем прямую12

 

newSpline12 = drawLineBetweenTwoPoints [33.199,6.655,0] [33.372,19.581,0]

 

--Создаем прямую13

 

newSpline13 = drawLineBetweenTwoPoints [33.372,19.581,0] [17.339,20.534,0]

--и объединяем все прямые и кревые

 

addAndWeld $Shape03 $Shape04 0.1    

 

addAndWeld $Shape03 $Shape05 0.1    

 

addAndWeld $Shape03 $Shape06 0.1  

--****************************************************

 

--Создаем четвертую выкойку

 

--****************************************************

--Создаем восьмую кривую

sp8 = splineShape()

 

addNewSpline sp8

 

addKnot sp8 1 #smooth #curve [-30.825,5.367,0]

 

addKnot sp8 1 #smooth #curve [-29.091,12.916,0]

 

addKnot sp8 1 #smooth #curve [-30.45,20.372,0]

 

updateshape sp8

 

select sp8

 

 

 

--Создаем прямую14

 

newSpline14 = drawLineBetweenTwoPoints [-30.45,20.372,0] [-46.685,19.246,0]

 

--Создаем прямую15

 

newSpline15 = drawLineBetweenTwoPoints [-46.685,19.246,0] [-46.858,6.319,0]

 

--Создаем прямую16

 

newSpline16 = drawLineBetweenTwoPoints [-46.858,6.319,0] [-30.825,5.367,0]

 

--и объединяем все прямые и кревые

 

addAndWeld $Shape04 $Shape05 0.1    

 

addAndWeld $Shape04 $Shape06 0.1    

 

addAndWeld $Shape04 $Shape07 0.1  

--****************************************************

 

--Создаем пятую  выкойку

 

--****************************************************

 

--Создаем девятую кривую

 

newSpline91 = drawLineBetweenTwoPoints [-51.418,16.511,0] [-51.418,9.512,0]

 

newSpline92 = drawLineBetweenTwoPoints [-51.418,9.512,0] [-48.726,9.153,0]

 

newSpline93 = drawLineBetweenTwoPoints [-48.726,9.153,0] [-48.726,16.511,0]

 

newSpline94 = drawLineBetweenTwoPoints [-48.726,16.511,0] [-51.418,16.511,0]

 

--и объединяем все прямые

 

addAndWeld $Shape05 $Shape06 0.1    

 

addAndWeld $Shape05 $Shape07 0.1    

 

addAndWeld $Shape05 $Shape08 0.1  

 

--****************************************************

 

--Создаем шестую  выкойку

 

--****************************************************

 

--Создаем десятую кривую

 

newSpline101 = drawLineBetweenTwoPoints [35.625,17.588,0] [35.625,8.794,0]

 

newSpline102 = drawLineBetweenTwoPoints [35.625,8.794,0] [39.034,8.615,0]

 

newSpline103 = drawLineBetweenTwoPoints [39.034,8.615,0] [39.034,17.588,0]

 

newSpline104 = drawLineBetweenTwoPoints [39.034,17.588,0] [35.625,17.588,0]

 

--и объединяем все прямые

 

addAndWeld $Shape06 $Shape07 0.1    

 

addAndWeld $Shape06 $Shape08 0.1    

 

addAndWeld $Shape06 $Shape09 0.1  

 

 

 

--****************************************************

 

--Создаем седьмую  выкойку

 

--****************************************************

--Создаем 11-ую кривую

newSpline111 = drawLineBetweenTwoPoints [-11.865,20.588,0] [3.109,20.305,0]

 

newSpline112 = drawLineBetweenTwoPoints [3.109,20.305,0] [3.109,22.208,0]

 

newSpline113 = drawLineBetweenTwoPoints [3.109,22.208,0] [-11.992,22.588,0]

 

newSpline114 = drawLineBetweenTwoPoints [-11.992,22.588,0] [-11.865,20.588,0]

 

--и объединяем все прямые

 

addAndWeld $Shape07 $Shape08 0.1    

 

addAndWeld $Shape07 $Shape09 0.1    

 

addAndWeld $Shape07 $Shape10 0.1  

 

--Перемещаем

 

move $Shape07 [52.2529,-1.63117,0]

 

rotate $Shape07 (angleaxis -90.0 [0,0,1])

--****************************************************

--Создаем восьмую  выкойку

--****************************************************

--Создаем 14-ую кривую

 

newSpline131 = drawLineBetweenTwoPoints [-11.992,23.477,0] [2.855,23.604,0]

 

newSpline142 = drawLineBetweenTwoPoints [2.855,23.604,0] [3.871,24.492,0]

 

newSpline143 = drawLineBetweenTwoPoints [3.871,24.492,0] [-13.515,24.873,0]

 

newSpline144 = drawLineBetweenTwoPoints [-13.515,24.873,0] [-11.992,23.477,0]

--и объединяем все прямые

 

addAndWeld $Shape08 $Shape09 0.1    

addAndWeld $Shape08 $Shape10 0.1    

addAndWeld $Shape08 $Shape11 0.1  

--Перемещаем

 

move $Shape08 [65.2529,-1.63117,0]

 

rotate $Shape08 (angleaxis -90.0 [0,0,1])

--****************************************************

--****************************************************

--объединяем все выкреки

addAndWeld $Shape01 $Shape02 0.1  

 

addAndWeld $Shape01 $Shape03 0.1

 

addAndWeld $Shape01 $Shape04 0.1  

 

addAndWeld $Shape01 $Shape05 0.1  

 

addAndWeld $Shape01 $Shape06 0.1

 

addAndWeld $Shape01 $Shape07 0.1  

 

addAndWeld $Shape01 $Shape08 0.1

--****************************************************

 

--****************************************************

 

--****************************************************

 

--****************************************************

 

 --Применяеи модификатор

--2.Выделяем кривую

select $Shape01 --L5

 

--3.Перейти Line>Vertex

 

--Метод топора

 

max modify mode -- open mod panel

 

subobjectLevel = 0

 

modPanel.setCurrentObject $Shape01.baseObject

 

subobjectLevel = 1

 

modPanel.setCurrentObject $Shape01.baseObject

 

-- нужно выделить vertex

 

select $Shape01

 

--splineSelect

 

actionMan.executeAction 0 "40021"

 

max select all

 

--5.Нажать Break

 

--***************************

 

splineOps.startBreak $Shape01

 

--.Загрузить Garment_Maker()

 

  max modify mode -- open mod panel

 

  myGarment2=Garment_Maker()

 

  addModifier $Shape01   (myGarment2)

--***********************************************************

--***********************************************************

--Делаем швы   --выделяем стороны панелей и делаем швы

--***********************************************************

--***********************************************************

--$Shape01.modifiers[#garmentmaker].setSeamTolerance 0.550000

$Shape01.modifiers[#garmentmaker].setSeamTolerance 0.950000

$Shape01.Garment_Maker.selectSplines #{26,14} --

subobjectLevel = 1

 $Shape01.Garment_Maker.ButtonCreateSeam()

$Shape01.Garment_Maker.createSeamFromSplines 21 1 180

$Shape01.Garment_Maker.createSeamFromSplines 2 11 180

$Shape01.Garment_Maker.selectSplines #{24,16}

 $Shape01.Garment_Maker.ButtonCreateSeam()

--делаем рукава

--чтобы получать результат наподобие манжеты.

--Where the cuff meets the sleeve, there should be a clear crease and a bunching of the sleeve.

-- Где манжета встречает рукав, там должно быть ясной складкой и bunching рукава.

--делаем рукава1

$Shape01.Garment_Maker.selectSplines #{39,36}

$Shape01.Garment_Maker.ButtonCreateSeam()

--Устанавливаем параметры шва1

--<void>setSeamParamsByIndex

 

           --<index>seam

 

           --<float>bend_angle

 

           --<float>bend_stiffness

 

           --<boolean>enabled

 

           --<float>sewing_stiffness

--Set all parameters of the indexed seam to the supplied values.

$Shape01.Garment_Maker.setSeamParamsByIndex 5 90.0 100.0 ON 50

--modifiers[#garmentmaker].

--$Shape01.modifiers[#garmentmaker].setSeamParamsByIndex 1

--делаем рукава2

$Shape01.Garment_Maker.selectSplines #{40,32}

$Shape01.Garment_Maker.ButtonCreateSeam()

$Shape01.Garment_Maker.setSeamParamsByIndex 6 90.0 100.0 ON 50

--***********************************************************

--***********************************************************

--Соединение воротников

--$Shape01.Garment_Maker.selectSplines #{45,46}

--$Shape01.Garment_Maker.ButtonCreateSeam()

$Shape01.Garment_Maker.createSeamFromSplines 45 46 0

--установка параметров

$Shape01.Garment_Maker.setSeamParamsByIndex 7 75.0 25.0 ON 50

--***********************************************************

--***********************************************************

$Shape01.Garment_Maker.makeMultiSegmentFromSplines #(22,23)

$Shape01.Garment_Maker.createSeamFromSplines 33 22 0

$Shape01.Garment_Maker.makeMultiSegmentFromSplines #(27,28)

$Shape01.Garment_Maker.createSeamFromSplines 28 30 0

 $Shape01.Garment_Maker.makeMultiSegmentFromSplines #(17,18)

 $Shape01.Garment_Maker.createSeamFromSplines 18 34 0

--Now you'll take a  collar.

--Теперь будем делать на воротник.

-- create a seam between the back of the shirt and

-- the bottom of the closest collar piece.

--1-первый  

$Shape01.Garment_Maker.makeMultiSegmentFromSplines #(10,9)

$Shape01.Garment_Maker.createSeamFromSplines 10 43 0

--2-воротник

  --2.2

  $Shape01.Garment_Maker.makeMultiSegmentFromSplines #(12,13)

  $Shape01.Garment_Maker.createSeamFromSplines 13 29 0

 $Shape01.Garment_Maker.selectSplines #{35,4}

$Shape01.Garment_Maker.ButtonCreateSeam()

$Shape01.Garment_Maker.selectSplines #{3,31}

$Shape01.Garment_Maker.ButtonCreateSeam()

$Shape01.Garment_Maker.selectSplines #{5,38}

$Shape01.Garment_Maker.ButtonCreateSeam()

$Shape01.Garment_Maker.selectSplines #{6,41}

$Shape01.Garment_Maker.ButtonCreateSeam()

--$Shape01.Garment_Maker.selectSplines #{39,36}

--$Shape01.Garment_Maker.ButtonCreateSeam()

--$Shape01.modifiers[#garment_maker].getPanelMatrix 1--отображения координат

--<index>getPanelFromSpline <index>spline

--Returns the index of the panel defined by the supplied indexed spline.

--$Shape01.Garment_Maker.getPanelFromSpline 37

subobjectLevel = 1

modPanel.setCurrentObject $.modifiers[#Garment_Maker]

subobjectLevel = 2

$Shape01.modifiers[#garment_maker].setPanelMatrix 1 (matrix3 [-1,0,0] [0,0,1] [0,0,0] [7.31188,6.43571,12.3737])

$Shape01.modifiers[#garment_maker].setPanelMatrix 2 (matrix3 [1,0,0] [0,0,1] [0,0,0] [16.3547,-6.42204,12.3381])

$Shape01.modifiers[#garment_maker].setPanelMatrix 3 (matrix3 [1,0,0] [0,1,0] [0,0,1] [-8.99529,-13.854,28.163])

$Shape01.modifiers[#garment_maker].setPanelDeformType 3 1

$Shape01.modifiers[#garment_maker].setPanelAxis 3 1

$Shape01.modifiers[#garment_maker].setPanelCurvature 3 -0.30

$Shape01.modifiers[#garment_maker].setPanelMatrix 4 (matrix3 [1,0,0] [0,1,0] [0,0,1] [22.1919,-13.7535,28.6335])

$Shape01.modifiers[#garment_maker].setPanelDeformType 4 1

$Shape01.modifiers[#garment_maker].setPanelAxis 4 1

$Shape01.modifiers[#garment_maker].setPanelCurvature 4 -0.30

$Shape01.modifiers[#garment_maker].setPanelMatrix 5 (matrix3 [1,0,0] [0,1,0] [0,0,1] [23.6399,-14.019,27.7087])

$Shape01.modifiers[#garment_maker].setPanelDeformType 5 1

$Shape01.modifiers[#garment_maker].setPanelAxis 5 1

$Shape01.modifiers[#garment_maker].setPanelCurvature 5 -0.50

$Shape01.modifiers[#garment_maker].setPanelMatrix 6 (matrix3 [1,0,0] [0,1,0] [0,0,1] [-10.8396,-14.0257,27.6645])

$Shape01.modifiers[#garment_maker].setPanelDeformType 6 1

$Shape01.modifiers[#garment_maker].setPanelAxis 6 1

$Shape01.modifiers[#garment_maker].setPanelCurvature 6 -0.50

--1-Воротник

$Shape01.modifiers[#garment_maker].setPanelMatrix 7 (matrix3 [0,0,1] [1,0,0] [0,1,0] [-11.4771,3.17142,-11.9144])

$Shape01.modifiers[#garment_maker].setPanelDeformType 7 1

$Shape01.modifiers[#garment_maker].setPanelAxis 7 1

$Shape01.modifiers[#garment_maker].setPanelCurvature 7 -0.3

--2-Воротник

$Shape01.modifiers[#garment_maker].setPanelMatrix 8 (matrix3 [0,0,-1] [-1,0,0] [0,1,0] [15.8139,3.72992,84.6003])

$Shape01.modifiers[#garment_maker].setPanelDeformType 8 1

$Shape01.modifiers[#garment_maker].setPanelAxis 8 1

$Shape01.modifiers[#garment_maker].setPanelCurvature 8 -0.2

--Применить модифекатор Cloth к объекту Shirt

--Click the Object Properties button.

--In the left column of the Object Properties dialog,

--click the Shirt entry and then choose the Cloth radio

--button on the right.

Назад

 

Hosted by uCoz