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.
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.
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.
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..
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.
Thanks for the comment. It is my first time to know that there are external function libraries existing. I will have a look tomrrow.