Skip to content

Commit

Permalink
Fix bug where features could have WIPE_END in beginning and not at th…
Browse files Browse the repository at this point in the history
…e end
  • Loading branch information
ansonl committed Feb 2, 2025
1 parent 5712097 commit 84dcb86
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
8 changes: 4 additions & 4 deletions premade_options/USAofPlastic-dual-meters-Z200-rise1-5mm.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"modelToRealWorldDefaultUnits": 1000,
"modelOneToNVerticalScale": 250000,
"modelSeaLevelBaseThickness": 6.6,
"realWorldIsolineElevationInterval": 500,
"realWorldIsolineElevationStart": 500,
"realWorldIsolineElevationInterval": 300,
"realWorldIsolineElevationStart": 301,
"realWorldIsolineElevationEnd": 30000,
"modelIsolineHeight": 0.1,
"modelIsolineHeight": 0.01,
"isolineColorIndex": 2,
"isolineColorFeatureTypes": ["Outer wall", "Inner wall", "External perimeter", "Perimeter"],
"isolineColorFeatureTypes": ["Outer wall", "External perimeter"],
"realWorldElevationReplacementColorStart": 2300,
"realWorldElevationReplacementColorEnd": 30000,
"replacementColorIndex": 3,
Expand Down
2 changes: 1 addition & 1 deletion slicer-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ If you plan to do the processing through the standalone MFM GUI app, you can ski

If you intend to add isolines and using Ironing on the top surface, the standard ironing inset will cover up the isoline color on the outer wall.

Set Ironing inset to your line width (nozzle diameter) * 1.25 to not obscure the isolines.
Set Ironing inset to your line width (nozzle diameter) multiplied between 1 and 1.25 to not obscure the isolines.
27 changes: 19 additions & 8 deletions src/mfm/map_post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,14 +783,25 @@ def process(configuration: MFMConfiguration, statusQueue: queue.Queue):
#print(f"start feature toolchange skip ")

if curFeature.wipeEnd and f.tell() == curFeature.wipeEnd.start and curFeature.featureType not in RETAIN_WIPE_END_FEATURE_TYPES:
writeWithFilters(out, cl, loadedColors)
#print(f"Skipping feature WIPE_END. Start skip at {f.tell()}")
out.write(";WIPE_END placeholder for PrusaSlicer Gcode Viewer\n")
out.write("; WIPE_END placeholder for BambuStudio Gcode Preview\n")
out.write("; MFM Original WIPE_END skipped\n")
currentPrint.skipWrite = True
# Reference original pos as last wipe end pos for next layer
currentPrint.featureWipeEndPrime = currentPrint.originalPosition
# Keep wipe if WIPE_END is greater than N lines before feature end
linesUntilFeatureEnd = 0
while f.tell() < curFeature.end and linesUntilFeatureEnd <= RETAIN_WIPE_END_IF_FEATURE_END_NOT_WITHIN_N_LINES:
_ = f.readline()
linesUntilFeatureEnd += 1

# Restore file position
f.seek(curFeature.wipeEnd.start)

# Skip wipe end
if linesUntilFeatureEnd <= RETAIN_WIPE_END_IF_FEATURE_END_NOT_WITHIN_N_LINES:
writeWithFilters(out, cl, loadedColors)
#print(f"Skipping feature WIPE_END. Start skip at {f.tell()}")
out.write(";WIPE_END placeholder for PrusaSlicer Gcode Viewer\n")
out.write("; WIPE_END placeholder for BambuStudio Gcode Preview\n")
out.write("; MFM Original WIPE_END skipped\n")
currentPrint.skipWrite = True
# Reference original pos as last wipe end pos for next layer
currentPrint.featureWipeEndPrime = currentPrint.originalPosition


# Write current line
Expand Down
1 change: 1 addition & 0 deletions src/mfm/printing_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
WIPE_START = '^;\s?WIPE_START'
WIPE_END = '^;\s?WIPE_END'
RETAIN_WIPE_END_FEATURE_TYPES = ['Internal infill']
RETAIN_WIPE_END_IF_FEATURE_END_NOT_WITHIN_N_LINES = 6

# Start and stop individual object
#STOP_OBJECT = '^;\s(?:stop printing object)\s?(?:, unique label|.*)\sid:?\s?(\d*)'
Expand Down

0 comments on commit 84dcb86

Please sign in to comment.