experimental noozle rendering
This commit is contained in:
parent
5914f39b35
commit
5f0944bdba
3 changed files with 18 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ let gs_kiri_layer = exports;
|
|||
if (self.kiri.Layer) return;
|
||||
|
||||
let KIRI = self.kiri,
|
||||
POLY = self.base.polygons,
|
||||
LP = Layer.prototype,
|
||||
mcache = {};
|
||||
|
||||
|
|
@ -133,6 +134,19 @@ let gs_kiri_layer = exports;
|
|||
this.changed = true;
|
||||
};
|
||||
|
||||
LP.noodle = function(poly, offset, color) {
|
||||
let layer = this;
|
||||
if (Array.isArray(poly)) {
|
||||
poly.forEach(p => { layer.noodle(p, offset, color) });
|
||||
} 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;
|
||||
}
|
||||
};
|
||||
|
||||
LP.points = function(points, color, size, opacity) {
|
||||
let layer = this,
|
||||
sz = size/2;
|
||||
|
|
|
|||
Loading…
Reference in a new issue