It is currently 19 Apr 2014, 13:57

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Extrude Polygon Along Curve
PostPosted: 24 Dec 2011, 16:15 
Offline

Joined: 22 Mar 2010, 18:43
Posts: 411
Since it was suggested several times, here's a test video.


This is based on the "Cable compound" whose construction I detailed in my bridge tutorial video part 2. However, it doesn't use any repeat nodes anymore, and I adapted it to work with an input polygon and curve.

There are still certain problems. The new geometry is currently a separate polygon island - it should of course be welded automatically. And there are some issues with orientation and upvectors. If I can't solve these (or don't have the time to), I'll post the unfinished compound for others to take a look. Or maybe someone else comes up with a fully working solution right away (Fabricio? :D )


Top
 Profile  
 
 Post subject: Re: Extrude Polygon Along Curve
PostPosted: 24 Dec 2011, 17:02 
Offline
User avatar

Joined: 25 Nov 2010, 19:23
Posts: 820
Location: Canada
Nice! Would it be able to cap both ends automatically?


Top
 Profile  
 
 Post subject: Re: Extrude Polygon Along Curve
PostPosted: 24 Dec 2011, 17:18 
Offline

Joined: 22 Mar 2010, 18:43
Posts: 411
ActionArt wrote:
Nice! Would it be able to cap both ends automatically?

Capping the end is extremely simple, I just haven't added that yet. Adding control for scaling the thickness or twisting along the length is also quite easy.
I find that the main difficulty lies in maintaining a reasonable upvector. Currently, the extrusion can have some weird flips somewhere in the middle depending on the curve.


Top
 Profile  
 
 Post subject: Re: Extrude Polygon Along Curve
PostPosted: 24 Dec 2011, 23:54 
Offline

Joined: 24 Sep 2010, 18:28
Posts: 656
I make up vector of the curves by this way, maybe you find it useful. Null up vector prevents vector to be flipped when curve is rotated with it


Attachments:
curve_upvector.png
curve_upvector.png [ 12.61 KiB | Viewed 2260 times ]
curve_upvector.rar [109.78 KiB]
Downloaded 124 times

_________________
Constantine
Learnable Programming
The Future of Programming
Top
 Profile  
 
 Post subject: Re: Extrude Polygon Along Curve
PostPosted: 25 Dec 2011, 01:38 
Offline

Joined: 22 Mar 2010, 18:43
Posts: 411
iamVFX wrote:
I make up vector of the curves by this way, maybe you find it useful. Null up vector prevents vector to be flipped when curve is rotated with it

Very interesting, thank you!

So it appears that your magic lies in using a Euler to Rotation and a Rotate Vector. I don't know what exactly this does, but I'll use it on the compound and see if it solves the issues I've had.


Top
 Profile  
 
 Post subject: Re: Extrude Polygon Along Curve
PostPosted: 25 Dec 2011, 11:34 
Offline

Joined: 24 Sep 2010, 18:28
Posts: 656
I'm not sure how it works in this case too, but the fact is that if there will be some crazy rotations along the curve you'll just take a null and move it around to fix it... Not so elegant way I guess but if you want rotate a whole curve you just rotate it with null and there will be no change in polygons direction

_________________
Constantine
Learnable Programming
The Future of Programming


Top
 Profile  
 
 Post subject: Re: Extrude Polygon Along Curve
PostPosted: 02 Jan 2012, 06:09 
Offline

Joined: 09 Jun 2009, 23:47
Posts: 88
the way I do it (as suggested by Guillaume LaForge on the "Create Extrusion along Strands" compound) is to iterate over all curve points and calculate the current normal by rotating the previous normal. This makes every normal dependant on the previous segment, thus making them continuous.

Here's one image showing the math for 2nd point on the curve. Also the icetree.

I think the images will explain better than I could with words, but let me know if you have any problems.

and btw, nice job Chris!


Attachments:
File comment: Normal Rotation
normal_rotation.jpg
normal_rotation.jpg [ 157.96 KiB | Viewed 2187 times ]
File comment: icetree
icetree.jpg
icetree.jpg [ 220.86 KiB | Viewed 2187 times ]
Top
 Profile  
 
 Post subject: Re: Extrude Polygon Along Curve
PostPosted: 02 Jan 2012, 06:27 
Offline

Joined: 09 Jun 2009, 23:47
Posts: 88
...oh, and here is a simple scene that I did to review some stuff. It is as simple as it can get (no optimizations, so expect lots of repeat nodes around). It focus on making the core extrusion functionality easily readable on the icetree.

Just in case you want to check the normal rotation logic...


Attachments:
simple_extrude_along_curve.rar [154.25 KiB]
Downloaded 144 times
Top
 Profile  
 
 Post subject: Re: Extrude Polygon Along Curve
PostPosted: 02 Jan 2012, 17:05 
Offline

Joined: 22 Mar 2010, 18:43
Posts: 411
Thank you for the clear explanation! Your image shows well how the logic needs to work, so it shouldn't be too difficult to implement. Will report back :)


Top
 Profile  
 
 Post subject: Re: Extrude Polygon Along Curve
PostPosted: 12 Jan 2012, 22:03 
Offline
Administrator
User avatar

Joined: 04 Jun 2009, 12:15
Posts: 3844
@Chris_TC - If it takes longer to complete it, would it be possible for you to upload the incomplete version of the compound - the one you apparently based the video on - so I can take it apart in private and find out where exactly my own sorry attempt went horribly wrong?
;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group