Star Points & Radius Constraints

Overview

Star shapes clamp point counts and radii to keep geometry valid and predictable.

Canvas controls

When a single star is selected, the canvas shows three control points:

  • Count: right-side outer corner, drag on the arc around center to change numPoints.
    • Count drag is eased: near-start movement changes slowly, longer drag accelerates point changes.
  • Ratio: first inner corner between top and right-side corners, drag to change innerRadius.
  • Radius: top outer corner, drag to change outerRadius.
  • Drag updates happen continuously during dragmove, then commit once on dragend.

API

editor.updateObjectProperty(starId, 'numPoints', 5)
editor.updateObjectProperty(starId, 'outerRadius', 60)
editor.updateObjectProperty(starId, 'innerRadius', 24)

Constraints

  • numPoints is clamped to the range 3–60.
  • innerRadius is clamped to 0–outerRadius.
  • outerRadius is clamped to >= 1.
  • size is synchronized to outerRadius * 2.

Resize behavior

  • Resizing a star preserves the current innerRadius / outerRadius ratio.