Hello,
I’ve been trying to figure out how can I detect the right triangles that may exist along a shape borders (curve). My input comes as 2D polylines and my goal is to get an regular shape as a left over. I’ve tried look for trigonometry to understand how determine cathetus only getting the hypotenuse and inside angles.
Here an example kind of shape that I can get:
And here my goal:
(Red dash lines are the possible right triangles and Blue ones are the left over shape)
I’ve tried some ways, for example, shifting the vertexes I can get the position of the actual vertex and its back and front vertexes as well, so I can draw a rectangle. Also I can draw a circle from the midpoint of my hypotenuse to the front vertex. After drew the rectangles I test which circle has 4 points incidents, and then culling the outside points from the original shape.
My result was:
Definition:
Seems working fine, but actually my real input could be a non orthogonal shape, for example:
(I drew the right triangles manually in red lines).
My definition doesn’t work in this type shape and I can’t figure out how to solve this problem.
Note: I work with only one single polyline, not for a set of curves.
Can anyone help me with this tricky mathematical problem? All help is welcome!
Thankyou so much, this forum is great!
Right Triangle detect.3dm (30.2 KB)
Right Triangle detect.gh (23.8 KB)