mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 11:33:49 +01:00
don't calculate 1 - alpha twice
This commit is contained in:
parent
7f2b8da15f
commit
bbda9089d2
@ -33,8 +33,9 @@ export default function calculateLayersIntersections(lines, settings) {
|
|||||||
z = line.start.z;
|
z = line.start.z;
|
||||||
} else {
|
} else {
|
||||||
const alpha = (y - line.start.y) / (line.end.y - line.start.y);
|
const alpha = (y - line.start.y) / (line.end.y - line.start.y);
|
||||||
x = line.end.x * alpha + line.start.x * (1 - alpha);
|
const alpha1 = 1 - alpha;
|
||||||
z = line.end.z * alpha + line.start.z * (1 - alpha);
|
x = line.end.x * alpha + line.start.x * alpha1;
|
||||||
|
z = line.end.z * alpha + line.start.z * alpha1;
|
||||||
}
|
}
|
||||||
|
|
||||||
layerIntersectionPoints[layerIndex][lineIndex] = new THREE.Vector2(z, x);
|
layerIntersectionPoints[layerIndex][lineIndex] = new THREE.Vector2(z, x);
|
||||||
|
Loading…
Reference in New Issue
Block a user