Struct svg2gcode::Turtle[][src]

pub struct Turtle<'input> {
    pub machine: Machine<'input>,
    // some fields omitted
}
Expand description

Turtle graphics simulator for paths that outputs the g-code representation for each operation. Handles transforms, position, offsets, etc. See https://www.w3.org/TR/SVG/paths.html

Fields

machine: Machine<'input>

Implementations

Create a turtle at the origin with no transform

Move the turtle to the given absolute/relative coordinates in the current transform https://www.w3.org/TR/SVG/paths.html#PathDataMovetoCommands

Close an SVG path, cutting back to its initial position https://www.w3.org/TR/SVG/paths.html#PathDataClosePathCommand

Draw a line from the current position in the current transform to the specified position https://www.w3.org/TR/SVG/paths.html#PathDataLinetoCommands

Draw a cubic curve from the current point to (x, y) with specified control points (x1, y1) and (x2, y2) https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands

Draw a shorthand/smooth cubic bezier segment, where the first control point was already given https://www.w3.org/TR/SVG/paths.html#PathDataCubicBezierCommands

Draw a shorthand/smooth cubic bezier segment, where the control point was already given https://www.w3.org/TR/SVG/paths.html#PathDataQuadraticBezierCommands

Draw a quadratic bezier segment https://www.w3.org/TR/SVG/paths.html#PathDataQuadraticBezierCommands

Draw an elliptical arc segment https://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands

Push a generic transform onto the stack Could be any valid CSS transform https://drafts.csswg.org/css-transforms-1/#typedef-transform-function https://www.w3.org/TR/SVG/coords.html#InterfaceSVGTransform

Pop a generic transform off the stack, returning to the previous transform state This means that most recent transform went out of scope

Remove all transforms, returning to true absolute coordinates

Reset the position of the turtle to the origin in the current transform stack Used for starting a new path

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.