raygeo.ops
Command sequence (Ops) manipulation for CNC motion control.
Ops is a container of ordered commands (move, line, arc, bezier, state changes like power/feed) that defines a complete machining job. It supports building sequences programmatically (move_to, line_to, arc_to, etc.), transforming them (translate, rotate, scale, transform with 4x4 matrices), clipping to rectangles or regions, linearizing curves, estimating processing time, and serializing to dict or numpy arrays for persistence.
The module also provides command-type enumerations (CommandType, CommandCategory, SectionType), machine State tracking (power, feed, coolant, air_assist, head_coolant, frequency), and an Axis bitflag for multi-axis machines.
CommandInfo
Detailed information about a single command in an Ops sequence.
Returned by Ops.inspect and provides the full set of parameters for any command type in a structured form.
air_assist
air_assist: Optional[state.AirAssistMode]
Air assist mode, if a SetAirAssist command.
center_offset
center_offset: Optional[tuple[float, float]]
Arc centre offset from start point, if an arc command.
clockwise
clockwise: Optional[bool]
Whether an arc is clockwise, if an arc command.
control
control: Optional[tuple[float, float, float]]
Quadratic-Bezier control point, if a quad. Bezier command.
control1
control1: Optional[tuple[float, float, float]]
First cubic-Bezier control point, if a Bezier command.
control2
control2: Optional[tuple[float, float, float]]
Second cubic-Bezier control point, if a Bezier command.
coolant
coolant: Optional[state.CoolantMode]
Coolant mode, if a SetCoolant command.
duration_ms
duration_ms: Optional[float]
Dwell duration in ms, if a dwell command.
end
end: Optional[tuple[float, float, float]]
Endpoint of the command in 3D space, if applicable.