Find closed curves from group of connected lines

Hi!

I want to be able to select the lines from a big group (which is based on the edges of some voronois + other scripts) which compose a closed polyline. So what you would see in the image would become 2 polylines. It should be able then to select twice the shared edge.

One note: the resulting polylines are NOT going to be planar.

If I should somehow rephrase it, I would like to achieve something like the reverse of a Deconstruct Brep ultimately, I have tried with the Delauney Mesh component, but I think it’s better to stick with finding closed polylines.

Also: it should not form perimter of all the possible curves, but the smallest ones that are not comprised within another curve.

Do you have an example file with non planar line segments?

Here, it’s internalised in this file.

2.3.ExampleCurves.gh (2.3 KB)

This sort of reverse engineering (doable via code, mind the so called primary closed cirquits problem … but why waste effort that way?) is NOT the rational procedure to address similar problems. Go to the root of the matter: how these polylines are made and then:

  1. Either solve a classic Polyline in contact connectivity - like:

  1. Or solve a classic Brep in contact connectivity - like:

Bad news: is unlikely that you can do either without code (or some plug-in … if it exists). Notify if you want some hints in case that you want to attempt that kind of stuff via C#.

That said connectivity is a way to corelate one or two Lists of objects: a DataTree of type int where the path second dim (case: paths with 2 dims) or the path dim (case: path with 1 dim) is the index of the parent object in the first List and the items are the indices of objects in the second (or first) List. For instance for a Mesh a VV (V for Vertex) connectivity corelates items in one List while a VE (E for Edge) connectivity corelates items in 2 Lists.

1 Like