Notifications
Clear all
[Closed] SplineShape is not closing
Feb 09, 2016 3:19 pm
Hi! I have a simple script that traces a Plane. Can’t figure out why it’s not closing. Can someone point me in the right direction?
(
local p = converttopoly(plane length:10 width:10 lengthsegs:1 widthsegs:1)
local ss,vertorder,v
ss = SplineShape pos:[0,0,0]
addNewSpline ss
vertOrder = #(1,2,4,3,1)
for v in vertOrder do --thenotes.count do
(
addknot ss 1 #corner #line (polyop.getvert p v)
)
close ss 1
updateshape ss
)
Thanks!
2 Replies
Feb 09, 2016 3:19 pm
The shape is closed. You just have 2 vertices at the same position because you have a 5 items in the array.
Try removing the last item in the array:
vertOrder = #(1,2,4,3)
Additionally, something like this may also work:
(
gc()
delete objects
obj = converttopoly(plane length:10 width:10 lengthsegs:1 widthsegs:1 wirecolor:yellow)
sh = splineshape wirecolor:red
addnewspline sh
for j in (polyop.getfaceverts obj 1) do
(
addknot sh 1 #corner #line (polyop.getvert obj j)
)
close sh 1
updateshape sh
)
1 Reply