raygeo.geo

Various geometry shapes and operations Geometry types and operations for 2D/3D path data.
The central type is Geometry — a mutable sequence of drawing commands (move, line, arc, bezier) that represents one or more closed or open paths. Geometry supports construction (add_rect, add_circle, etc.), analysis (area, distance, bounding rect), and manipulation (transform, simplify, linearize, fit curves, grow/shrink, split, clip).
Shape sub-modules provide primitive-specific operations: arc bounding and intersection, bezier splitting and flattening, circle containment tests, polygon boolean algebra and offsetting, and line intersection.
Algorithm sub-modules provide higher-level geometric processing such as polyline simplification, smoothing, curve fitting, and Minkowski sums for toolpath generation.
Arc
A circular-arc cutting command.
center_offset
center_offset: tuple[float, float, float]
Centre offset from the start point (3D).
clockwise
clockwise: bool
Whether the arc is clockwise (computed from the normal).
end
end: tuple[float, float, float]
Endpoint of the arc in 3D space.
normal
normal: tuple[float, float, float]
Plane normal of the arc. A positive Z component means CCW in XY.
Bezier
A cubic-Bezier curve cutting command.
control1
control1: tuple[float, float, float]
First control point in 3D space.
control2
control2: tuple[float, float, float]
Second control point in 3D space.
end
end: tuple[float, float, float]
Endpoint of the curve in 3D space.
Geometry
A sequence of geometric commands (Move, Line, Arc, Bezier).
The primary building block for vector geometry in raygeo. Geometry objects can be constructed procedurally, parsed from SVG, or obtained by converting an ~raygeo.ops.Ops sequence.
data
data: list[Any]
The commands as a list of typed command objects.
last_move_to
last_move_to: tuple[float, float, float]
The coordinates of the last move-to command.