From b88d05c4db51b8fa033a2304f45bb09a18ca919a Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sun, 16 May 2021 19:06:36 -0400 Subject: [PATCH] Fixed bad error check in vp_search, example errors in debug.scad --- debug.scad | 2 +- vectors.scad | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/debug.scad b/debug.scad index 27f175f..4bb8479 100644 --- a/debug.scad +++ b/debug.scad @@ -260,7 +260,7 @@ module debug_faces(vertices, faces, size=1, disabled=false) { // Example(EdgesMed): // verts = [for (z=[-10,10], a=[0:120:359.9]) [10*cos(a),10*sin(a),z]]; // faces = [[0,1,2], [5,4,3], [0,3,4], [0,4,1], [1,4,5], [1,5,2], [2,5,3], [2,3,0]]; -// debug_polyhedron([verts,faces], txtsize=1); +// debug_vnf([verts,faces], txtsize=2); module debug_vnf(vnf, convexity=6, txtsize=1, disabled=false) { debug_faces(vertices=vnf[0], faces=vnf[1], size=txtsize, disabled=disabled) { vnf_polyhedron(vnf, convexity=convexity); diff --git a/vectors.scad b/vectors.scad index 4f590fc..a98594a 100644 --- a/vectors.scad +++ b/vectors.scad @@ -304,7 +304,7 @@ function _vp_search(points, tree, p, r) = ]; function vp_search(points, tree, p, r) = - assert(is_list(tree[1]) && (len(tree[1])==4 || (len(tree[1])==1 && is_list(tree[0]))), "Vantage point tree not valid") + assert(is_list(tree) && (len(tree)==4 || (len(tree)==1 && is_list(tree[0]))), "Vantage point tree not valid") assert(is_matrix(points), "Parameter points is not a consistent point list") assert(is_vector(p,len(points[0])), "Query must be a vector whose length matches the point list") assert(all_positive(r),"Radius r must be a positive number")