Create an axis-aligned rectangle blueprint with optional rounded corners.
The rectangle is centered at the origin. When r is zero the corners are sharp; otherwise they are filleted with circular or elliptical arcs.
r
Total width of the rectangle.
Total height of the rectangle.
Corner radius. Pass a number for uniform rounding, or { rx, ry } for elliptical corners. Clamped to half the respective dimension.
{ rx, ry }
A closed Blueprint representing the rectangle.
const sharp = roundedRectangleBlueprint(20, 10);const rounded = roundedRectangleBlueprint(20, 10, 3);const elliptical = roundedRectangleBlueprint(20, 10, { rx: 4, ry: 2 }); Copy
const sharp = roundedRectangleBlueprint(20, 10);const rounded = roundedRectangleBlueprint(20, 10, 3);const elliptical = roundedRectangleBlueprint(20, 10, { rx: 4, ry: 2 });
Create an axis-aligned rectangle blueprint with optional rounded corners.
The rectangle is centered at the origin. When
ris zero the corners are sharp; otherwise they are filleted with circular or elliptical arcs.