mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-04 03:09:45 +00:00
Lessened impact of GRID_COARSE rounding on square() and cube()
This commit is contained in:
parent
aa8a084d62
commit
50238f6980
1 changed files with 2 additions and 3 deletions
|
@ -35,10 +35,9 @@
|
||||||
// path = square([40,30], anchor=FRONT, spin=30);
|
// path = square([40,30], anchor=FRONT, spin=30);
|
||||||
module square(size, center=undef, anchor=FRONT+LEFT, spin=0) {
|
module square(size, center=undef, anchor=FRONT+LEFT, spin=0) {
|
||||||
size = is_num(size)? [size,size] : point2d(size);
|
size = is_num(size)? [size,size] : point2d(size);
|
||||||
s = size/2;
|
pts = [[0,0], [0,size.y], size, [size.x,0]];
|
||||||
pts = [[-s.x,-s.y], [-s.x,s.y], [s.x,s.y], [s.x,-s.y]];
|
|
||||||
orient_and_anchor(point3d(size), UP, anchor, spin=spin, center=center, noncentered=FRONT+LEFT, two_d=true, chain=true) {
|
orient_and_anchor(point3d(size), UP, anchor, spin=spin, center=center, noncentered=FRONT+LEFT, two_d=true, chain=true) {
|
||||||
polygon(pts);
|
translate(-size/2) polygon(pts);
|
||||||
children();
|
children();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue