Exploding an object into curves... How to?

   6321   4   2
User Avatar
Member
71 posts
Joined: Oct. 2007
Offline
Hello,

how can I explode, or separate, an object into a set of curves?

For example, a cube primitive would give an object compound of 12 curves (or 12 groups).
So far, some curves I get from a cube correspond to several edges. I would like each edge to become a single curve.


Thank you
Video Game Graphics TD
User Avatar
Member
257 posts
Joined: Nov. 2007
Offline
So each “curve” becomes a single primitive?
This is how to break line segments into primitives (there is almost no other way except for foreach and HDK - I have found the carve to be the fastest):
http://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&p=96818#96818 [sidefx.com]

Here's another solution (fairly expensive workaround though):
-) add a wireframe sop, turn off round corners, set the radius to 0
-) append a convert sop, convert to polygons, set connectivity to Columns, set Divisions per Span to U:1 and V:1.
-) append a delete sop, delete by range (defaults will delete every other primitive, which is what you need)
As you can see this has a lot more overhead, also some of the attributes are lost in the process, so you will have to find a way to attribtransfer and attribpromote them correctly.
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
Carve as illustrated above and from the link also posted above followed by the Remove Duplicate HDA SOP on the Side Effects Exchange works quite well to decimate polygonal geometry to single edges.

Get the Remove Duplicate from here:
http://www.sidefx.com/index.php?option=com_wrapper&Itemid=137 [sidefx.com]

The adjacent primitives each contribute an edge resulting in lots of doubled edges with just straight Carve. Remove Duplicate cleans these up nicely.

Attachments:
cut_up_to_line_segments.hip (52.2 KB)

There's at least one school like the old school!
User Avatar
Member
71 posts
Joined: Oct. 2007
Offline
Hi Jeff,

exactly what I was looking for


Thanks a lot, pclaes. I tried the carve sop and the result is visually correct and fast, but indeed it creates some duplicates, which are not easy to remove.
Your other suggestion is also interesting but will very likely not be suitable for quite big objects…

I'm going to try the Remove Duplicate.
Video Game Graphics TD
User Avatar
Member
71 posts
Joined: Oct. 2007
Offline
The carve sop + remove duplicates setup works very well

Now I will have to iterate through every primitive as if they were curves. I guess a ForEach sop will do the trick (I have to learn how to use it but I saw some very good tutos from Peter Quint on it).

As I use a function to manipulate the curves, do you think it would be possible to integrate the look into it? How can I specify the primitive into it? It will probably involve $PR and $NPR, but I don't know exactly how.

Thank you
Video Game Graphics TD
  • Quick Links