Skip to content

g02_set_clockwise_circular

g02_set_clockwise_circular

Wrapper for G01 mode set token.

SetClockwiseCircular

Bases: Token

Wrapper for G02 mode set token.

Sets linear/circular mode to clockwise circular.

Source code in src/pygerber/gerberx3/tokenizer/tokens/g02_set_clockwise_circular.py
class SetClockwiseCircular(Token):
    """Wrapper for G02 mode set token.

    Sets linear/circular mode to clockwise circular.
    """

    def update_drawing_state(
        self,
        state: State,
        _backend: Backend,
    ) -> Tuple[State, Iterable[DrawCommand]]:
        """Set drawing mode."""
        return (
            state.model_copy(
                update={
                    "draw_mode": DrawMode.ClockwiseCircular,
                },
            ),
            (),
        )

    def __str__(self) -> str:
        return "G02*"

update_drawing_state

update_drawing_state(
    state: State, _backend: Backend
) -> Tuple[State, Iterable[DrawCommand]]

Set drawing mode.

Source code in src/pygerber/gerberx3/tokenizer/tokens/g02_set_clockwise_circular.py
def update_drawing_state(
    self,
    state: State,
    _backend: Backend,
) -> Tuple[State, Iterable[DrawCommand]]:
    """Set drawing mode."""
    return (
        state.model_copy(
            update={
                "draw_mode": DrawMode.ClockwiseCircular,
            },
        ),
        (),
    )