diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..873f4f7aa --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[lints] +cargo.unused_workspace_dependencies = "allow" diff --git a/Cargo.toml b/Cargo.toml index 24e26a384..629bab64c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -149,11 +149,13 @@ chrono = { version = "0.4.45", default-features = false, features = ["std"] } [workspace.lints.rust] unsafe_code = "forbid" +unused_workspace_dependencies = "allow" unexpected_cfgs = { level = "warn", check-cfg = ["cfg(craft_pdf_unicode_fixtures)"] } [workspace.lints.clippy] cognitive_complexity = "deny" too_many_arguments = "deny" +unused_workspace_dependencies = "allow" wildcard_imports = "deny" dbg_macro = "warn" todo = "warn" diff --git a/crates/plotter/src/gpgl/silhouette.rs b/crates/plotter/src/gpgl/silhouette.rs index 9d5dff2d1..a30aa1990 100644 --- a/crates/plotter/src/gpgl/silhouette.rs +++ b/crates/plotter/src/gpgl/silhouette.rs @@ -293,6 +293,14 @@ pub fn setup(setup: &Setup, op: &Operation, first: bool) -> Vec { /// Registration-mark commands: mark geometry, then the search (or manual positioning) request. /// The device answers ` 0\x03` (see [`parse_status`]) once it has the marks. +/// +/// The full registration sequence (TB99 through TB55, plus TB123/TB124 for search and +/// TB23 for manual positioning) is documented in the community driver [py_silhouette] +/// (`zero_on_registration_mark()`), which reverse-engineered the protocol from public +/// behaviour — not from any proprietary binary. The `TB54,0,0` sub-command sets the +/// registration-mark offset to zero (the mark is at its expected position). +/// +/// [py_silhouette]: https://github.com/mossblaser/py_silhouette/blob/main/py_silhouette/device.py pub fn registration(reg: &Registration) -> Vec { let raw = |s: &str| Command::Raw(s.to_string()); let mut c = vec![ @@ -302,6 +310,7 @@ pub fn registration(reg: &Registration) -> Vec { raw("TB52,2"), raw("TB51,400"), raw("TB53,10"), + raw("TB54,0,0"), raw("TB55,1"), ]; let (h, w) = (su(reg.length_mm), su(reg.width_mm));