attaching spline - not using addandweld

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  02 February 2009
attaching spline - not using addandweld

Hi all,

I am working on a project where I need to create splines using points stored in an array then attach these splines so that I can use the CrossSection modifier to create a surface between the two splines.

I have an easy way for creating the splines using points in an array:
fn arch_gen pointA pointB pointC =
ss = SplineShape pos:pointA
addNewSpline ss
addKnot ss 1 #smooth #curve PointA
addKnot ss 1 #smooth #curve PointB
addKnot ss 1 #smooth #curve PointC
updateShape ss
newSpline = arch_gen array[1] array[2] array[3]

Now I thought that I could simply create curves and attach them using:

addandweld $shape01 $shape02 0.0

This does weld the curves together but does not then work when I try to create a surface between the curves using:

addmodifier $shape01 (CrossSection()) ui:on
addmodifier $shape01 (Surface()) ui:on

Is there a way in which I can attach the created shapes using the attach method you can use in the 'geometry' modifier panel for the shape?
Any help here would be really appreciated!!


Last edited by Guiniture : 02 February 2009 at 03:05 PM.
  02 February 2009
just a thought: if all your have is a point array to begin with, why not just draw all the splines in the 1 splineshape object to begin with?
  02 February 2009
in addition to what Gravey said...

are you quite sure the problem is with addAndWeld?

The following should create a 'Cylinder':

a = circle pos:[0,0,0]
convertToSplineShape a
b = circle pos:[0,0,-100]
convertToSplineShape b
addAndWeld a b 0.0
addmodifier a (CrossSection())
addmodifier a (Surface())
  02 February 2009
I need the splineshapes to be separate to begin with because I am trying to create gothic arches between points. The script initially begins with one point and does some calculations to determine the points along a spline to another point.

This works fine and at this point if I use the manual attach operation I can then create a surface between any two splines. However, if I use addandweld it does not seem to work in the same way?

The circle method is good, but it will not allow me to create arches or curved surfaces, unless I go through the process of creating circles, rotating them and moving to correct positions...etc.

Iím not sure what the actual problem is, because this works with lines that are drawn but when I create my splineshapes using the function above it does seem to work! Perhaps it is not a problem with addandweld but if not Iím not sure what the problem is??

Any ideas of what it might be?
  02 February 2009
what are the coordinates for two of the curves that seem to fail for you? I had a quick test with your function, and it seems to be okay, too...

newSpline = arch_gen [0,0,0] [50,100,0] [100,0,0]
newSpline2 = arch_gen [0,0,-100] [50,100,-100] [100,0,-100]
addAndWeld newSpline newSpline2 0.0
addmodifier newSpline (CrossSection())
addmodifier newSpline (Surface())
  02 February 2009 are right. That does seem to work but that means that something else must be wrong in my script I guess!

I will have another look and let you know the outcome.
  02 February 2009
I have sorted out the problem! most of the arches I have been creating have a common starting point therefore using addandweld has been welding the splineshapes together. By changing the weld threshold from addandweld newSpline newSpline2 <0.0> to -1.0 the problem seems to have stopped.

This is probely a bit of a hack but it works. Thanks for all your help.
  02 February 2009
ah! that would do it, yes - glad you resolved it
  02 February 2009
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 01:59 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.