brepjs API Reference
    Preparing search index...

    Function roundedRectangleBlueprint

    • 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.

      Parameters

      • width: number

        Total width of the rectangle.

      • height: number

        Total height of the rectangle.

      • r: number | { rx?: number; ry?: number } = 0

        Corner radius. Pass a number for uniform rounding, or { rx, ry } for elliptical corners. Clamped to half the respective dimension.

      Returns Blueprint

      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 });