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.
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:
Either solve a classic Polyline 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.
I’m not sure if this is exposed in native Grasshopper components, but I think the lines-to-mesh method was originally part of the Weaverbird plugin if I recall.
Yes but it requires coding skills (mid to advanced) while all my C#'s for that are strictly internal. That said - seeing your example captured - I would strongly suggest to avoid reverse engineering.
See some general PCD cases (Primary Cirquit Detection)
If on the other hand you know how to code (C#) I could provide some hints and a general methodology for this problem. BTW the final - Recursive - phase is more or less similar with what we do for Island detection in Graphs).
In your snap there’s hexagons that are made via some sort of procedure, say, by dividing a BrepFace (or you can do a flat solution and morph map it to some target). This means - at least for this case - that the hexagons should been detected at creation time. If on the other hand you have a Graph (from uknown source) that looks like a collection of hexagons and you want these hexagons (or some other thing) … well … that’s what we call reverse engineering (i.e. going from the result/end to the start).
Well … I have tons of C#'s that divide something (Curves/BrepFaces/Breps/Meshes/Cats/Dogs etc). If you want an Entry Level C# notify (but it would be pure code meaning that you can’t modify/change a thing).
See some simple tests (with “patterns” so to speak) using BrepFaces (i.e. a Surface [open or closed in u/v - or in both dirs] with Trim data).
That said if there’s some sim/singularity (closure in u/v) the C# modifies accordingly the user u/v division values in order to achieve the obvious. The typical output is DTrees with ordered vertices (so you can do a Polyline).