add flat render support

This commit is contained in:
Stewart Allen 2020-11-12 09:55:19 -05:00
commit f30e3a0288
4 changed files with 59 additions and 19 deletions

View file

@ -30,7 +30,11 @@
function vopt(opt) {
if (opt) {
if (isFlat) { opt.flat = true; return opt }
if (isFlat) {
opt.flat = true;
opt.outline = true;
return opt
}
if (isThin) return null;
}
return opt;
@ -71,9 +75,17 @@
view = widget.mesh && widget.mesh.newGroup ? widget.mesh.newGroup() : null;
isFlat = false;
isThin = settings.controller.thinRender;
isThin = !isFlat && settings.controller.thinRender;
offset = nozzleSize / 2;
if (isFlat) {
Object.values(COLOR).forEach(color => {
color.flat = true;
color.line = 1
color.opacity = 0.5;
});
};
if (!(sliceHeight > 0 && sliceHeight < 100)) {
return ondone("invalid slice height");
}