I would like to get centreline of closed polylines, though its not centre always as it adapts to other centelines linearly. I have attached image for reference and also geometry to test it. Is there any gh component to achieve this? please help!!
You don’t ask a simple question and there is not just an answer. I think you could better work with the rectangles from the other discussions and extract their center lines and work with that. But it is not simple.
What settings should be used for bigger objects like stairs stringers? I’m trying to find a “centerline” which could help for automatic placing cups on a cnc router: center_lines_frompolylines_rectangles (1).gh (27.4 KB)
I’d like to have a curve like your “C” shape example.
Hello
I am not sure I understand your question, what is sure is that my script doesn’t accept more than one curve at once ! I didn’t try to implement the logic for multiples curves. It is doable but takes time.
If it is not that can you draw what you are after ?
Thank you Laurent, Ok for the single object, it works better indeed, (however in my case, grafted list of polylines would be useful ) Here is examples what I am looking for:
Here an updated script, it works with multiple curves, I added some slider for curve simplifications, … Hope the naming are quite explicit. But It isn’t a 100% all what you want script ! center_lines_frompolylines_rectangles_v2.gh (26.4 KB)
What I meant is that if you use boxes, then there is no need to use Laurent’s approach as it deals with closed curves of all types, and you only need boxes, which simplifies the task a lot.
Here is a simple approach. The logic is to first generate longest center line of each rectangle. And then extend those to meet up the other curves, by projecting the end point to the closest curve. Naturally this creates some diagonal lines, which are culled. Then some exterior lines, which are also culled, and finally some pieces of the axes need to be trimmed, so they are also culled depending on their distance to the edge region.