karolek Posted October 6, 2016 Report Share Posted October 6, 2016 Hi I'm trying to make an envelope around a shape that is not convex. When envelope width is too big, the shape that is created contains "loops", like that red one: The problem is that I want to use Point In Polygon.vi to remove all outliers and artifacts out of the envelope, but this vi will give me incorrect result inside those "loops" (points are marked Outside of polygon instead of Inside) Is there some smart way of finding and removing those "loops"? I can use all the functions from vision library if needed. Quote Link to comment
shoneill Posted October 6, 2016 Report Share Posted October 6, 2016 Check to see if any line intersects with any other. For N line segments, this requires (N-1)! comparisons. Easiest way to do it. Once you know which lines intersect, you can remove the in-between lines and move the start / end point of the two directly affected lines to the intersection point. Quote Link to comment
Popular Post MikaelH Posted October 6, 2016 Popular Post Report Share Posted October 6, 2016 Here is a quick hack that does the job. I hope you have the Vision Sub VI, to find the Line Intersection point. I use that in combination with a OpenGDS VI to see if 2 lines intersect, sorry didn't have time to document it nicely. //Mike OpenGDS_LineIntersectLine.zip 3 Quote Link to comment
MikaelH Posted October 7, 2016 Report Share Posted October 7, 2016 BTW this is the end result with the VI above: Quote Link to comment
karolek Posted October 7, 2016 Author Report Share Posted October 7, 2016 Perfect! that's what i needed It seems like I'd spend too much time on this. Thanks! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.