mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-26 15:34:57 +01:00
don't calculate 1 - alpha twice
This commit is contained in:
parent
52e9ba31e0
commit
b3300decb7
@ -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