Hi,
I made a little script to make roads slopes references.
Actually it make a linear z offset of each point to have a constant slope.
To simplify I use Normalize spline to have equal distance between knots.
But I would like to have a little smooth effect and the ends.
And of course I'm not able to do it...
undo on(
aaa =$
for cyc=1 to 100 do
(
LLL = getSegLengths aaa 1 cum: true byVertex:false
nb = LLL.count
LONGG = LLL[nb]
verts = numKnots aaa
DIFF = (getKnotPoint aaa 1 verts) - (getKnotPoint aaa 1 1)
kntb = getKnotPoint aaa 1 1
for i=2 to (verts - 1) do
(
knt = getKnotPoint aaa 1 i
pp1 = LLL[i-1]
SEC = ( DIFF.z * pp1)
setKnotPoint aaa 1 i [knt.x,knt.y,kntb.z + SEC]
)
)
updateShape aaa
)---undo