Bugfixes for hull.scad

This commit is contained in:
Revar Desmera
2019-04-30 23:45:05 -07:00
parent 3b064c69bf
commit 3a71633f7f
8 changed files with 496 additions and 434 deletions

View File

@@ -216,13 +216,14 @@ function xy_to_polar(x,y=undef) = let(
// can be useful in taking a set of nearly coplanar points, and converting
// them to a pure XY set of coordinates for manipulation, before convering
// them back to the original 3D plane.
function xyz_to_planar(point, a, b, c) = let(
u = normalize(b-a),
v = normalize(c-a),
n = normalize(cross(u,v)),
w = normalize(cross(n,u)),
relpoint = point-a
) [relpoint * w, relpoint * u];
function xyz_to_planar(point, a, b, c) =
let(
u = normalize(b-a),
v = normalize(c-a),
n = normalize(cross(u,v)),
w = normalize(cross(n,u)),
relpoint = point-a
) [relpoint * w, relpoint * u];
// Function: planar_to_xyz()