Curve intersection problem!
5983 17 1- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
- Aizatulin
- Member
- 495 posts
- Joined: July 2005
- Offline
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
Aizatulin
Hi,
what exactly is not working?
If you want to keep the right input (ComboBox->“Right-face pieces”: Keep All).
The intersection points are calculated correctly for me (H17.5.229) indepently of this option.
thats weird, for me this is the result, the intersections are not solved aparently? Just to be clear, i want to keep everything that is inside the curve mask, like the boolean alternative i have in the file
Edited by papsphilip - July 23, 2019 02:41:15
- Aizatulin
- Member
- 495 posts
- Joined: July 2005
- Offline
ok
I think I got it wrong.
You want to delete all points, which are outside your mask.
Perhaps it will work with boolean too, but one solution (if you have already applied curvesect) is to use the extruded mask to find for every point/prim its number of intersections with the mask(box) of a ray from itself to any direction (long enough). If this number is even, the point should be outside, so you can remove it.
Check my attachement …
(edit: polyexpand before extrusion and smaller tolerances for the intersection function tends to give more stable results - if the mask is non-convex)
I think I got it wrong.
You want to delete all points, which are outside your mask.
Perhaps it will work with boolean too, but one solution (if you have already applied curvesect) is to use the extruded mask to find for every point/prim its number of intersections with the mask(box) of a ray from itself to any direction (long enough). If this number is even, the point should be outside, so you can remove it.
Check my attachement …
(edit: polyexpand before extrusion and smaller tolerances for the intersection function tends to give more stable results - if the mask is non-convex)
Edited by Aizatulin - July 23, 2019 17:26:25
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
Aizatulin
ok
I think I got it wrong.
You want to delete all points, which are outside your mask.
Perhaps it will work with boolean too, but one solution (if you have already applied curvesect) is to use the extruded mask to find for every point/prim its number of intersections with the mask(box) of a ray from itself to any direction (long enough). If this number is even, the point should be outside, so you can remove it.
Check my attachement …
(edit: polyexpand before extrusion and smaller tolerances for the intersection function tends to give more stable results - if the mask is non-convex)
thanks!! i tweaked it a little bit added a final fuse and polyexpand at the end to make each piece a surface and it works like a charm, i hope this workflow is not going to crash when i plug in thousands of curves and masks
Edited by papsphilip - July 26, 2019 15:40:27
- Aizatulin
- Member
- 495 posts
- Joined: July 2005
- Offline
Sure ,
For me it works even better (with less artifacts), if I put a “convert line node” in front of the first input of “pointwrangle1” and loop over prims (instead of points) in “pointwrangle1”, but I'm not sure if this will increase/decrease the performance.
“Convert line” converts each edge to a separated prim, which should be an advantage, because now each center point can determine, if a prim is outside/inside.
For me it works even better (with less artifacts), if I put a “convert line node” in front of the first input of “pointwrangle1” and loop over prims (instead of points) in “pointwrangle1”, but I'm not sure if this will increase/decrease the performance.
“Convert line” converts each edge to a separated prim, which should be an advantage, because now each center point can determine, if a prim is outside/inside.
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
Aizatulin
Sure ,
For me it works even better (with less artifacts), if I put a “convert line node” in front of the first input of “pointwrangle1” and loop over prims (instead of points) in “pointwrangle1”, but I'm not sure if this will increase/decrease the performance.
“Convert line” converts each edge to a separated prim, which should be an advantage, because now each center point can determine, if a prim is outside/inside.
ok i'll try that and see what happens when i import a whole network of curves. i'll post the results here
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
- Andr
- Member
- 899 posts
- Joined: Feb. 2016
- Offline
hi have a look at the hip file…
it works by getting the intersecting points, and reconstruct the polylines using the sourceprim and sourceprimuv attributes..
It seems working, but I feel there should be a SINGLE NODE solution for that.. I never understood how to make work the mofo of a node that is the polycut.
it works by getting the intersecting points, and reconstruct the polylines using the sourceprim and sourceprimuv attributes..
It seems working, but I feel there should be a SINGLE NODE solution for that.. I never understood how to make work the mofo of a node that is the polycut.
Edited by Andr - July 28, 2019 11:18:44
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
Andr
hi have a look at the hip file…
it works by getting the intersecting points, and reconstruct the polylines using the sourceprim and sourceprimuv attributes..
It seems working, but I feel there should be a SINGLE NODE solution for that.. I never understood how to make work the mofo of a node that is the polycut.
wow thanks!! that was way too complex…one node setup sounds sweet. I'll test it some more, but can you explain a bit more the basics of the vex you wrote? i understand most of it but it would help to know what each step does (still learning)
if we could find some documentation on the mofo of a node it'be nice.I've only used it for loop cuts on quads, never on something more complex.
- Andr
- Member
- 899 posts
- Joined: Feb. 2016
- Offline
Yes it's complex, and shouldn't be… probably there's a node that I'm not aware of that does it already. That polycut I guess..
Anyway this is the logic of the proposed setup:
It uses the sourceprimuv attribute outputted by the intersection analysis.
This attribute tells you at which intrinsic UV position the intersecting point is located on the primitive. So a sourceprimuv value of .25 tells you that the point location is at 1/4 of the total length of the polyline. Range is 0-1.
So you have all the intersecting points with the prim number of origin (sourceprim attrib) and the intrinsic UV position of the cut (sourceprimuv attrib).
You just need to merge the intersecting points back with the 2 end points of each primitive. Being end points, you already know their sourceprimuv value: you can hardcode 0 and 1. (that's what the left branch wrangle does)
After you merge the points, you run a for-loop using the sourceprim attrib (“prim”) as iterating class.
On each iteration you are presented with the ends point and the intersecting point of a single primitive.
You just need to re-sort the point number of the points by using their sourceprimuv attribute, so that you have a nicely ordered point numbers. Append the add node to reconstruct the line following the point order.
Anyway this is the logic of the proposed setup:
It uses the sourceprimuv attribute outputted by the intersection analysis.
This attribute tells you at which intrinsic UV position the intersecting point is located on the primitive. So a sourceprimuv value of .25 tells you that the point location is at 1/4 of the total length of the polyline. Range is 0-1.
So you have all the intersecting points with the prim number of origin (sourceprim attrib) and the intrinsic UV position of the cut (sourceprimuv attrib).
You just need to merge the intersecting points back with the 2 end points of each primitive. Being end points, you already know their sourceprimuv value: you can hardcode 0 and 1. (that's what the left branch wrangle does)
After you merge the points, you run a for-loop using the sourceprim attrib (“prim”) as iterating class.
On each iteration you are presented with the ends point and the intersecting point of a single primitive.
You just need to re-sort the point number of the points by using their sourceprimuv attribute, so that you have a nicely ordered point numbers. Append the add node to reconstruct the line following the point order.
Edited by Andr - July 28, 2019 14:54:53
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
Andr
Yes it's complex, and shouldn't be… probably there's a node that I'm not aware of that does it already. That polycut I guess..
Anyway this is the logic of the proposed setup:
It uses the sourceprimuv attribute outputted by the intersection analysis.
This attribute tells you at which intrinsic UV position the intersecting point is located on the primitive. So a sourceprimuv value of .25 tells you that the point location is at 1/4 of the total length of the polyline. Range is 0-1.
So you have all the intersecting points with the prim number of origin (sourceprim attrib) and the intrinsic UV position of the cut (sourceprimuv attrib).
You just need to merge the intersecting points back with the 2 end points of each primitive. Being end points, you already know their sourceprimuv value: you can hardcode 0 and 1. (that's what the left branch wrangle does)
After you merge the points, you run a for-loop using the sourceprim attrib (“prim”) as iterating class.
On each iteration you are presented with the ends point and the intersecting point of a single primitive.
You just need to re-sort the point number of the points by using their sourceprimuv attribute, so that you have a nicely ordered point numbers. Append the add node to reconstruct the line following the point order.
thanks for the detailed walkthrough!
- Aizatulin
- Member
- 495 posts
- Joined: July 2005
- Offline
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
Andr
Yes it's complex, and shouldn't be… probably there's a node that I'm not aware of that does it already. That polycut I guess..
ok, s#$%t that worked…intersectionstitch was the ONE NODE solution we were talking about, i just plugged in the curves on the first input and done. so case closed i guess
- Andr
- Member
- 899 posts
- Joined: Feb. 2016
- Offline
- arjanM
- Member
- 28 posts
- Joined: Nov. 2013
- Offline
- papsphilip
- Member
- 385 posts
- Joined: July 2018
- Offline
-
- Quick Links