I’m looking for an easy way to find end points of lines which do not coincide with other geometry.
We are using Rhino5 to build FEA models with beam elements. Each beam is a simple line. Yet for the FEA software to read the geometry correctly, if you want to join beam A to beam B the end point of beam A needs to coincide either with an end point of beam B or the line representing beam B. See the pic below for an example where the end point doesn’t coincide with the nearest line.
Sometimes the geometry is sloppy and end points do not coincide with other geometry. What tools exist to find these free end points?
Using RhinoScript I can think of a coincidence check for end points (find coordinates of point x, select all points at this coordinate, check if there are more than one selected, create a point in a mark-up layer). But I’m struggling to think of a check if a given end point coincides with another line.
You can try this RhinoScript to see if it helps.
(You need to select all the curves you want to analyze, if will end up with only the “open-ended” selected)
Use PointClosestObject using start and end point of each open curve agains all other curves of interest (except the currently tested one). It will return an array of (0) closest object and (1) the closets point on it.
Check the distance between that point and the tested end - if more that file unit tolerance then you have “not touching” end.
That’s what the above script does.
Over here your python script just freezes Rhino on a test file with 3K lines, so can’t really test the speed properly.
I have revised the RhinoScript posted earlier to make sure we get optimal speed for what a script can do, and it seems to be doing “acceptable” : 4.5 sec on 1,000 lines, 17 sec on 2,000 lines and 32 sec on 3000 lines. Not sure what your typical count to analyze is but up to around 10,000 it may work fine.
I included progress meter and time elapsed report.
Maybe it is helpful so you can try to use similar approach in Python RhinoScriptSyntax.