mirror of
https://github.com/Theaninova/Bampy.git
synced 2025-12-12 12:36:16 +00:00
fix: respect angle
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
|||||||
BufferGeometryLoader,
|
BufferGeometryLoader,
|
||||||
Float32BufferAttribute,
|
Float32BufferAttribute,
|
||||||
Line3,
|
Line3,
|
||||||
|
MathUtils,
|
||||||
Matrix4,
|
Matrix4,
|
||||||
Plane,
|
Plane,
|
||||||
Vector3
|
Vector3
|
||||||
@@ -18,7 +19,6 @@ import {
|
|||||||
|
|
||||||
addEventListener('message', (event: MessageEvent<WorkerEvent>) => {
|
addEventListener('message', (event: MessageEvent<WorkerEvent>) => {
|
||||||
if (event.data.type === 'slice') {
|
if (event.data.type === 'slice') {
|
||||||
console.log(event.data.data);
|
|
||||||
slice(event.data.data);
|
slice(event.data.data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -205,7 +205,7 @@ function slice({
|
|||||||
if (
|
if (
|
||||||
h1 &&
|
h1 &&
|
||||||
h1.point.z < a.z &&
|
h1.point.z < a.z &&
|
||||||
h1.point.clone().sub(a).angleTo(bedNormal) > maxNonPlanarAngle
|
Math.abs(Math.PI / 2 - h1.point.clone().sub(a).angleTo(bedNormal)) > maxNonPlanarAngle
|
||||||
) {
|
) {
|
||||||
withheldLayer.geometry.push(a.x, a.y, a.z, b.x, b.y, b.z);
|
withheldLayer.geometry.push(a.x, a.y, a.z, b.x, b.y, b.z);
|
||||||
return;
|
return;
|
||||||
@@ -214,7 +214,7 @@ function slice({
|
|||||||
if (
|
if (
|
||||||
h2 &&
|
h2 &&
|
||||||
h2.point.z < b.z &&
|
h2.point.z < b.z &&
|
||||||
h2.point.clone().sub(b).angleTo(bedNormal) > maxNonPlanarAngle
|
Math.abs(Math.PI / 2 - h2.point.clone().sub(b).angleTo(bedNormal)) > maxNonPlanarAngle
|
||||||
) {
|
) {
|
||||||
withheldLayer.geometry.push(a.x, a.y, a.z, b.x, b.y, b.z);
|
withheldLayer.geometry.push(a.x, a.y, a.z, b.x, b.y, b.z);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user