Fixed bad error check in vp_search, example errors in debug.scad

This commit is contained in:
Adrian Mariano 2021-05-16 19:06:36 -04:00
parent 465cc40c0a
commit b88d05c4db
2 changed files with 2 additions and 2 deletions

View file

@ -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);

View file

@ -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")