The opening in my CAD contains diagonal lines, so when I group curver and create shaft opening from them it gives error. Only lines created from circles or openings in cad without diagonal lines can be created.
Split the list up, after the group curves node, by list length, assuming you only have lists containing 1 or 5 items, such that you now have a list with sublists of 5 to work with.
Sort the sublists in this list by curve length.
Remove the first or last list, depending on which one is the longest one, since the diagonal is always the longest one.
as far as i think it is possible to get the contour of the whole cuvers and get the contour of that group however i can’t find any node that matches my thinking
In addition, there are some cases where the diagonal is shorter than the contour, so it is not reasonable to arrange to remove the line with the largest length.
You could use a Convex Hull algorithm for that, just note that this doesn’t really work well for circles, so you will still have to split those before.
I’ll try to create a simple script working for you.
Convex hull should account for most cases, but if not you could take each curve and check how many other curves it meets. In total a diagonal should meet 4 other curves, whilst a non diagonal edge should meet 3 or less.
Assuming you don’t have any curved lines… worry not about the curves but their endpoints.
Any line which is on the diagonal will have both endpoints touch a total of three curves. Any line in the perimeter will always have one end which only touches two curves. Testing endpoints for intersection counts should allow you to build a boolean which can filter to just the diagonal.