how fuse differents curve and to have only 1 polygon

   31008   12   5
User Avatar
Member
120 posts
Joined: June 2008
Offline
hello all,
sorry for my english.. tell me if you don’t understand.

I created several curves (1 curve cut in to several) and i fused this curves..

it seem that i can't fuse several curve to obtain only 1 curve with only 1 primitive.
if i fuse my curves, i keep always 1 primitive per curve. but i want 1 big curve and 1 primitive..

someone have an idea how i can retrieve only 1 primitive when i fuse my curve?

i give you a demo
Please, if someone can help me..
Bests regards.
Thank you very much

Attachments:
demo_fuse_A.hipnc (58.3 KB)

User Avatar
Member
1391 posts
Joined: Dec. 2010
Offline
the “Fuse SOP” only merge all overlapped points , But it keep each primitives , Because each primitives has it's own vertices !

I know that you can delete all overlapped primitives by “Clean SOP” , Just you should turn on “Fix Overlaps” parameter , Also if you wanna use this for curves , You should turn off “Delete Overlaps Pairs” too .

Important note is your curves should be has exactly same point count and same point position(overlap).
:?
https://www.youtube.com/c/sadjadrabiee [www.youtube.com]
Rabiee.Sadjad@Gmail.Com
User Avatar
Member
120 posts
Joined: June 2008
Offline
hi,
thank you very much..
but this don’t work..
nothing change..
can you try with my attached file?
clean sop don’t change anything
User Avatar
Member
614 posts
Joined: Aug. 2008
Offline
merge the curves, and after that use a join node.

that will produce 1 primitive curve.
User Avatar
Member
333 posts
Joined: Oct. 2012
Offline
pelos
merge the curves, and after that use a join node.

that will produce 1 primitive curve.

this wont work with overlapping lines. check his example! unfortunatelly i dont know how to solve this.
User Avatar
Member
120 posts
Joined: June 2008
Offline
thank you..
but effectively, this don’t don’t work..
i don’t find solution..
User Avatar
Member
614 posts
Joined: Aug. 2008
Offline
after is been cut, convert each part (after the disolve)in to nurbs,
merge and join.

(i get a lot of errors on the nodes to be able to make a case file and upload it.)
User Avatar
Member
224 posts
Joined: June 2009
Offline
I have also always had trouble with the join node.

In the attached file I give an simpler example. I generate a bunch of line segments (no duplicates, no overlaps) and try to join them ro create single polygon.

It seems that in order for it to work, the line segments have to be a) in the right order and b) pointing in the right direction. Only then will the join node work.

I am wondering why the join node does not do this for you? It should be a simple algorithm.

Attachments:
join.hipnc (59.7 KB)

Patrick
User Avatar
Staff
4432 posts
Joined: July 2005
Offline
I don't believe there is a built-in SOP that does quite this. However, try putting the following into a Python SOP after the Fuse SOP:


node = hou.pwd()
geo = node.geometry()

# Create dictionaries of all edges by start and end point.
startPointDict = {}
endPointDict = {}
for prim in geo.iterPrims():
for edge in prim.edges():
points = edge.points()
startPointDict[points] = points
endPointDict[points] = points

# Delete all existing prims, but keep the points.
geo.deletePrims(geo.prims(), True)

# Make a list of points that start an edge but don't end one.
startPoints =
for point in startPointDict.keys():
if not endPointDict.has_key(point):
startPoints.append(point)

# Create a curve beginning at each start point.
for point in startPoints:
poly = geo.createPolygon()
poly.setIsClosed(False)
poly.addVertex(point)
nextPoint = startPointDict
poly.addVertex(nextPoint)
while startPointDict.has_key(nextPoint):
nextPoint = startPointDict
poly.addVertex(nextPoint)


It should be able to handle multiple disjoint polygons, but doesn't handle branching (where one start point has more than one end point). I believe it does what you want at least on your first test file.

I hope that helps,
Mark
User Avatar
Member
120 posts
Joined: June 2008
Offline
hello,
thank you very much.
i will try this.
but not this week.. i’m really busy.

Best regards
User Avatar
Member
3 posts
Joined: Feb. 2012
Offline
mtucker
I hope that helps,
Mark
This code give the error in 13 line
User Avatar
Member
333 posts
Joined: Oct. 2012
Offline
in H16 sidefx added the polypath SOP which can do this now. check inside the sop for how it works.
User Avatar
Member
4 posts
Joined: March 2015
Offline
Doudini
in H16 sidefx added the polypath SOP which can do this now. check inside the sop for how it works.
7 years later and this is the winning solution for consolidating multiple curves. Thanks!
Edited by Anton81 - March 20, 2024 02:56:44
  • Quick Links