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
how fuse differents curve and to have only 1 polygon
32814 12 5- supermac
- Member
- 120 posts
- Joined: 6月 2008
- Offline
- Sadjad Rabiee
- Member
- 1391 posts
- Joined: 12月 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).
:?
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).
:?
- supermac
- Member
- 120 posts
- Joined: 6月 2008
- Offline
- pelos
- Member
- 621 posts
- Joined: 8月 2008
- Offline
- Doudini
- Member
- 333 posts
- Joined: 10月 2012
- Offline
- supermac
- Member
- 120 posts
- Joined: 6月 2008
- Offline
- pelos
- Member
- 621 posts
- Joined: 8月 2008
- Offline
- phtj
- Member
- 224 posts
- Joined: 6月 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.
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.
Patrick
- mtucker
- スタッフ
- 4523 posts
- Joined: 7月 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
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
- supermac
- Member
- 120 posts
- Joined: 6月 2008
- Offline
- avv79
- Member
- 4 posts
- Joined: 2月 2012
- Offline
- Doudini
- Member
- 333 posts
- Joined: 10月 2012
- Offline
- Anton81
- Member
- 6 posts
- Joined: 3月 2015
- Offline
-
- Quick Links