From ee82a8bb971a38b52ccb8b97cdbac974c5f99a64 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Mon, 9 Mar 2020 21:05:57 -0400 Subject: [PATCH] bug fix qr factorization, removed echo in plane intersection, fixed bezier_surface so vnf arg is in right order --- beziers.scad | 4 ++-- geometry.scad | 3 +-- math.scad | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/beziers.scad b/beziers.scad index 95351dc..bfddbeb 100644 --- a/beziers.scad +++ b/beziers.scad @@ -923,12 +923,12 @@ function patch_reverse(patch) = [for (row=patch) reverse(row)]; // ]; // vnf = bezier_surface(patches=[patch1, patch2], splinesteps=16); // polyhedron(points=vnf[0], faces=vnf[1]); -function bezier_surface(patches=[], splinesteps=16, i=0, vnf=[[],[]]) = +function bezier_surface(patches=[], splinesteps=16, vnf=[[],[]], i=0) = let( vnf = (i >= len(patches))? vnf : bezier_patch(patches[i], splinesteps=splinesteps, vnf=vnf) ) (i >= len(patches))? vnf : - bezier_surface(patches=patches, splinesteps=splinesteps, i=i+1, vnf=vnf); + bezier_surface(patches=patches, splinesteps=splinesteps, vnf=vnf, i=i+1); diff --git a/geometry.scad b/geometry.scad index 34a3a23..1f3bf63 100644 --- a/geometry.scad +++ b/geometry.scad @@ -606,8 +606,7 @@ function plane_intersection(plane1,plane2,plane3) = let( matrix = [for(p=[plane1,plane2]) select(p,0,2)], rhs = [for(p=[plane1,plane2]) p[3]], - point = linear_solve(matrix,rhs), - dd=echo(point=point, normal=normal) + point = linear_solve(matrix,rhs) ) [point, point+normal]; diff --git a/math.scad b/math.scad index f3e1b99..e6cee05 100644 --- a/math.scad +++ b/math.scad @@ -579,7 +579,7 @@ function qr_factor(A) = ) assert(len(dim)==2) let( - qr =_qr_factor(A, column=0, m = m, n=m, Q=ident(m)), + qr =_qr_factor(A, column=0, m = m, n=n, Q=ident(m)), Rzero = [ for(i=[0:m-1]) [ for(j=[0:n-1])