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.
extra_axes
extra_axes: Optional[dict]
Extra axis positions, if any.
feed_rate
feed_rate: Optional[int]
Feed rate setting, if a SetFeedRate command.
frequency
frequency: Optional[int]
Laser frequency (Hz), if a frequency-setting command.
head_coolant
head_coolant: Optional[state.HeadCoolantMode]
Head coolant mode, if a SetHeadCoolant command.
head_uid
head_uid: Optional[str]
Unique identifier of the active head, if a head-setting command.
layer_uid
layer_uid: Optional[str]
Unique identifier of the active layer, if a layer-start command.
power
power: Optional[float]
Power level (0–1), if a power-setting command.
power_values
power_values: Optional[bytes]
Per-step power byte values for scan-to commands.
pulse_width
pulse_width: Optional[float]
Laser pulse width (µs), if a pulse-width-setting command.
rapid_rate
rapid_rate: Optional[int]
Rapid rate setting, if a SetRapidRate command.
section_type
section_type: Optional[types.SectionType]
Section type, if a section marker.
spindle_rpm
spindle_rpm: Optional[int]
Spindle RPM, if a SetSpindleRpm command.
state
state: Optional[state.State]
State snapshot at this command, if present.
type_
type_: types.CommandType
The type of this command (e.g. Move, Line, Arc, Bezier, ScanTo, …).
workpiece_uid
workpiece_uid: Optional[str]
Unique identifier of the active workpiece, if a workpiece-start command.
Ops
A sequence of machining operations (commands).
Ops is a container of ordered commands that define a complete machining job. It supports building
command sequences programmatically, transforming them, clipping, serializing, and more.
Use the builder methods (move_to, line_to, arc_to, etc.) to construct a sequence, or load from
geometry/dict/numpy arrays.