Rectangular Outer boundary of irregular Shapes

hi guys im trying to find the rectangular outer boundary of a irregular shape hope this image explains more clearly. help me out


thanks in advance

not sure if this is efficient but here is some thoughts:

  • group adjacent points into pairs (points from edges).

  • construct right triangles with them, fill them as faces

  • filter out faces which intersect original irregular geometry

  • legs on the rest of triangles are what you want.

(But the result might not be what you want exactly if original “irregular” shape is concave.)

Hi @dineshsubramani,

It has been a while since i last used it, but the Springs package has a good node for that.
@DynamoTeam: This also could be a very good base for a non axis aligned boundingbox :wink:

Springs_MinAreaRectangle

1 Like

Great Node.

just curious, is there any chance to apply new Transform to element’s bounding box? I wanted to construct non-axis-aligned bounding box for an element before, by assigning new Transform to bounding box but it always stick to x-Axis & y-Axis in project space. @MJB-online

i have already tried springs minimum area rectangle and its a greate node
what i’m trying is to get enclosed boundary which has only 90 degree as angle

maybe you can take a look my post, see if it works.

please can you explain little more clear

  • points are from start points and end points on all edges, order them clockwise/counter-clockwise, group them in to pairs

  • construct right triangles base on each pair and the edge between them (edge as hypotenuse), fill triangles as faces

  • there’re faces that intersects the original irregular geometry and those do not are perhaps the ones you want

  • retrieve triangles from them, the legs of those triangle are perhaps the final result.

I think filtering is required since each pair creates two triangles if you follow vector (0, +1/-1, 0) and (+1/-1, 0, 0) to create legs.

An axis aligned rectangle, you mean something like this ?

sorry this is not what i need

i understand i will try and reply

I think that @jshial is on the right track with the triangles suggestion. I came up with a pretty rough graph that tries to brute-force the solution:

Give it a try on your own and if you can’t crack it, I’ll share my current approach. I’m certain you can come up with something more elegant.

5 Likes