more noodling
This commit is contained in:
parent
5f0944bdba
commit
9fef4c3d19
2 changed files with 20 additions and 10 deletions
|
|
@ -134,17 +134,25 @@ let gs_kiri_layer = exports;
|
|||
this.changed = true;
|
||||
};
|
||||
|
||||
LP.noodle = function(poly, offset, color) {
|
||||
LP.noodle = function(poly, offset, color, traceColor) {
|
||||
let layer = this;
|
||||
if (Array.isArray(poly)) {
|
||||
poly.forEach(p => { layer.noodle(p, offset, color) });
|
||||
poly = POLY.flatten(poly, [], true);
|
||||
} else {
|
||||
let off = [];
|
||||
POLY.expand(poly.flattenTo([]), offset, poly.getZ(), off, 1);
|
||||
POLY.expand(poly.flattenTo([]), -offset, poly.getZ(), off, 1);
|
||||
POLY.nest(off).forEach(p => { this.add(color, {solid: p}) });
|
||||
this.changed = true;
|
||||
poly = POLY.flatten([poly], [], true);
|
||||
}
|
||||
poly = poly.map(p => p.clone());
|
||||
let exp = [];
|
||||
let z = poly[0].getZ();
|
||||
poly.forEach(p => {
|
||||
POLY.expand([p], offset, z, exp, 1);
|
||||
POLY.expand([p], -offset, z, exp, 1);
|
||||
})
|
||||
POLY.nest(exp).forEach((p,i) => {
|
||||
this.add(color, {solid: p});
|
||||
this.add(traceColor, {poly: p, deep: true, open: false});
|
||||
});
|
||||
this.changed = true;
|
||||
};
|
||||
|
||||
LP.points = function(points, color, size, opacity) {
|
||||
|
|
|
|||
|
|
@ -387,7 +387,7 @@ let gs_kiri_slice = exports;
|
|||
tops.forEach(function(top) {
|
||||
layer.poly(top.poly, outline_colors[color], true, open);
|
||||
// layer.solid(top.poly, outline_solid_colors[color]);
|
||||
if (top.inner) layer.poly(top.inner, 0x777777, true);
|
||||
if (top.inner) layer.poly(top.inner, 0xdddddd, true);
|
||||
// if (top.thinner) layer.poly(top.thinner, 0x559999, true, null);
|
||||
});
|
||||
break;
|
||||
|
|
@ -576,7 +576,9 @@ let gs_kiri_slice = exports;
|
|||
}
|
||||
if (top.traces) {
|
||||
layer.poly(top.traces, trace_color, true, null);
|
||||
// layer.noodle(top.traces, 0.15, 0x888888);
|
||||
// layer.setTransparent(false);
|
||||
// layer.setOpacity(0.5);
|
||||
// layer.noodle(top.traces, 0.19, 0x88aadd, 0x0);
|
||||
}
|
||||
if (top.polish) {
|
||||
layer.poly(top.polish.x, 0x880000, true, null);
|
||||
|
|
@ -584,8 +586,8 @@ let gs_kiri_slice = exports;
|
|||
}
|
||||
});
|
||||
|
||||
layer.render();
|
||||
// layer.renderSolid();
|
||||
layer.render();
|
||||
|
||||
if (scope.camMode) {
|
||||
layers.solid.render();
|
||||
|
|
|
|||
Loading…
Reference in a new issue