GridSpace / grid-apps

Browser-based Slicer for 3D Printing, CAM, Laser (Kiri:Moto) and mesh editor (Mesh:Tool)
https://grid.space/
MIT License
464 stars 143 forks source link

Inconsistent beltAnchor setting behavior between web & cli.js #201

Closed smartin015 closed 2 years ago

smartin015 commented 2 years ago

Following on from #199, I found another oddity - I specify firstLayerBeltLead = 2 and firstLayerBeltBump = 2 in the process JSON file (AIUI these correspond to the Part Anchor and Anchor Bump settings on the right Base menu), but no anchor exists in the output gcode, despite the correct values being listed in the dump of process variables in the header comment of the file.

AIUI this is because process.beltAnchor is determined conditionally in main.js (here). Adding beltAnchor: true to my JSON file is a quick workaround, but it's a bit strange that this must exist in the CLI when the web version just infers it from the other settings.

Just duplicating this particular conditional into cli.js feels unsustainable - there's plenty of other places in main.js where the process config is modified (e.g. here). I don't have enough history on the other parts to be comfortable contributing a fix.

stewartoallen commented 2 years ago

engine came long after the other code. I suspect there are other conditions like this. will patch this, though, so you don't have to in your code