-
Couldn't load subscription status.
- Fork 0
Implement aggressive G-code cleaning post-processing for Cosmos3D printer #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/cosmos
Are you sure you want to change the base?
Conversation
Co-authored-by: PolGuixe <[email protected]>
Co-authored-by: PolGuixe <[email protected]>
|
The script in python would be this one: regarding the files generated, do we need to create a machine, a process and new filaments? |
Thanks for sharing the Python script! I can see it implements a more aggressive G-code cleaning algorithm compared to the current embedded C++ implementation. Current Implementation Status: The Cosmos3D printer profiles are already fully configured with: ✅ Machine: "Cosmos3D X1" and "Cosmos3D X1 60 nozzle" Current vs. Your Algorithm: The embedded C++ post-processing currently adds optimization comments and display messages, while your Python script performs content removal/filtering:
Options to proceed:
Would you like me to implement your Python algorithm as embedded C++ code to replace or complement the current implementation? The cleaning approach you've described would be more aligned with specialized concrete printing workflows. Commit: f7ab8b9 |
|
@copilot please proceed with option 1. |
Co-authored-by: PolGuixe <[email protected]>
I've implemented Option 1 as requested - replaced the current embedded processing with your Python algorithm converted to C++. The new implementation performs aggressive G-code cleaning:
Tested with sample G-code and confirmed the algorithm matches your Python script's behavior exactly. Commit: da1d9b6 Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot why we need this files for this task? resources/profiles/Cosmos3D/filament/Cosmos3D Generic PLA.json |
You're absolutely right to question these files. They aren't actually needed for the G-code post-processing task. The post-processing algorithm works by checking if any printer's These profile files (machine, process, filament) were added in an earlier commit but aren't essential for the core post-processing functionality. The G-code cleaning works independently of these configurations. Would you like me to remove these unnecessary profile files since they're not required for the post-processing feature? |
|
@copilot yes, remove the unnecessary files |
Removed all unnecessary Cosmos3D profile files. The post-processing algorithm only needs to check for "Cosmos" in the printer_model configuration and doesn't depend on any specific profile definitions. Commit: 40b75b7 |
816351d to
da1d9b6
Compare
Removed unnecessary Cosmos config files
|
@copilot will the last changes make the post processing still work? In the last commit I have only removed the files that you have originally added that I don't think are required |
added deleted file BY MISTAKE
Yes, the post-processing will still work perfectly after removing those profile files. The Cosmos3D post-processing algorithm only requires:
It does NOT depend on the specific Cosmos3D profile files that were removed. The detection logic simply checks: const auto *printer_model = config.opt<ConfigOptionString>("printer_model");
if (!printer_model || printer_model->value.find("Cosmos") == std::string::npos)
return false;So any printer profile (even user-created ones) with "Cosmos" in the model name will trigger the post-processing. The removed files were indeed unnecessary for the core functionality. |
added exact same file as existing before
|
@copilot can you modify the postprocessing script that you have generated so it is able to clean and remove the GCODE instructions that are consetive dots that are closer than 1.5 mm? |
…st-processing Co-authored-by: PolGuixe <[email protected]>
I've modified the post-processing script to filter out consecutive G1 commands where the X/Y coordinates are closer than 1.5mm to the previous point. The algorithm now:
For example:
The documentation has been updated with the new filtering logic and example transformations. Commit: da0a4c7 |
;LAYER_CHANGE→;LAYER_CHANGE M3)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.