Add colored isolines (contour lines/elevation lines) and recolor elevation ranges to 3D printable map models. 3D G-code Map Feature Modifier (MFM) is a G-code Post Processor made for 3D topo map models but any 3D model can be recolored with 2 additional colors.
Use the latest version of MFM in 1 of 3 ways → Getting Started
- Integrated Post Processing Script in PrusaSlicer/Bambu Studio/Orca Slicer - Preferred for latest functionality and code. Runs automatically after slicing.
- Python script - Preferred for latest functionality and code.
- GUI - Portable graphical interface.
MFM adds additional features to the model by post processing sliced 3D printer G-code. 3D models and printing g-code can be recolored at either layer or individual feature/line level granularity.
-
Feature/Line Type Scoping - Recoloring can be set to only affect specific printing feature/line types. Only want to recolor top surfaces or walls at certain heights? Do it with MFM!
-
G-code Feature Print Order Optimization - Printed features are rearranged for faster, more consistent prints. Nozzle pressure is maintained and the number of toolchanges is decreased.
-
Wipe/Coasting Compensation - Existing Wipe/Coasting flow compensation generated by the slicer is retained even when g-code features are relocated.
-
Prime Tower Compatible - Existing Prime Towers are reused for optimal filament flow and color flushing. No prime tower or large prime tower? I don't judge. Both configurations are supported.
-
Slicer Compatibility - Tested to be compatible with PrusaSlicer and Bambu Studio.
If you find this tool helpful, please leave feedback and consider supporting my development and 3D modeling with a Printables "club membership" or Paypal.
My 3D topo and other models are on MakerWorld and Printables.
- Marlin 2 (PrusaSlicer/Bambu Studio/Orca Slicer)
Your slicer must generate g-code with Relative Extrusion. PrusaSlicer, Bambu Studio, and Orca Slicer default to relative extrusion. Cura defaults to absolute extrusion and relative extrusion must be explicitly enabled.
Slicer | Tested Version |
---|---|
PrusaSlicer | 2.7.1 |
Bambu Studio | 1.8.2.56 |
Orca Slicer | 2.2.0 |
Cura | N/A |
If you would like support for your printer or slicer G-code flavor to be added, please open an issue and test the G-code on your printer.
Set up your slicer and printer for MFM by following the steps on each page below:
-
MFM Command Setup (not needed for GUI)
After doing ALL above setup steps, you can run MFM as a Slicer Post-processor Script/Python Script (most updated) or Graphical App:
-
Add
mfm_cmd.py
command with the listed parameters to slicer Post-processing Scripts setting. -
Slice your model.
-
Export G-code file under the Print button in the upper right.
If you update the MFM Options file, you may need to add/delete a space at the end of the slicer Post-processing Scripts setting to get the slicer to allow reslicing.
Download the latest GUI release of MFM and run MFM.exe
to start MFM.
-
Select the import G-code file that was exported from your slicer
-
Select the Options JSON file for your map model.
-
Select the toolchange G-code file for your printer.
-
Check if the export G-code file location looks right
-
Press Post Process
If a release of MFM has not been built for your OS, you can launch the GUI by downloading the code, navigate to the code folder in the command line and run
python src/gui.py
.
Put the G-code file exported by your Slicer or MFM on an SD card and put the SD card in your 3D printer or transfer the G-code file to your printer over the network.
Bambu printer users can use FTPS for wireless transfer.
Question | Solution |
---|---|
How do I convert a 3D model into G-code for printing? | After importing and slicing your model in a slicer software, export the 3D printer commands as [ASCII] G-code. MFM can be process and recolor this saved G-code file. |
MFM did not add or change any colors. | Setup your slicer for MFM through Slicer Setup |
How can MFM recoloring be customized? | Read Options for details. |
How can MFM be used with a material other than PLA and customized toolchange? | See Minimal Toolchange G-code on recommendations on how to setup your own toolchange. I may add an option to set toolchange temperatures based on material in the future. Open an issue with your use cases. |
Incorrect color was printed even though previewing the exported G-code in the slicer shows the correct color slots being used. | Assign a different filament to each slot in the Bambu AMS. Every slot with a different color must have a different color assigned in AMS. Otherwise Bambu AMS Autoswitch feature may try to use a single slot's filament for a shared material and color between multiple slots. |
Mixed OS line endings in the same file will lead to G-code errors. MFM tries to auto detect the line ending used with first line ending found. | Select the correct line ending of your G-code instead of auto detect. Either convert the entire G-code file with Unix line endings to Windows line endings before post processing or generate the G-code on Windows. Python on Windows does not handle Unix line endings correctly. |
Only one isoline interval and/or colored elevation range can be set. | Only one of each is exposed at the moment. The implementation could support more in the future if there is a use case. |
Support and Bridge features are not explicitly prioritized to pprint first. | I could prioritize printing certain features first in the future. Open an issue with your use cases for this. |
Open an issue on Github. Please note the OS, Slicer, printer, and provide the 3D model, MFM Options JSON, toolchange G-code, and logs.
Logs are written to your home directory ~
in the files mfm-script.log
and mfm-script-stderr.log
.
GNU AFFERO GENERAL PUBLIC LICENSE v3.0
Copyright © 2023-2024 Anson Liu
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.