I have a polygon primitive line with points: 0 1 2 3 4.
Is there a cheap way of splitting the primitive at point 2, so that the result is two primitives with the following points?
- 0 1 2
- 2 3 4
I'd also like to be able to split a line at points where an attribute has a specific value.
Split poly line at a point
27418 5 4- wbronchart
- Member
- 48 posts
- Joined: Sept. 2013
- Offline
- dan.baciu
- Member
- 30 posts
- Joined: Sept. 2010
- Offline
You can use carve SOP. Check “Second U” and set it at 1. Check both “Keep Inside” and “Keep Outside”. For “First U” you need an expression. To cut at exact point position (on curve) you need to divide 1 (parametric length of the curve) by the number of points, and then multiply this with the number of the point where you want to cut.
Something like this (for an open curve):
1/(npoints(“../” + opinput(“.”, 0))-1) * 9
The last number (9) is the number of the point where the curve will split
npoints(“../” + opinput(“.”, 0)) returns the number of points in the node fed into the first input of the current node
Something like this (for an open curve):
1/(npoints(“../” + opinput(“.”, 0))-1) * 9
The last number (9) is the number of the point where the curve will split
npoints(“../” + opinput(“.”, 0)) returns the number of points in the node fed into the first input of the current node
- wbronchart
- Member
- 48 posts
- Joined: Sept. 2013
- Offline
- cwhite
- Staff
- 727 posts
- Joined: Oct. 2012
- Offline
- wbronchart
- Member
- 48 posts
- Joined: Sept. 2013
- Offline
- grayOlorin
- Member
- 1799 posts
- Joined: Oct. 2010
- Offline
-
- Quick Links