mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-06 21:06:38 +02:00
16
debug.scad
16
debug.scad
@@ -301,6 +301,22 @@ module anchor_arrow(s=10, color=[0.333,0.333,1], flag=true, $tags="anchor-arrow"
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Module: anchor_arrow2d()
|
||||||
|
// Usage:
|
||||||
|
// anchor_arrow2d([s], [color], [flag]);
|
||||||
|
// Description:
|
||||||
|
// Show an anchor orientation arrow.
|
||||||
|
// Arguments:
|
||||||
|
// s = Length of the arrows.
|
||||||
|
// color = Color of the arrow.
|
||||||
|
// Example:
|
||||||
|
// anchor_arrow2d(s=20);
|
||||||
|
module anchor_arrow2d(s=15, color=[0.333,0.333,1], $tags="anchor-arrow") {
|
||||||
|
noop() stroke([[0,0],[0,s]], width=s/10, endcap1="butt", endcap2="arrow2");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Module: show_internal_anchors()
|
// Module: show_internal_anchors()
|
||||||
// Usage:
|
// Usage:
|
||||||
// show_internal_anchors() ...
|
// show_internal_anchors() ...
|
||||||
|
@@ -27,15 +27,15 @@
|
|||||||
// translate([10,8,4]) cube(5);
|
// translate([10,8,4]) cube(5);
|
||||||
// translate([3,0,12]) cube(2);
|
// translate([3,0,12]) cube(2);
|
||||||
module bounding_box(excess=0) {
|
module bounding_box(excess=0) {
|
||||||
xs = excess>0? excess : 1;
|
xs = excess>.1? excess : 1;
|
||||||
// a 3D approx. of the children projection on X axis
|
// a 3D approx. of the children projection on X axis
|
||||||
module _xProjection()
|
module _xProjection()
|
||||||
linear_extrude(xs, center=true)
|
linear_extrude(xs, center=true)
|
||||||
hull()
|
projection()
|
||||||
projection()
|
rotate([90,0,0])
|
||||||
rotate([90,0,0])
|
linear_extrude(xs, center=true)
|
||||||
linear_extrude(xs, center=true)
|
projection()
|
||||||
projection()
|
hull()
|
||||||
children();
|
children();
|
||||||
|
|
||||||
// a bounding box with an offset of 1 in all axis
|
// a bounding box with an offset of 1 in all axis
|
||||||
@@ -50,13 +50,13 @@ module bounding_box(excess=0) {
|
|||||||
// offset children() (a cube) by -1 in all axis
|
// offset children() (a cube) by -1 in all axis
|
||||||
module _shrink_cube() {
|
module _shrink_cube() {
|
||||||
intersection() {
|
intersection() {
|
||||||
translate([ 1, 1, 1]) children();
|
translate((1-excess)*[ 1, 1, 1]) children();
|
||||||
translate([-1,-1,-1]) children();
|
translate((1-excess)*[-1,-1,-1]) children();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
render(convexity=2)
|
render(convexity=2)
|
||||||
if (excess>0) {
|
if (excess>.1) {
|
||||||
_oversize_bbox() children();
|
_oversize_bbox() children();
|
||||||
} else {
|
} else {
|
||||||
_shrink_cube() _oversize_bbox() children();
|
_shrink_cube() _oversize_bbox() children();
|
||||||
@@ -674,7 +674,7 @@ module minkowski_difference() {
|
|||||||
bounding_box(excess=1) children(0);
|
bounding_box(excess=1) children(0);
|
||||||
children(0);
|
children(0);
|
||||||
}
|
}
|
||||||
for (i=[1,1,$children-1]) children(i);
|
for (i=[1:1:$children-1]) children(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
BOSL_VERSION = [2,0,480];
|
BOSL_VERSION = [2,0,482];
|
||||||
|
|
||||||
|
|
||||||
// Section: BOSL Library Version Functions
|
// Section: BOSL Library Version Functions
|
||||||
|
Reference in New Issue
Block a user