Added showdots and showpatch option to trace_bezier_patch

This commit is contained in:
Adrian Mariano 2020-03-27 19:26:53 -04:00
parent 30c54725fc
commit 75054fb215

View file

@ -1002,7 +1002,7 @@ module bezier_polyhedron(patches=[], splinesteps=16, vnf=EMPTY_VNF)
// [[15,85,0], [33,100, 0], [ 67,100, 0], [ 85, 85,0]], // [[15,85,0], [33,100, 0], [ 67,100, 0], [ 85, 85,0]],
// ]; // ];
// trace_bezier_patches(patches=[patch1, patch2], splinesteps=8, showcps=true); // trace_bezier_patches(patches=[patch1, patch2], splinesteps=8, showcps=true);
module trace_bezier_patches(patches=[], size=1, showcps=false, splinesteps=16) module trace_bezier_patches(patches=[], size=1, showcps=false, splinesteps=16, showpatch=true, showdots=true)
{ {
if (showcps) { if (showcps) {
for (patch = patches) { for (patch = patches) {
@ -1020,11 +1020,14 @@ module trace_bezier_patches(patches=[], size=1, showcps=false, splinesteps=16)
if (j<len(patch[i])-1) extrude_from_to(patch[i][j], patch[i][j+1]) circle(d=size); if (j<len(patch[i])-1) extrude_from_to(patch[i][j], patch[i][j+1]) circle(d=size);
} }
} }
vnf = bezier_patch(patch, splinesteps=splinesteps); if (showdots){
color("blue") move_copies(vnf[0]) sphere(d=size); vnf = bezier_patch(patch, splinesteps=splinesteps);
color("blue") move_copies(vnf[0]) sphere(d=size);
}
} }
} }
bezier_polyhedron(patches=patches, splinesteps=splinesteps); if (showpatch)
bezier_polyhedron(patches=patches, splinesteps=splinesteps);
} }