figureone
    Preparing search index...

    Polygon or partial polygon shape options object that extends OBJ_Generic (without drawType)

    • sides number — (4)
    • radius number — (1)
    • rotation number — shape rotation during vertex definition (different to a rotation step in a trasform) (0)
    • offset TypeParsablePoint — shape center offset from origin during vertex definition (different to a translation step in a transform) ([0, 0])
    • sidesToDraw number — number of sides to draw (all sides)
    • angleToDraw number — same as sidesToDraw but using angle for the definition ()
    • direction 1 | -1 — direction to draw polygon where 1 is counter clockwise and -1 is clockwise (1) center. This is different to position or transform as these translate the vertices on each draw. ([0, 0])
    • line OBJ_LineStyleSimple — line style options
    • drawBorderBuffer (number | TypeParsableBorder) & TypeParsableBorder — override the OBJ_Generic drawBorderBuffer with number to make the drawBorderBuffer a polygon that is wider by number (0)

    To test examples, append them to the boilerplate

    // Simple filled hexagon
    figure.add({
    name: 'hexagon',
    make: 'polygon',
    sides: 6,
    radius: 0.5,
    });
    // Circle from dashed line
    const circ = figure.primitives.polygon({
    sides: 100,
    radius: 0.5,
    line: {
    width: 0.03,
    dash: [0.1, 0.03 ],
    },
    });
    figure.elements.add('circle', circ);
    // Half octagon rotated
    figure.add({
    name: 'halfOctagon',
    make: 'polygon',
    sides: 8,
    radius: 0.5,
    angleToDraw: Math.PI,
    line: {
    width: 0.03,
    },
    direction: -1,
    rotation: Math.PI / 2,
    });
    @interface