04-27-2016 03:13 AM - edited 04-27-2016 03:15 AM
Hello,
I am currently searching for a VI to fill the polygon shape with parallel line patterns. However, it seems there is no ready VI to use.
So I start to work from scratch. One core VI then would be find the intersections between a line and a polygon.
Indeed, I found Convex Polygon Intersection VI (Shown in the Figure below) and Lines Intersection VI which are not 100% fit my objective. Can anyone give some hints?
If there is no existing VI, I plan to bulid a VI that caculate line interesection with each line of a polygon, but I guess it would be computional expensive.
Thank you for your comment either about the polygon fill with lines or intersections between a line and a polygon.
Sparkle
04-27-2016 09:11 AM
It is always helpful to attach a VI, even if you are just getting started and have very little code, as it will tell us some things about what you are doing.
So I'm going to assume (= "guess") that you are talking about 2D Pictures from the Graphics and Sound Palette. If I were doing this, I would do it a little differently than you describe.
I'd start by drawing an image full of parallel lines (using the Draw Line function) -- this will become my "fill". I'd use the Polygon information to create a Mask (keep everything inside the Polygon, clear everything outside the Polygon) and apply it to my "fill". Add the polygon, itself, and you have a "filled polygon". Repeat as needed.
Bob Schor
04-27-2016 09:25 AM
If you have MGI installed, the Coordinates palette has a 2D intersection of 2 lines VI. You only have to supply the endpoints of the lines.
04-27-2016 09:46 AM
Do you need their coordinates, or do you finally need to see a filled polygon as an image?
Look at mask features: draw lines over all image (or rectangle that covers all polygon), convert polygon into mask (ROI to mask, etc), apply mask, profit..
04-27-2016 11:00 AM
Hello Alexander,
I have the coordinates of those polygon and I am thinking to use both ways : image processing tool or pure geometry algorithms.
After one day's work, I can realize some of my expectations now (see figure below). But it is still not as good as I want.
If some happens to know some basic algorithms which are easy to implement in LabVIEW or ready to use C library, I appreciate for the comment.
Best Regards,
sparkle
04-27-2016 11:04 AM
Dear Bob,
That is what I have done today. Thanks for the comment.
Best Regards,
Sparkle
04-27-2016 11:07 AM
Hello Aputman,
Thanks for the comment. It is my first time to know that there are external function libraries existing. I will have a look tomrrow.
Best Reagrds,
Sparkle
01-11-2017 10:54 AM
Hello, can you send me this programm
01-01-2020 12:16 PM
I have just released a couple of VIs for polygon clipping/growing/shrinking on VI package manager. The polygons are not restricted to convex polygons but can be arbitrary.
The VIs can be found on VIP by searching for 4SmartMachines.