# Automatic modify area boundary

Hello everyone.I am a beginner of Dynamo.

I would like to modify boundaries automatically by shape.
Because I have to caluculate by rectangular.

How can i extend or add boudaries…?

If you are looking to create the minimum subdivisions into rectangles for any rectilinear shape, you could apply some graph theory and achieve it this way…

There are a number of other ways of doing this, but none are trivial to implement - not unless you only ever deal with L-shaped rooms, then its just a case of evaluating each corner condition, find the convex corner (you can establish the corner type easily by taking any two joined edge directions), then extend one of the edges to the nearest boundary edge.

1 Like

This is what i want to do, but very difficult to me.
I will try it!!
Thank you.

@Thomas_Mahon
Maybe it’s very easy question for you.

How can i connect corners?

Thank you.

Hi @Ke2king this problem is relatively complex, particularly if you are aiming to achieve a solution which can resolve any space. Fortunately your problem has some very convenient constraints, namely subdividing at the concave corners, rather than subdividing from given lengths (which I’ve done, so I am speaking from experience here, and its an entirely different animal!). If you are new to Dynamo then you’ve either got a lot of late nights ahead of you (you’re going to need a lot more than just Dynamo knowledge to resolve this) or you might need to accept some manual interventions with a semi-automated process so its manageable.

Here is one option you could explore:

1. Identify where any two points have either the same X or Y coordinate (to identify the ‘double-duty’ curves)
2. Use this to draw the vertical or horizontal lines
3. Group these lines into horizontal and vertical sets (left set and right set)
4. Use the intersection graph to establish the maximum independent set
5. Get the remaining convex corners and extend the first line defining its edge to the nearest adjacent edge

Revit typically orders boundary curves from rooms and areas sequentially using the right-hand rule, so you can iterate the list of curves (first curve and next curve), compute their directions and use the result to establish the corner type (convex or concave). For example and corner who’s start edge is orientated in a left-direction (relative to say, the global X-axis) and adjacent edge is in an up-direction (relative to global Y-axis) must be a concave corner.