mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2025-02-17 08:03:45 -05:00
quadrant can now have different height and width if passed a vector.
This commit is contained in:
parent
547a418cea
commit
699385342f
@ -23,18 +23,21 @@
|
|||||||
include <../utils/core/core.scad>
|
include <../utils/core/core.scad>
|
||||||
|
|
||||||
module quadrant(w, r, center = false) { //! Draw a square with one rounded corner, can be centered on the arc centre, when ```center``` is ```true```.
|
module quadrant(w, r, center = false) { //! Draw a square with one rounded corner, can be centered on the arc centre, when ```center``` is ```true```.
|
||||||
offset = center ? r - w : 0;
|
h = is_list(w) ? w.y : w;
|
||||||
translate([offset, offset])
|
w = is_list(w) ? w.x : w;
|
||||||
|
offset_w = center ? r - w : 0;
|
||||||
|
offset_h = center ? r - h : 0;
|
||||||
|
translate([offset_w, offset_h])
|
||||||
hull() {
|
hull() {
|
||||||
intersection() {
|
intersection() {
|
||||||
translate([w - r, w - r])
|
translate([w - r, h - r])
|
||||||
circle4n(r);
|
circle4n(r);
|
||||||
|
|
||||||
square(w);
|
square([w, h]);
|
||||||
}
|
}
|
||||||
|
|
||||||
square([w, eps]);
|
square([w, eps]);
|
||||||
|
|
||||||
square([eps, w]);
|
square([eps, h]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user