Skip to content

Commit 35ea681

Browse files
committed
fix bug where we removed searching for whitespace for T command which no longer matched initial AMS T command and print color started at -1
1 parent 993c478 commit 35ea681

File tree

5 files changed

+26
-2
lines changed

5 files changed

+26
-2
lines changed

.vscode/launch.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
"args": ["C:/Users/ansonl/Downloads/dice-test.gcode", "-o", "dice-export.gcode", "-c", "./sample_models/dual_color_dice/config-dice-test.json", "-t", "./minimal_toolchanges/bambu-x1-p1-series-long-retraction-107mm3-flush.gcode"],
2929
"console": "integratedTerminal"
3030
},
31+
{
32+
"name": "Python Debugger: CMD custom file2",
33+
"type": "debugpy",
34+
"request": "launch",
35+
"program": "src/mfm_cmd.py",
36+
"args": ["C:/Users/ansonl/development/topo-map-post-processing/column.gcode", "-o", "dice-export.gcode", "-c", "./premade_options/1to1.json", "-t", "./minimal_toolchanges/bambu-x1-p1-series-long-retraction-107mm3-flush.gcode"],
37+
"console": "integratedTerminal"
38+
},
3139
{
3240
"name": "Python Debugger: CMD overwrite input",
3341
"type": "debugpy",

premade_options/1to1.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"modelToRealWorldDefaultUnits": 1,
3+
"modelOneToNVerticalScale": 1,
4+
"modelSeaLevelBaseThickness": 0,
5+
"realWorldIsolineElevationInterval": 10,
6+
"realWorldIsolineElevationStart": 5,
7+
"realWorldIsolineElevationEnd": 50,
8+
"modelIsolineHeight": 1,
9+
"isolineColorIndex": 2,
10+
"isolineColorFeatureTypes": ["Outer wall", "External perimeter"],
11+
"realWorldElevationReplacementColorStart": 30,
12+
"realWorldElevationReplacementColorEnd": 60,
13+
"replacementColorIndex": 3,
14+
"replacementOriginalColorIndex": 0,
15+
"extraPurgePreviousColors": []
16+
}

premade_options/USAofPlastic-dual-meters-Z200-rise1-5mm.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
"realWorldElevationReplacementColorEnd": 30000,
1313
"replacementColorIndex": 3,
1414
"replacementOriginalColorIndex": 0,
15-
"extraPurgePreviousColors": [2]
15+
"extraPurgePreviousColors": []
1616
}
File renamed without changes.

src/mfm/printing_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858

5959
# Toolchange
6060
M620 = '^M620 S(\d*)A'
61-
TOOLCHANGE_T = '^T(?!255$|1000|1100$)(\d+)' # Do not match T255,T1000,T1100 which are nonstandard by Bambu. We do not change tabbed T commands. There is a bug where the file pointer will jump to the beginning.
61+
TOOLCHANGE_T = '^\s*T(?!255$|1000|1100$)(\d+)' # Do not match T255,T1000,T1100 which are nonstandard by Bambu. We do not change tabbed T commands. There is a bug where the file pointer will jump to the beginning. This regex needs to handle whitespace in beginning to get the initial AMS toolchange
6262
M621 = '^M621 S(\d*)A'
6363
EXTRA_PURGE_INSERTION = '; EXTRA_PURGE_INSERTION'
6464
EXTRA_PURGE_INSERTION_RE = f'^{EXTRA_PURGE_INSERTION}'

0 commit comments

Comments
 (0)