how to get the outline of two partly overlapping polygons
15003 13 3- oat
- Member
- 479 posts
- Joined: Dec. 2009
- Offline
- blonde
- Member
- 53 posts
- Joined: Oct. 2010
- Offline
- pclaes
- Member
- 257 posts
- Joined: Nov. 2007
- Offline
How accurate does this need to be?
I have had to approximate shapes in the past and I used a “circle/sphere shrinking” approach.
You basically put a low resolution polysphere around your objects, snap them to the object with a ray sop, subdivide, snap them again with a ray sop, subdivide, snap them again… In 2D you use a circle.
This will give you an approximate shape, like a rough collision mesh.
If you want high accuracy I think you will have to experiment with the clip sop and with the new geometry clipping nodes in h11 (the ones to do the voronoi type clipping).
I have had to approximate shapes in the past and I used a “circle/sphere shrinking” approach.
You basically put a low resolution polysphere around your objects, snap them to the object with a ray sop, subdivide, snap them again with a ray sop, subdivide, snap them again… In 2D you use a circle.
This will give you an approximate shape, like a rough collision mesh.
If you want high accuracy I think you will have to experiment with the clip sop and with the new geometry clipping nodes in h11 (the ones to do the voronoi type clipping).
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
- rmagee
- Staff
- 1185 posts
- Joined: July 2005
- Offline
If they are both on the same plane then you can use the cookie sop and set it to intersect. Make sure they are merged into the same object.
if they are in separate objects then you can use the boolean tool on the Model shelf - it will set up the cookie and merge the nodes for you.
Robert
if they are in separate objects then you can use the boolean tool on the Model shelf - it will set up the cookie and merge the nodes for you.
Robert
Robert Magee
Senior Product Marketing Manager
SideFX
Senior Product Marketing Manager
SideFX
- oat
- Member
- 479 posts
- Joined: Dec. 2009
- Offline
Thank you, guys!
I've tried the methods suggested by you but still can't figure it out.
Please refer to the hip file attachted.
As shown in the image, what I want to get is the precise shape on the right which is the outline of the three overlapping plannary polygons on the left.
Can you help to advize on how to do this?
Thanks again!
I've tried the methods suggested by you but still can't figure it out.
Please refer to the hip file attachted.
As shown in the image, what I want to get is the precise shape on the right which is the outline of the three overlapping plannary polygons on the left.
Can you help to advize on how to do this?
Thanks again!
- pclaes
- Member
- 257 posts
- Joined: Nov. 2007
- Offline
This is using that circle fitting technique. Doesn't work with every shape, but most convex shapes should be fine and even concave shapes that are not to extreme should work too.
In this case it is fairly exact, but a bit more computationally expensive then perhaps other techniques.
In this case it is fairly exact, but a bit more computationally expensive then perhaps other techniques.
Cg Supervisor | Effects Supervisor | Expert Technical Artist at Infinity Ward
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
https://www.linkedin.com/in/peter-claes-10a4854/ [www.linkedin.com]
- mark
- Staff
- 2638 posts
- Joined: July 2005
- Offline
oat
Thank you, guys!
I've tried the methods suggested by you but still can't figure it out.
Please refer to the hip file attachted.
As shown in the image, what I want to get is the precise shape on the right which is the outline of the three overlapping plannary polygons on the left.
Can you help to advize on how to do this?
Thanks again!
Try the “Remove shared edges” option in the divide SOP.
- oat
- Member
- 479 posts
- Joined: Dec. 2009
- Offline
- rmagee
- Staff
- 1185 posts
- Joined: July 2005
- Offline
Attached is a network with several cookies which are then merged and fused then interior edges are removed to give you your outline. This is a working solution to this particular problem (three overlapping shapes) - as you add more and more shapes, this solution would become unwieldy…
Robert Magee
Senior Product Marketing Manager
SideFX
Senior Product Marketing Manager
SideFX
- oat
- Member
- 479 posts
- Joined: Dec. 2009
- Offline
dear experts, It seems that no easy solution is available to get the outline of a series of partly overlapping polygons.
The following image and hip file indicate my intention.
What I want to get is the polygon to the right based on the polygons to the left independent on how these polgyons may overlap.
Can you help to suggest a general and efficient way to achieve this?
Thanks in advance!
The following image and hip file indicate my intention.
What I want to get is the polygon to the right based on the polygons to the left independent on how these polgyons may overlap.
Can you help to suggest a general and efficient way to achieve this?
Thanks in advance!
- digitallysane
- Member
- 1192 posts
- Joined: July 2005
- Offline
- tamte
- Member
- 8785 posts
- Joined: July 2007
- Offline
here is an example using foreach and cookie node
it should work ok for multiple primitives but not for every case because it's using cookie
but if not working properly you can use Do Jitter parameter on cookie and/or change order of primitives or upscale geometry before processing then downscale after
it should work ok for multiple primitives but not for every case because it's using cookie
but if not working properly you can use Do Jitter parameter on cookie and/or change order of primitives or upscale geometry before processing then downscale after
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- oat
- Member
- 479 posts
- Joined: Dec. 2009
- Offline
deat tamte,
thank you so much for the solution!!!
The approach you suggested works for most of the cases except for the situation as shown in the attached hip file when we bypassed one of the polygons (curve 2).
Can you help to take a look of this case?
Also can you kindly explain a little bit the rationale of the vex sop you developed?
Thank you!!!
thank you so much for the solution!!!
The approach you suggested works for most of the cases except for the situation as shown in the attached hip file when we bypassed one of the polygons (curve 2).
Can you help to take a look of this case?
Also can you kindly explain a little bit the rationale of the vex sop you developed?
Thank you!!!
- tamte
- Member
- 8785 posts
- Joined: July 2007
- Offline
for that case turn off Do Jitter on cookie1 inside the for loop
i am sorry but there is no 100% solution if you use Cookie SOP, but with minor tweaks you can make it work
re-read the suggestion i gave in my previous post how you can troubleshoot
so for this case turning off Do Jitter works as well as appending Sort SOP right after merge1 and setting it to Primitive Random and seed to 3
or just change order of inputs in merge1 to working one, but it's easier by changing seed in Sort SOP
the VEX is just checking if the angle between two edges that belong to each point is almost 180° (within tolerance) and therefore if the point lies on straight line and can be removed
then blast node removes all those points and thus optimizes resulting polygon curve
(it works only with closed polygon curves so that every point has exactly 2 edges, but this is your case i presume)
i am sorry but there is no 100% solution if you use Cookie SOP, but with minor tweaks you can make it work
re-read the suggestion i gave in my previous post how you can troubleshoot
so for this case turning off Do Jitter works as well as appending Sort SOP right after merge1 and setting it to Primitive Random and seed to 3
or just change order of inputs in merge1 to working one, but it's easier by changing seed in Sort SOP
the VEX is just checking if the angle between two edges that belong to each point is almost 180° (within tolerance) and therefore if the point lies on straight line and can be removed
then blast node removes all those points and thus optimizes resulting polygon curve
(it works only with closed polygon curves so that every point has exactly 2 edges, but this is your case i presume)
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
-
- Quick Links