add new fdm-driver slice rendering
This commit is contained in:
parent
29f63be952
commit
a6310c6fbc
6 changed files with 172 additions and 8 deletions
|
|
@ -1409,18 +1409,18 @@
|
|||
]),
|
||||
|
||||
layers: UC.setGroup($("layers")),
|
||||
layerOutline: UC.newBoolean(LANG.la_olin, onLayerToggle, {modes:ALL}),
|
||||
layerTrace: UC.newBoolean(LANG.la_trce, onLayerToggle, {modes:FDM_LASER}),
|
||||
layerFacing: UC.newBoolean(LANG.la_face, onLayerToggle, {modes:[]}), // see sliceRender() in CAM
|
||||
layerRough: UC.newBoolean(LANG.la_ruff, onLayerToggle, {modes:CAM}),
|
||||
layerFinish: UC.newBoolean(LANG.la_fini, onLayerToggle, {modes:CAM}),
|
||||
layerFinishX: UC.newBoolean(LANG.la_finx, onLayerToggle, {modes:CAM}),
|
||||
layerFinishY: UC.newBoolean(LANG.la_finy, onLayerToggle, {modes:CAM}),
|
||||
layerDelta: UC.newBoolean(LANG.la_dlta, onLayerToggle, {modes:FDM_SLA}),
|
||||
layerSolid: UC.newBoolean(LANG.la_slds, onLayerToggle, {modes:FDM_SLA}),
|
||||
layerFill: UC.newBoolean(LANG.la_fill, onLayerToggle, {modes:FDM}),
|
||||
layerSparse: UC.newBoolean(LANG.la_sprs, onLayerToggle, {modes:FDM}),
|
||||
layerSupport: UC.newBoolean(LANG.la_sprt, onLayerToggle, {modes:FDM_SLA}),
|
||||
layerOutline: UC.newBoolean(LANG.la_olin, onLayerToggle, {modes:ALL}),
|
||||
layerDelta: UC.newBoolean(LANG.la_dlta, onLayerToggle, {modes:FDM_SLA}),
|
||||
layerSolid: UC.newBoolean(LANG.la_slds, onLayerToggle, {modes:FDM_SLA}),
|
||||
layerPrint: UC.newBoolean(LANG.la_prnt, onLayerToggle),
|
||||
layerMoves: UC.newBoolean(LANG.la_move, onLayerToggle, {modes:GCODE})
|
||||
});
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@
|
|||
};
|
||||
|
||||
LP.noodle = function(poly, offset, color, traceColor, open) {
|
||||
if (!poly) return;
|
||||
if (Array.isArray(poly)) {
|
||||
poly = POLY.flatten(poly, [], true);
|
||||
} else {
|
||||
|
|
@ -152,6 +153,32 @@
|
|||
this.changed = true;
|
||||
};
|
||||
|
||||
LP.noodle_open = function(poly, offset, color, traceColor, z) {
|
||||
poly = POLY.expand_lines(poly, offset, z);
|
||||
poly.forEach(p => {
|
||||
this.add(color, {solid: p});
|
||||
p = p.setZ(z + 0.01);
|
||||
this.add(traceColor, {poly: p, deep: false, open: true});
|
||||
})
|
||||
this.changed = true;
|
||||
};
|
||||
|
||||
LP.noodle_lines = function(points, offset, color, traceColor, z) {
|
||||
if (!(points && points.length)) return;
|
||||
for (let i=0; i<points.length; i += 2) {
|
||||
let p1 = points[i];
|
||||
let p2 = points[i+1];
|
||||
let l1 = p1.offsetLineTo(p2, offset);
|
||||
let l2 = p2.offsetLineTo(p1, offset);
|
||||
let poly = base.newPolygon().addPoints([
|
||||
l1.p1, l1.p2, l2.p1, l2.p2
|
||||
]).setZ(z + 0.01);
|
||||
this.add(color, {solid: poly});
|
||||
this.add(traceColor, {poly: poly, deep: false, open: true});
|
||||
}
|
||||
this.changed = true;
|
||||
};
|
||||
|
||||
LP.points = function(points, color, size, opacity) {
|
||||
let layer = this,
|
||||
sz = size/2;
|
||||
|
|
|
|||
|
|
@ -722,7 +722,7 @@
|
|||
driver = DRIVERS[settings.mode.toUpperCase()];
|
||||
|
||||
// allow driver to override widget slice rendering (new in SLA)
|
||||
if (driver.sliceRender) return driver.sliceRender(this);
|
||||
if (driver.sliceRender) return driver.sliceRender(this, renderMode);
|
||||
|
||||
let extruder = this.getExtruder(settings);
|
||||
// render outline
|
||||
|
|
|
|||
Loading…
Reference in a new issue