Hi, I made a little script to add knot spline at a given distance.
- how it works :
select a segment
enter a value
positive value add at the distance a knot at the beginnig of the segment
negative value add it at the end.
if "corner" is checked, add a corner knot, if not, knot have tangents.
- how it don't work :
It don't work with several splines in spline object.
I can't manage to tell script in wich spline is the selected segment.
If somebody can help. Thanks
(
(
try destroyDialog rlslice catch()
global rlslice = rollout rlslice "REFINEbyDIST"
(
button butconnect "GO" pos:[2,2]
spinner DDD "d " width:90 range:[-10000,10000,1] type:#float pos:[55,5]
checkbutton CORN "CORNER" offset:[0,0] width:60 highlightColor:(color 95 138 193) checked:true
on DDD changed DIST do
(
SEG=getSegSelection $ 1
LLLF = getSegLengths $ 1
verts = numKnots $
LLL = LLLF[SEG[1]+(verts-1)]
if DIST>=0 then
(
XXX = refineSegment $ 1 SEG[1] (DIST/LLL)
)
else
(
XXX = refineSegment $ 1 SEG[1] (1-(abs(DIST)/LLL))
)
if CORN.checked==true then setKnotType $ 1 XXX #corner
updateshape $
)
on butconnect pressed do
(
SEG=getSegSelection $ 1
LLLF = getSegLengths $ 1
verts = numKnots $
LLL = LLLF[SEG[1]+(verts-1)]
DIST=DDD.value
if DIST>=0 then
(
XXX = refineSegment $ 1 SEG[1] (DIST/LLL)
)
else
(
XXX = refineSegment $ 1 SEG[1] (1-(abs(DIST)/LLL))
)
if CORN.checked==true then setKnotType $ 1 XXX #corner
updateshape $
)
)
createDialog rlslice 160 60
)
miauu · 2018-11-19