weasel API - v0.8.0
    Preparing search index...

    Function usePolygonTool

    • Drag-from-center polygon tool. Pointerdown sets center; drag determines radius + rotation; release commits via insertAction (the kit's standard insert dep, sourced by <SceneCanvas>). Side count defaults to 6, adjustable mid-gesture via ArrowUp/Down or wheel.

      The live preview is painted by the dispatcher overlay layer reading insertAction.overlay() — the action returns { kind:'insertPreview', shape:'polygon', bounds, extras: { sides, ... } }. Consumers wanting a custom polygon node shape override the insert dep.

      Type Parameters

      • TNode extends { id: string } = { id: string }

      Parameters

      Returns Tool<null>