----------------------------------------------------------- -- Little tool to draw shape line with assigned vertex -- (to make a "rope" for example) -- Version: 0.3.1 -- Anubis ( anubiss@abv.bg ) -- https://sites.google.com/site/spot4pal/ -- simple tutorial: -- http://3dmyths.blogspot.com/2009/03/knotty-line-v03.html ----------------------------------------------------------- try destroyDialog kLine catch() rollout kLine "knotty Line" ( group "Start Position" ( spinner sp_x "X:" range:[-1000,1000,0] \ type:#float fieldwidth:30 align:#left across:3 spinner sp_y "Y:" range:[-1000,1000,0] \ type:#float fieldwidth:30 align:#center spinner sp_z "Z:" range:[-1000,1000,0] \ type:#float fieldwidth:30 align:#right ) group "Direction/Interval" ( spinner in_x "X:" range:[-1000,1000,0] \ type:#float fieldwidth:30 align:#left across:3 spinner in_y "Y:" range:[-1000,1000,0] \ type:#float fieldwidth:30 align:#center spinner in_z "Z:" range:[-1000,1000,5] \ type:#float fieldwidth:30 align:#right ) group "Vertex Sets" ( radiobuttons rbtn_type "Type:" across:2 \ labels:#("Smooth", "Corner") default:1 spinner vCount "Count:" range:[1,1000,10] \ type:#integer fieldwidth:30 align:#right across:2 button makeLine "Create" pos:[128,140] ) fn drawLineS = ( ss = SplineShape pos:[sp_x.value,sp_y.value,sp_z.value] -- pivot point addNewSpline ss addKnot ss 1 #smooth #line [sp_x.value,sp_y.value,sp_z.value] -- firstKnot for i = 1 to vCount.value do ( addKnot ss 1 #smooth #line \ [sp_x.value + (i * in_x.value),sp_y.value + (i * in_y.value),sp_z.value + (i * in_z.value)] ) updateShape ss ss ) fn drawLineC = ( ss = SplineShape pos:[sp_x.value,sp_y.value,sp_z.value] addNewSpline ss addKnot ss 1 #corner #line [sp_x.value,sp_y.value,sp_z.value] for i = 1 to vCount.value do ( addKnot ss 1 #corner #line \ [sp_x.value + (i * in_x.value),sp_y.value + (i * in_y.value),sp_z.value + (i * in_z.value)] ) updateShape ss ss ) on makeLine pressed do ( if rbtn_type.state == 1 then (newSpline = drawLineS()) else (newSpline = drawLineC()) ) ) createDialog kLine 188 178