stub in cubic infill

This commit is contained in:
Stewart Allen 2021-06-08 14:02:02 -04:00
commit 14ab980371
3 changed files with 55 additions and 68 deletions

View file

@ -319,13 +319,11 @@
/**
* Find Z of XY pair given plane defined by 3 points
*/
function zInPlane(p1, p2, p3, x, y)
{
function zInPlane(p1, p2, p3, x, y) {
let vec1 = new THREE.Vector3(p2.x - p1.x, p2.y - p1.y, p2.z - p1.z);
let vec2 = new THREE.Vector3(p3.x - p1.x, p3.y - p1.y, p3.z - p1.z);
vec1.cross(vec2);
if (vec1.z !== 0) {
return ((vec1.x * (x - p1.x) + vec1.y * (y - p1.y)) / -vec1.z) + p1.z;
}