Hi, I have lots of bunches of separate lines which describe surfaces on a plane. Running the Join component doesn’t always give me the right result given the ‘internal’ lines. What would be the best approach to find the biggest closed curve / or which lines are ‘internal’? ‘Internal’ lines highlighted on the below screengrab.
Windows 10.0.0 SR0.0 or greater (Physical RAM: 32Gb)
Machine name: LSI-WS-048
Computer platform: DESKTOP
Standard graphics configuration.
Primary display and OpenGL: NVIDIA Quadro RTX 4000 (NVidia) Memory: 8GB, Driver date: 4-26-2024 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 538.62
> Accelerated graphics device with 4 adapter port(s)
- Secondary monitor attached to adapter port #0
- Windows Main Display attached to adapter port #1
Secondary graphics devices.
Citrix Display Only Adapter (Citrix Systems Inc.) Memory: 0MB, Driver date: 3-14-2024 (M-D-Y).
> External USB display device with 8 adapter port(s)
- There are no monitors attached to this device!
Citrix Indirect Display Adapter (Citrix Systems Inc.) Memory: 0MB, Driver date: 2-27-2024 (M-D-Y).
> External USB display device with 8 adapter port(s)
- There are no monitors attached to this device!
OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On
Anti-alias mode: 4x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High
Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 4-26-2024
Driver Version: 31.0.15.3862
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 8 GB
In place of that, the best approach I can think of is:
Pick a start point which only connects to two other points.
Find a line that connects
Repeat until you arrive back at the first point
Any point that has more than two connecting lines, Pick the first point in a clockwise manner
It’s not perfect logic as it depends on what point I pick as the start point - probably need to compare against picking anti-clockwise too, and go with the longer of the two lists.
I’m well aware that there may be some GH components which do most of this for me - but as I’m pretty new to it, I have no idea.
if you are working with polylines only I think Clipper is the best in slot for Rhino 6 for this task (Food4Rhino states Clipper should work with Rhino 6)
Thanks, I’ve got Clipper installed. The only useful looking component is Polyline Boolean Union, but it doesn’t seem to get me much further, unless I’m missing something. It still requires the calculation of closed shapes beforehand, which is the step I’m stuck on…
you are right, I forgot the intermediate step of creating the different regions .___. which is quite a fundamental one
I don’t know if Heteroptera’s Geometric Cell component relies on Rhinocommon or has some internal methods to create regions from curves, I don’t have an R6 installation to give it a try… you can try by opening this file after installing Heteroptera from food4rhino (I see there’s a R6 compatible version) Heteroptera | Food4Rhino
you will also have to replace Clipper2 Union component with Clipper1 equivalent
[edit] just a note on the method you describe and might work for this task
I think it might be a good solution, and I guess you don’t necessarily need to find already the regions with maximum extension/perimeter/area in the first step: you just need to be sure you have found all of them, then you could just region_boolean them together to find the ones with max extent?
which is sort of… your lines compose an undirected graph of nodes and edges, where edges are the lines and nodes are the line end points: for each node, find all the loops in the graph using each edge max 1 time…
but to keep things simpler, surface split should also work: