Jump to content

VectorScript: Detect self-intersecting polygon/polylines


Recommended Posts

Hello, all. Looking at the VectorScript function reference I see no functions that could tell whether a given polygon/polyline is self-intersecting. The only function that is told that it 

Quote

"... Should remove self-intersecting segments from the result. ..."

is the VS:OffsetPoly. But I don't want to see if a polygon/polyline is self intersecting as a side effect of an operation that actively acts on the selected object but just a read-only operation whether it is self-intersecting or not. Any suggestions are welcome.

Link to comment
  • Vectorworks, Inc Employee

I just played around with the script some more and realized that it only catches certain cases. The script basically creates two identical copies of the source poly and does an "intersect surface" on them. It will detect polys that intersect themselves like the poly to the right (in the attached image) because the "intersect surface" function will result in separate polys on each side of the intersection. So it does intersect surface, then counts to resultant polys. If there are more than one, the poly intersects. However, the poly on the left (in the image) will not be detected. I have some ideas of how this might be done but I need to spend a little more time.

 

Screen Shot 2017-01-20 at 9.53.01 AM.png

Link to comment
  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...