mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
Tweaked cylindrical_extrude() to make sure wedges union.
This commit is contained in:
parent
780211a357
commit
8a64ae7a9c
2 changed files with 13 additions and 11 deletions
|
@ -347,20 +347,22 @@ module cylindrical_extrude(or, ir, od, id, size=1000, convexity=10, spin=0, orie
|
||||||
or = get_radius(r=or,d=od);
|
or = get_radius(r=or,d=od);
|
||||||
index_r = or;
|
index_r = or;
|
||||||
circumf = 2 * PI * index_r;
|
circumf = 2 * PI * index_r;
|
||||||
width = min(size.x + 1, circumf);
|
width = min(size.x, circumf);
|
||||||
assert(width <= circumf, "Shape would more than completely wrap around.");
|
assert(width <= circumf, "Shape would more than completely wrap around.");
|
||||||
steps = ceil(segs(or) * width / circumf);
|
sides = segs(or);
|
||||||
step = quant(width / steps, 1/32768);
|
step = circumf / sides;
|
||||||
rot(from=UP, to=orient) rot(spin) xrot(90) {
|
steps = ceil(width / step);
|
||||||
|
rot(from=UP, to=orient) rot(spin) {
|
||||||
for (i=[0:1:steps-2]) {
|
for (i=[0:1:steps-2]) {
|
||||||
x = (i+0.5) * step - width/2;
|
x = (i+0.5-steps/2) * step;
|
||||||
yrot(360 * x / circumf) {
|
zrot(360 * x / circumf) {
|
||||||
up(or) {
|
fwd(or*cos(180/sides)) {
|
||||||
zflip() {
|
xrot(-90) {
|
||||||
linear_extrude(height=or-ir, scale=ir/or, center=false, convexity=convexity) {
|
linear_extrude(height=or-ir, scale=[ir/or,1], center=false, convexity=convexity) {
|
||||||
|
yflip()
|
||||||
intersection() {
|
intersection() {
|
||||||
left(x) children();
|
left(x) children();
|
||||||
rect([step,size.y+1],center=true);
|
rect([step,size.y],center=true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,302];
|
BOSL_VERSION = [2,0,303];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
|
Loading…
Reference in a new issue