Rectangle/TL,BR
Axis-Aligned Rectangle
Creates an axis-aligned rectangle from two diagonal corner points. Four line segments created simultaneously.
What It Does
The Rectangle/TL,BR operator creates an axis-aligned rectangle from two diagonal corner points — top-left and bottom-right. Four line segments are created simultaneously: bottom, right, top, and left.
Syntax
Rectangle/P_TopLeft, P_BottomRight
Quick Input
P_TL: [top-left corner point]
P_BR: [bottom-right corner point]
Direction Selector
No direction selector is required. The result is uniquely determined by the input geometry.
Worked Examples
Setup:
P_TL = (10, 60)
P_BR = (70, 20)
Width = 70-10 = 60
Height = 60-20 = 40
Rectangle/P_TL=(10,60), P_BR=(70,20)
→ L0: bottom (10,20)→(70,20) Y=20
→ L1: right (70,20)→(70,60) X=70
→ L2: top (70,60)→(10,60) Y=60
→ L3: left (10,60)→(10,20) X=10
Analytic Rule
Xmin = min(TL.x, BR.x)
Xmax = max(TL.x, BR.x)
Ymin = min(TL.y, BR.y)
Ymax = max(TL.y, BR.y)
Four segments:
Bottom: (Xmin,Ymin)→(Xmax,Ymin)
Right: (Xmax,Ymin)→(Xmax,Ymax)
Top: (Xmax,Ymax)→(Xmin,Ymax)
Left: (Xmin,Ymax)→(Xmin,Ymin)
Result: Four exact axis-aligned line segments.
FAQ
Can I create a rectangle from any two diagonal corners?
Yes. XyzPilot computes Xmin, Xmax, Ymin, Ymax from the two corner points regardless of which corners you specify.
How do I create a rectangle with filleted corners?
Create the rectangle with Rectangle/TL,BR, then use Arc/Fillet,L,L at each corner, then Trim the corners.