05-21-2010 07:43 PM - edited 05-21-2010 07:51 PM
Hi all,
A bunch of lines (segments) which are defined by a Start XY and End XY co-ordinates.
These segments overlap to form a GRID. I must find and divide these segments at their intersections.
The image below shows 4 segments (black lines) which intersect (intersections highlighted by red circle). The result for this example should be 12 segments which are connected are their endpoints only.
05-21-2010 08:04 PM
I have implemented a method of finding Segment-Segment intersections based on the code given in "Computational Geometry in C." by Joseph O'Rourke. However, I want to be able to do this reliably and this code does not deal well with the issues with floating point numbers.
Are there in-built tools in LabVIEW which can do (or help me to do) what I want with these segments (i.e. to find segment intersections, or to build a grid from segments)? Currently I am looking at (but have never used) the MathScript functions.
Does anybody know how to solve this problem?
05-24-2010 06:28 PM
05-24-2010 08:26 PM
Hueter wrote:
If you know the start and end point you can calculate the slope (rise/run) then translate the line so it crosses the start point. Once you do these two things you should have a polynomial for your line. Then you simply solve one equation for the other to find the intersection. Once you have the intersections, you can build your line segments.
That's a valid although inefficient way of doing it.
Are there any in-built tools available in LV to find segment(vector) intersections?
05-25-2010 04:02 AM
I'd start with the approach Hueter suggested. But the equations will form a set of linear equations which you can solve using linear algebra functions. I'm not into LA, but if I remember correctly, that was one of the indroduction use cases for that topic.
Felix
06-01-2012 12:19 PM
I would also be interested in an answer to this one and any ideas. We are looking at glass fibre length distributions and crossing fibres pose real problems.
I have attached a thresholded image showing a typical distribution.
06-03-2012 11:21 AM
@bparveen wrote:
We are looking at glass fibre length distributions and crossing fibres pose real problems.
This is a completely different problem and I would recommend that you start a new thread.
This thread is about finding line segments seperated by crossover points, while you are looking for the lenghts of the entire fibers, ignoring any crossovers.