Cloud-CNC / cura-wasm

Cura Engine powered by Web Assembly (WASM)
https://cloud-cnc.github.io
Other
61 stars 17 forks source link

Settings aren't fully functional when sending a command #13

Closed benzend closed 3 years ago

benzend commented 3 years ago

I'm currently attempting to input custom settings into my slicer. For some reason, the calculations are messed up when trying to center my slice.

The sliced file should contain coordinates that are lower than the max width / height and not go into negative values. I've also noticed, when slicing normally with Cura, you get MINX:<a normal number> instead of some random scientific calculation.

This might possibly be missing a setting, but this also could potentially be an bug with Cura WASM. I've extensively read through all of the possible settings to fdmprinter.def.json in Cura's repo and I have found nothing with a single indication of manually setting the max-w / max-h.

I have also tested multiple different variations with multiple different STL files with similar results. Most of the time the parsed file commands will tilt off past the assumed max / min / w / h.

What I'm sending to the printer:

command: "slice -j definitions/fdmprinter.def.json -s machine_width=220 -s machine_depth=220 -s machine_height=300 -l Model.stl -o Model.gcode"

The GCode retrieved (settings):

;FLAVOR:Marlin
;TIME:6666
;Filament used: 0m
;Layer height: 0.1
;MINX:2.14748e+06
;MINY:2.14748e+06
;MINZ:2.14748e+06
;MAXX:-2.14748e+06
;MAXY:-2.14748e+06
;MAXZ:-2.14748e+06

Note the X and Y values:

G1 F1500 E0
G1 F1800 X410.887 Y6.972 E0.00388
G1 X410.919 Y6.091 E0.02046
G1 X410.935 Y5.807 E0.02581
G1 X410.995 Y4.984 E0.04133
G1 X411.028 Y4.634 E0.04794
G1 X411.111 Y3.933 E0.06122
G1 X411.165 Y3.527 E0.06893

The X value should not go past 220 and the Y will dip into the negative. It makes absolute zero sense.

Now when I send a command but with larger width & height:

command: `slice -j definitions/fdmprinter.def.json -s machine_width=500 -s machine_depth=500 -s machine_height=300 -l Model.stl -o Model.gcode`

I get larger X and Y values but the settings max and min are still broken.

New GCode (settings):

;FLAVOR:Marlin
;TIME:6666
;Filament used: 0m
;Layer height: 0.1
;MINX:2.14748e+06
;MINY:2.14748e+06
;MINZ:2.14748e+06
;MAXX:-2.14748e+06
;MAXY:-2.14748e+06
;MAXZ:-2.14748e+06

New GCode (commands):

G1 F1500 E0
G1 F1800 X612.562 Y192.358 E0.0161
G1 X612.766 Y191.817 E0.02697
G1 X613.123 Y191.011 E0.04356
G1 X613.369 Y190.531 E0.0537
G1 X613.503 Y190.272 E0.05919
G1 X613.844 Y189.714 E0.07149
G1 X614.144 Y189.266 E0.08163
G1 X614.674 Y188.553 E0.09834
benzend commented 3 years ago

Nevermind, apparently there is a center_object setting that you can use. Sorry for the hindrance!!!