mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-30 08:19:36 +00: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:
parent
30c63fd165
commit
83ed788ac6
1 changed files with 34 additions and 42 deletions
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
|
||||
|
|
Loading…
Reference in a new issue