Compare commits

..

1 commit

Author SHA1 Message Date
adrianVmariano
3f846cf78a
Merge 51fbe696b1 into 53af9121e7 2024-08-31 17:20:08 +00:00

View file

@ -977,8 +977,7 @@ module regular_prism(n,
texture=texture, tex_size=tex_size, tex_reps=tex_reps,
tex_inset=tex_inset, tex_rot=tex_rot,
tex_depth=tex_depth, tex_samples=tex_samples,
tex_taper=tex_taper, style=style,
_return_anchors=true);
tex_taper=tex_taper, style=style);
attachable(anchor=anchor, orient=orient, spin=spin, vnf=vnf_anchors_ovr[0], anchors=vnf_anchors_ovr[1],override=vnf_anchors_ovr[2]){
vnf_polyhedron(vnf_anchors_ovr[0],convexity=is_def(texture)?10:2);
children();
@ -1004,7 +1003,7 @@ function regular_prism(n,
tex_inset=false, tex_rot=0,
tex_depth, tex_samples, length, height,
tex_taper, style,
anchor, spin=0, orient=UP,_return_anchors=false
anchor, spin=0, orient=UP
) =
assert(is_integer(n) && n>2, "n must be an integer 3 or greater")
let(
@ -1138,14 +1137,13 @@ function regular_prism(n,
dir = apply(M,[height,0,-edge_face[j].x]),
spin = sign(dir.x)*vector_angle(edge - (edge*dir)*dir, rot(from=UP,to=dir,p=BACK))
)
each [
each
[
named_anchor(str(names[j],i), apply(M,[(r1+r2)/2/(j==0?1:sc),0,0]), dir, spin),
named_anchor(str(j==0?"top_corner":"top_edge",i), apply(M,[r2/(j==0?1:sc),0,height/2]), dir, spin),
named_anchor(str(j==0?"bot_corner":"bot_edge",i), apply(M,[r1/(j==0?1:sc),0,-height/2]), dir, spin),
]
]
:
let(
]:let(
faces = [
for(i=[0:n-1])
let(
@ -1180,11 +1178,11 @@ function regular_prism(n,
named_anchor(str("bot_corner",i), apply(Medge,[r1,0,-height/2]), edgenormal, edgespin)
]
],
override = approx(shift,[0,0]) ? undef : [[UP, [point3d(shift,height/2), UP]]],
final_vnf = reorient(anchor,spin,orient, vnf=ovnf, p=ovnf,anchors=anchors, override=override)
override = approx(shift,[0,0]) ? undef : [[UP, [point3d(shift,height/2), UP]]]
)
_return_anchors ? [final_vnf,anchors,override]
: final_vnf;
[reorient(anchor,spin,orient, vnf=ovnf, p=ovnf,anchors=anchors, override=override),anchors,override];
// Module: rect_tube()