Notifications
Clear all
[Closed] Spline to tube script
Aug 24, 2005 12:59 pm
I used to have a script that would create a tube around a spline or path. Does anyone know where I could get this…or in fact if there is one available still. Thanks
1 Reply
Aug 24, 2005 12:59 pm
I’ve got a spline to boxes script by daniel mollen, but his site appears to be dead, so i’ll throw it in here, should be easy to switch out primitives if you’d like.
--SplineToBoxes ver0.4 written by Daniel Molin @ www.danielmolin.com---------
--<DM> A wery simple routine that will generate boxes per knot in an editable
--<DM> spline obj. Great for building quick and easy level skeletons for use
--<DM> with WorldCraft.
--<DM> Usage. It only works on collapsed shape objects. Select all the shape
--<DM> objects you want to box and then press the "Create Boxes" button.
--<DM> This is a wery early version and if I get time I will add capping of
--<DM> floors and ceilings as well as fixing "different angle" wall holes.
-----------------------------------------------------------------------------
rollout STB_roll "SplineToBoxes ver0.4"
(
group "Box Configuration"
(
spinner spn_boxWidth "Width" range:[0,100,2]
spinner spn_boxHeight "Height" range:[0,100,25]
)
button btn_doIt "Create Boxes"
fn createBoxesFromSpline =
(
undo on
(
if $ != undefind then
(
for obj in $ where isDeleted obj == false do
(
if classOf obj == SplineShape OR classOf obj == line then
(
for i = 1 to ( numSplines obj ) do
(
for h = 1 to ( numKnots obj i ) do
(
nextKnotNumber = h+1
if h == ( numKnots obj i ) then
(
nextKnotNumber = 1
if ( isClosed obj i ) != true then exit
)
newBox = Box()
newBox.pos = (getKnotPoint obj i h )
newBox.dir = normalize ( ( getKnotPoint obj i nextKnotNumber ) - ( getKnotPoint obj i h ) )
newBox.width = spn_boxWidth.value; newBox.length = spn_boxHeight.value
in coordSys local
newBox.pos += [ 0, newBox.length/2 , newBox.width/2 ]
newBox.height = ( distance ( getKnotPoint obj i h ) ( getKnotPoint obj i nextKnotNumber ) )
newBox.pivot = (getKnotPoint obj i h )
)
)
)
)
)
)
)
on btn_doIt pressed do
(
createBoxesFromSpline()
)
)
if STB_float != undefined then (closeRolloutFloater STB_float)
STB_float = NewRolloutFloater "" 150 162
addrollout STB_roll STB_float
i’ve also got one i edited to make vraylights per spline