fix patterning, add duplication preferences

This commit is contained in:
Stewart Allen 2024-07-26 22:28:52 -04:00
commit 6df554bf72
5 changed files with 49 additions and 29 deletions

View file

@ -205,7 +205,7 @@ mesh.model = class MeshModel extends mesh.object {
return worker.model_duplicate({
matrix: this.matrix,
id: this.id,
opt: { mirror: opt.mirror}
opt: { mirror: opt.mirror }
}).then(data => {
if (opt.append) data = [...data, ...opt.append].toFloat32();
if (opt.reload) return this.reload(data);
@ -213,9 +213,14 @@ mesh.model = class MeshModel extends mesh.object {
let group = opt.group || mesh.api.group.new();
group.add(model);
model.wireframe(this.wireframe());
model.normals(this.normals());
if (opt.select) group.setSelected();
if (opt.mirror) group.move(0, 0, group.bounds.dim.z);
if (opt.select) {
api.selection.add(model);
}
if (opt.mirror) {
group.move(0, 0, group.bounds.dim.z);
} else if (opt.shift) {
group.move(group.bounds.dim.x, 0, 0);
}
return model;
});
}