[Closed] problem when crossSecting multiple closed shapes
Hello everyone,
I am trying to do the following and I'm stuck for a while now. I create a circle, then I interpolate on that circle a series of closed_shapes (i.e. circles), and then I want to loft those closed_shapes as if it was some kind of thickness for the underlying circle. Since loft is not accessible via maxscript, I tried to do it like this: interpolate the closed_shapes -> attach them -> apply crossection -> surface modifier. But the following problem occurs.
The crossecting direction changes when the interpolation reaches at a certain point on the underlying circle. So it reverses the crossection as you can see in my attached image. How can I solve this ?
For a strange reason the crossection is correct when the underlying circle is horizontally located in the scene.
[[img] http://img690.imageshack.us/img690/8259/6cob.jpg[/img]]( http://img690.imageshack.us/img690/8259/6cob.jpg[/img]]( g"/> /)
Uploaded with ImageShack.us
Here is my code:
-- this is a custom function that I wrote in order to attach multiple lines
fn AHattachSplines splinesarray =
(
-- (array) -> shape
--
-- Attaches all the splines inside the splinesarray.
--
-- Precondition: all the items in the array must be splineshapes
-- Local variables
local numitems
if splinesarray.count > 0 do
(
convertTo splinesarray[1] splineShape
numitems = splinesarray.count
for item = 2 to numitems do
(
convertTo splinesarray[item] splineShape
addAndWeld splinesarray[1] splinesarray[item] -1
)
)
splinesarray[1]
)
--delete $Profile*DriverSpline*
i = 1; j = 1
profileshapes = #()
-- select the spline that you want the profile to interpolate at given numsteps
driverspl = pickobject prompt:"select a driver spline "
nmstep = 1.0/20
for u = 0.0 to 1.0 by nmstep do
(
profileshapes[i] = circle radius:3.0 wirecolor:black
prfl = profileshapes[i]
prfl.name = "Profile_" + i as string + "_DriverSpline_" + j as string
prfl.pos = lengthInterp driverspl u
prfl.dir = lengthTangent driverspl u
i += 1;
)
-- attach all the circles
f = AHattachSplines profileshapes
-- add crossection modifier
addmodifier f (crossSection())
Any help here please ?
edit: just to clear out my intentions. My goal is to create a pipe, but with variable thickness. So I thought that by creating every profile of the pipe, I could then have more control of how the profile looks. I could for example change the radius of the profiles, based on their distance from a scene node. Thus, having a thinner or thicker pipe at the closest distance from that scene node. I hope I made my self explainable.