Skip to main content

Edge-Aligned Inscribed Rectangle

Returns the largest rectangle inside a polygon aligned to one of its edges. touch edge keeps the rectangle flush with that edge, like a capped inward offset

Written by Holly Conrad Smith

Use this when you want the biggest rectangle that hugs a specific side of a lot or building footprint — for example, fitting a rectangular pad flush against a property's street frontage, or sizing a building envelope that has to align with a particular boundary edge.

Category: Geometric Operations

Kind: Operation

Description: returns the largest rectangle inside a polygon aligned to one of its edges. touch edge keeps the rectangle flush with that edge, like a capped inward offset

Inputs

Name

Abbreviation

Type

Access

Description

polygon

P

Cartesian

Item

the polygon to fit a rectangle inside

align to edge (default 0)

A

Number

Item

index of the polygon's outer edge to align the rectangle to; the rectangle's sides are rotated to run parallel to this edge.

touch edge (optional, default false)

T

Boolean

Item

when on, one side of the rectangle sits flush against the chosen edge and grows inward from it; when off, the rectangle keeps that orientation of the edge, but grows to fill the polygon

Outputs

Name

Abbreviation

Type

Access

Description

rectangle

R

Cartesian

Item

the inscribed rectangle

width

W

Number

Item

the rectangle side measured parallel to the aligned edge

height

H

Number

Item

the rectangle side measured perpendicular to the aligned edge

How to

  1. Add the Edge-Aligned Inscribed Rectangle node.

  2. Feed in a polygon.

  3. Set "align to edge" to the index of the outer edge you want the rectangle aligned to (0 is the first edge).

  4. Turn on "touch edge" to keep the rectangle flush against that edge, or leave it off to let the rectangle grow to fill the polygon at that orientation.

  5. The outputs are the fitted rectangle plus its width and height.

Did this answer your question?