mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-29 17:20:12 +02:00
fix anchoring for textured case
This commit is contained in:
18
skin.scad
18
skin.scad
@@ -861,23 +861,21 @@ function linear_sweep(
|
||||
assert(is_vector(shift, 2), str(shift))
|
||||
assert(is_bool(caps) || is_bool_list(caps,2), "\ncaps must be boolean or a list of two booleans.")
|
||||
let(
|
||||
h = one_defined([h, height,l,length],"h,height,l,length",dflt=1)
|
||||
)
|
||||
!is_undef(texture)? _textured_linear_sweep(
|
||||
h = one_defined([h, height,l,length],"h,height,l,length",dflt=1),
|
||||
regions = region_parts(region),
|
||||
vnf = !is_undef(texture)?
|
||||
_textured_linear_sweep(
|
||||
region, h=h, caps=caps,
|
||||
texture=texture, tex_size=tex_size,
|
||||
counts=tex_reps, inset=tex_inset,
|
||||
rot=tex_rot, tex_scale=tex_depth,
|
||||
twist=twist, scale=scale, shift=shift,
|
||||
style=style, samples=tex_samples,
|
||||
anchor=anchor, spin=spin, orient=orient
|
||||
) :
|
||||
let(
|
||||
style=style, samples=tex_samples)
|
||||
: let(
|
||||
caps = is_bool(caps) ? [caps,caps] : caps,
|
||||
anchor = center==true? "origin" :
|
||||
center == false? "original_base" :
|
||||
default(anchor, "original_base"),
|
||||
regions = region_parts(region),
|
||||
slices = default(slices, max(1,ceil(abs(twist)/5))),
|
||||
scale = is_num(scale)? [scale,scale] : point2d(scale),
|
||||
topmat = move(shift) * scale(scale) * rot(-twist),
|
||||
@@ -914,7 +912,9 @@ function linear_sweep(
|
||||
) vnf_vertex_array(verts, caps=false, col_wrap=true, style=style),
|
||||
if (caps[0]) for (rgn = regions) vnf_from_region(rgn, down(h/2), reverse=true),
|
||||
if (caps[1]) for (rgn = trgns) vnf_from_region(rgn, up(h/2), reverse=false)
|
||||
]),
|
||||
])
|
||||
)
|
||||
vnf,
|
||||
regparts = flatten(regions),
|
||||
sizes = [0,each cumsum([for(entry=regparts) len(entry)])],
|
||||
ganchors = [
|
||||
|
Reference in New Issue
Block a user