COBOTTA Writing API
FontBcapCobottaWriterConfig
Holds the communication destination, workspace, character cells, coordinate transforms, writing directions, axis inversions, speeds, and acceleration/deceleration settings.
The main defaults are:
Argument |
Default |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FontBcapCobottaWriter
FontBcapCobottaWriter(config, bcap=None, logger=None)
If an existing CobottaBcap instance is supplied, the writer uses it. Otherwise, the writer creates an instance for the connection.
Connection and preparation
connect() -> booldisconnect() -> boolreset_error() -> booltake_arm() -> boolgive_arm() -> boolmotor_on() -> boolset_accel() -> boolset_decel() -> bool
Configuration
set_params(...) -> boolset_pen_lift_mm(pen_lift_mm: float) -> boolset_start_height_mm(start_height_mm: float) -> boolset_return_to_start(return_to_start: bool) -> boolset_new_line(new_line: bool) -> bool
set_params() first constructs a new FontLineLayout from the proposed layout-related settings and applies the settings only after construction succeeds. This avoids partial updates when an intermediate step fails.
Writing
write(
text: str,
start_height_mm: float | None = None,
return_to_start: bool | None = None,
new_line: bool | None = None,
) -> bool
Returns False when not connected. If the stroke set is empty, it performs no motion and returns True. A RuntimeError is raised if the current P coordinates cannot be obtained or do not contain six elements.
Emergency retraction
emergency_lift_pen() -> bool
During writing, retracts along the Z axis to the configured pen-up height while maintaining the current XY coordinates and orientation.