Filter and remove overlapping lines

remove curves.gh (9.8 KB)
I am trying to be able to filter and then eliminate the lines that are generated after making an offset … which will cause the lines to overlap one on top of others … the ideal would be to keep the ones greater than or equal to that generated … With this, I would be able to obtain the axis of the different polylines from the edges… this is the idea that occurs to me… if someone wants to share another better idea, I would also appreciate your help,

Hello,

It seems you are looking for the medial axis. There are several threads on the forum discussing this topic with various mathods.

Your geometry (unfortunately not internalized) seems simple, maybe this definition will work - you need to create a planar surface from your boundary and reference it as the input.

MedialAxis.gh (15.7 KB)

You didn’t internalize your geometry (curves).

I’m sorry now the curves go with the correction
remove curves.gh (8.4 KB)

Updated definition above so it works with multiple surfaces at once.
This includes a method to remove overlapping identical curves.

MedialAxis.gh (23.2 KB)

1 Like

excellent solution, above all, it is adaptable to any greater wall thickness… but I have problems with an L-shaped wall, I don’t know, because it does not fully generate one of the mid-axis lines…
and in the case of a simple rectangular wall, it does not generate the median axis
MedialAxis (2).gh (22.3 KB)

For what it’s worth, in my experiments with your first file the number 60 was too low. 70 was needed to remove all the short wall ends.

Now I am testing and using magicteddy’s algorithm and it is the one I refer to since it helps to find the media axis…

Yep I knew it wouldn’t work with single rectangles, but thought this case would never happen !
There is a bug in the Brep Topology component for single surfaces. The tree structure and this special case should be taken care now.

There is also an extension value to increase for end walls, that I calibrated for the previous file but was not enough for this one.

MedialAxis (2).gh (25.5 KB)

1 Like

Thanks for the great help. Now I will study algorithms to understand, above all, geometric reasoning and thus be able to learn more.

Pretty cool! I tried your latest with other geometry and see and anomaly at the top right, where a medial axis line splits into a V shape? By the way, the colors illustrate an issue I saw when I played with this yesterday. See the 7 short segments that make the right edge? Explode Curve, Brep Edges and Deconstruct Brep will separate those segments which can wreak havoc on some algorithms.

This is odd because that geometry was precisely the one that I used to write the script in the first place.
But actually this is obviously a problem with that edge :

The extension is so high that is cuts another part of the shape, where it shouldn’t.

The lazy answer would be : reduce that parameter…

But I added a filtering for those cases. The script works for all three cases encountered in this thread.

MedialAxis_WithFilter.gh (35.0 KB)

1 Like

Hmmm… I haven’t tried to really understand your code but maybe the extended curves should be truncated after the second intersection at each end?

I pull all extensions to the surface and remove all of those that do not touch the start or end point of the original edge.

Thank you very much for all your analysis that you do.
I tell you that in the algorithm that I try to develop in the first instance, I will filter or separate the walls by a certain thickness assigned to the name of the layer… I have not tested the algorithm in the entire drawing that I will import, but there will be several rectangles within it. …even an initial idea was to divide all the walls into rectangles and then obtain the axes of these…but I wanted to see if it could be done in another more direct way without having to divide them into rectangles…but maybe it could be done operates in this way these problems are not generated that point out…