Notifications
Clear all
[Closed] Slow splineshape() code
May 30, 2008 6:45 pm
Maybe I forgot something or added something but this code seems to be creating an extruded spline shapes abit slow.
[left]
[left] undo off
gg4 = 24
P1 = splineshape()
addnewspline P1
addknot P1 1 #corner #curve [.813,.691,0]
addknot P1 1 #corner #curve [.813,0,0]
addknot P1 1 #corner #curve [2.25,0,0]
addknot P1 1 #corner #curve [2.25,.849,0]
P1.steps = 0
close P1 1
updateshape P1
P1.name = "POST1"
addModifier P1 (extrude amount:gg4 segs:1)
-----------------------------------------------------------------------
P2 = splineshape()
addnewspline P2
addknot P2 1 #corner #curve [.074,5.05,0]
addknot P2 1 #corner #curve [.264,4.385,0]
addknot P2 1 #corner #curve [1.695,4.65,0]
addknot P2 1 #corner #curve [1.415,5.605,0]
P2.steps = 0
close P2 1
updateshape P2
P2.name = "POST2"
addModifier P2 (extrude amount:gg4 segs:1)
-----------------------------------------------------------------------
P3 = splineshape()
addnewspline P3
addknot P3 1 #corner #curve [-1.758,9.158,0]
addknot P3 1 #corner #curve [-1.403,8.565,0]
addknot P3 1 #corner #curve [-.09,9.191,0]
addknot P3 1 #corner #curve [-.607,10.04,0]
P3.steps = 0
close P3 1
updateshape P3
P3.name = "POST3"
addModifier P3 (extrude amount:gg4 segs:1)
-----------------------------------------------------------------------
P4 = splineshape()
addnewspline P4
addknot P4 1 #corner #curve [-4.555,12.658,0]
addknot P4 1 #corner #curve [-4.06,12.168,0]
addknot P4 1 #corner #curve [-2.943,13.09,0]
addknot P4 1 #corner #curve [-3.651,13.793,0]
P4.steps = 0
close P4 1
updateshape P4
P4.name = "POST4"
addModifier P4 (extrude amount:gg4 segs:1)
-----------------------------------------------------------------------
P5 = splineshape()
addnewspline P5
addknot P5 1 #corner #curve [-8.19,15.37,0]
addknot P5 1 #corner #curve [-7.598,15.013,0]
addknot P5 1 #corner #curve [-6.732,16.182,0]
addknot P5 1 #corner #curve [-7.588,16.69,0]
P5.steps = 0
close P5 1
updateshape P5
P5.name = "POST5"
addModifier P5 (extrude amount:gg4 segs:1)
-----------------------------------------------------------------------
P6 = splineshape()
addnewspline P6
addknot P6 1 #corner #curve [-12.373,17.06,0]
addknot P6 1 #corner #curve [-11.711,16.86,0]
addknot P6 1 #corner #curve [-11.157,18.205,0]
addknot P6 1 #corner #curve [-12.111,18.489,0]
P6.steps = 0
close P6 1
updateshape P6
P6.name = "POST6"
addModifier P6 (extrude amount:gg4 segs:1)
-----------------------------------------------------------------------
P7 = splineshape()
addnewspline P7
addknot P7 1 #corner #curve [-16.805,17.627,0]
addknot P7 1 #corner #curve [-16.113,17.628,0]
addknot P7 1 #corner #curve [-15.966,19.062,0]
addknot P7 1 #corner #curve [-16.805,19.062,0]
P7.steps = 0
close P7 1
updateshape P7
P7.name = "POST7"
addModifier P7 (extrude amount:gg4 segs:1)
[/left]
thanks for any help
[/left]
1 Reply
May 30, 2008 6:45 pm
I just added a “for loop” so I didnt need P3 through P7.
P2 is the basicly the same shape as P3 through P7.
Maxscript rocks! I love that I can save 15 minutes per model compared to Inventor model creation.