bump rev 4.0.17, 1.4.9

This commit is contained in:
Stewart Allen 2024-08-02 09:34:15 -04:00
commit 8d50945828
7 changed files with 14 additions and 10 deletions

View file

@ -12,8 +12,9 @@
gapp.register("mesh.split", [], (root, exports) => {
const { Mesh, MeshPhongMaterial, PlaneGeometry, DoubleSide, Vector3 } = THREE;
const { moto } = root;
const { mesh, moto } = root;
const { space } = moto;
const { api } = mesh;
let isActive;
@ -59,7 +60,7 @@ let split = {
let { point, face, object } = int;
let { x, y, z } = point;
// set appearance of split plane
mat.color.set(0x5555aa);
mat.color.set(api.prefs.map.space.dark ? 0x0059bb : 0x0079ff);
obj.visible = true;
if (event.shiftKey) {
y = split.closestZ(y, object, face).y;

View file

@ -24,7 +24,7 @@ const { Matrix4, Vector3, BufferGeometry, BufferAttribute, computeFaceNormal } =
const { base, mesh, moto } = root;
const { client, worker } = moto;
const { util } = mesh;
const { CSG, newPolygon } = base;
const { CSG, newPoint, newPolygon, sliceConnect } = base;
const cache = {};
// add scoped access to cache
@ -191,6 +191,7 @@ let model = {
let on = [];
let over = [];
let under = [];
let edges = [];
function sort(v) {
if (v.z < z) return under.push(v);
if (v.z > z) return over.push(v);
@ -265,6 +266,7 @@ let model = {
g1.appendAll([ ...p2, ...m2, ...m1 ]);
g2.appendAll([ ...m1, ...m2, ...p3 ]);
}
edges.push({ p1: newPoint().move(m1), p2: newPoint().move(m2) });
}
on.length = over.length = under.length = 0;
}
@ -273,6 +275,7 @@ let model = {
let b2 = new BufferAttribute(o2.toFloat32(), 3);
o1 = b1.applyMatrix4(mi4).array;
o2 = b2.applyMatrix4(mi4).array;
console.log({ edges, split_face: sliceConnect(edges, z), o1, o2 });
return { o1, o2 };
},