{"id":17775617,"url":"https://github.com/mjonuschat/preprocess-cancellation","last_synced_at":"2026-02-08T12:01:30.683Z","repository":{"id":179800344,"uuid":"664142263","full_name":"mjonuschat/preprocess-cancellation","owner":"mjonuschat","description":"GCode processor to add klipper exclude-object markers (in Rust)","archived":false,"fork":false,"pushed_at":"2025-10-08T05:36:17.000Z","size":4772,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-10-08T07:22:58.555Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"G-code","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjonuschat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-09T03:15:55.000Z","updated_at":"2025-10-08T05:36:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"3a343c1e-d27b-41ae-9313-f7b57b7227fc","html_url":"https://github.com/mjonuschat/preprocess-cancellation","commit_stats":null,"previous_names":["mjonuschat/preprocess-cancellation"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mjonuschat/preprocess-cancellation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjonuschat%2Fpreprocess-cancellation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjonuschat%2Fpreprocess-cancellation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjonuschat%2Fpreprocess-cancellation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjonuschat%2Fpreprocess-cancellation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjonuschat","download_url":"https://codeload.github.com/mjonuschat/preprocess-cancellation/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjonuschat%2Fpreprocess-cancellation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29229358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T09:43:19.170Z","status":"ssl_error","status_checked_at":"2026-02-08T09:42:55.556Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T21:58:03.364Z","updated_at":"2026-02-08T12:01:30.649Z","avatar_url":"https://github.com/mjonuschat.png","language":"G-code","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Klipper GCode Preprocessor for Object Cancellation\n\nThis is a Rust port of the excellent preprocess-cancellation preprocessor by Frank Tackitt. The preprocessor\nmodifies GCode files to add Klipper's exclude object gcode.\n\nThe following slicers are currently supported:\n\n* SuperSlicer\n* PrusaSlicer\n* Orcaslicer\n* Slic3r\n* Cura\n* IdeaMaker\n\n## Why the rewrite\n\nThe SBCs typically running Klipper are not very beefy and when uploading GCode files that are \n100+ MB large the upload often times out during preprocessing of the files. This rewrite tries\nto solve that problem and keep the convenience of having files automatically processed on the \nhost without having to deal with Slicer integration.\n\nTesting on an M1 Macbook shows a 10x improvement in processing speed, from 48s down to \u003c5s for\na reasonably complex file of about 130MB.\n\n```bash\ntime preprocess_cancellation-macos  demo/plate_1.gcode\npreprocess_cancellation-macos   32.57s user 1.55s system 70% cpu 48.234 total\n```\n\n```bash\npreprocess-cancellation-rs   3.85s user 0.13s system 93% cpu 4.276 total\n```\n\n## Installation and usage\n\n### SuperSlicer, PrusaSlicer, and Slic3r\n\nDownload the provided binary for your platform, and place it in with in your slicer's folder.\n\nIn your Print Settings, under Output Options, add `preprocess_cancellation.exe;` to the\n\"Post-Processing Scripts\". For mac or linux, you should just use `preprocess_cancellation;`\n\nThen, all generated gcode should be automatically processed and rewritten to support cancellation.\n\n### G-Codes for Object Cancellation\n\nThere are 3 gcodes inserted in the files automatically, and 4 more used to control the\nobject cancellation.\n\n`EXCLUDE_OBJECT_DEFINE NAME=\u003cobject name\u003e [CENTER=x,y] [POLYGON=[[x,y],...]]`\n\nThe NAME must be unique and consistent throughout the file. CENTER is the center location\nfor the mesh, used to show on interfaces where and object being canceled is on the bed.\nPOLYGON is a series of points, used to represent the bounds of the object. It can be just\na bounding box, a simplified outline, or another useful shape.\n\n`EXCLUDE_OBJECT_START NAME=\u003cobject name\u003e` and `EXCLUDE_OBJECT_END [NAME=\u003cobject name\u003e]`\n\nThe beginning and end markers for the gcode for a single object. When an object is excluded,\nanything between these markers is ignored.\n\nFor a full breakdown, see [the klipper G-Code Reference](https://www.klipper3d.org/G-Codes.html#excludeobject)\n\n### Known Limitations\n\nCura and Ideamaker sliced files have all support material as a single non-mesh entity.\nThis means that when canceling an object, it's support will still print. Including\nsupport that is inside or built onto the canceled mesh. The Slic3r family (including\nPrusaSlicer and SuperSlicer) treat support as part of the individual mesh's object,\nso canceling a mesh cancels it's support as well.\n\n### How does it work\n\nThis looks for known markers inside the GCode, specific to each slicer. It uses those\nto figure out the printing object's name, and track all extrusion moves within its\nprint movements. Those are used to calculate a minimal bounding box for each mesh.\nA series of `EXCLUDE_OBJECT_DEFINE` gcodes are placed in a header, including the bounding boxes\nand objects centers. Then, these markers are used to place `EXCLUDE_OBJECT_START` and\n`EXCLUDE_OBJECT_END` gcodes in the file surrounding each set of extrusions for that object.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjonuschat%2Fpreprocess-cancellation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjonuschat%2Fpreprocess-cancellation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjonuschat%2Fpreprocess-cancellation/lists"}