add sample extrusion capability
This commit is contained in:
parent
2cfe6bac38
commit
63620bfcbe
4 changed files with 31 additions and 2 deletions
|
|
@ -240,6 +240,21 @@ mesh.sketch = class MeshSketch extends mesh.object {
|
|||
});
|
||||
this.update();
|
||||
}
|
||||
|
||||
extrude(opt = {}) {
|
||||
let { z } = opt;
|
||||
let models = [];
|
||||
for (let item of this.group.children.filter(c => c.poly)) {
|
||||
let vert = item.poly.extrude(z || 10);
|
||||
let nmdl = new mesh.model({ file: "poly", mesh: vert.toFloat32() });
|
||||
models.push(nmdl);
|
||||
}
|
||||
if (models.length) {
|
||||
log('extrude', this.file || this.id, 'into', models.length, 'solid(s)');
|
||||
let ngrp = api.group.new(models);
|
||||
ngrp.floor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
Loading…
Reference in a new issue