mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-07-31 10:20:28 +02:00
Fixed trace_bezier_patch to correct fatal error and modified it so it
only calculates the vnf when needed, as this can be slow.
This commit is contained in:
16
beziers.scad
16
beziers.scad
@@ -1262,11 +1262,6 @@ module trace_bezier_patches(patches=[], size, splinesteps=16, showcps=true, show
|
||||
assert(is_bool(showdots));
|
||||
assert(is_bool(showpatch));
|
||||
assert(is_int(convexity) && convexity>0);
|
||||
vnfs = [
|
||||
for (patch = patches)
|
||||
bezier_patch(patch, splinesteps=splinesteps, style=style)
|
||||
];
|
||||
if (showcps || showdots) {
|
||||
for (patch = patches) {
|
||||
size = is_num(size)? size :
|
||||
let( bounds = pointlist_bounds(flatten(patch)) )
|
||||
@@ -1288,16 +1283,13 @@ module trace_bezier_patches(patches=[], size, splinesteps=16, showcps=true, show
|
||||
}
|
||||
}
|
||||
}
|
||||
if (showdots){
|
||||
color("blue") move_copies(vnfs[i][0]) sphere(d=size);
|
||||
if (showpatch || showdots){
|
||||
vnf = bezier_patch(patch, splinesteps=splinesteps, style=style);
|
||||
if (showpatch) vnf_polyhedron(vnf, convexity=convexity);
|
||||
if (showdots) color("blue") move_copies(vnf[0]) sphere(d=size);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (showpatch) {
|
||||
vnf_polyhedron(vnfs, convexity=convexity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// vim: noexpandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
|
||||
|
Reference in New Issue
Block a user