mirror of
https://github.com/BelfrySCAD/BOSL2.git
synced 2025-01-01 09:49:45 +00:00
error check fixes
This commit is contained in:
parent
846de460fd
commit
79cafb8e2a
1 changed files with 8 additions and 16 deletions
|
@ -2960,7 +2960,7 @@ module corner_profile(corners=CORNERS_ALL, except=[], r, d, convexity=10) {
|
||||||
// recolor("blue") cyl(d=5,h=5);
|
// recolor("blue") cyl(d=5,h=5);
|
||||||
|
|
||||||
module attachable(
|
module attachable(
|
||||||
anchor, spin, orient,
|
anchor=CENTER, spin=0, orient,
|
||||||
size, size2, shift,
|
size, size2, shift,
|
||||||
r,r1,r2, d,d1,d2, l,h,
|
r,r1,r2, d,d1,d2, l,h,
|
||||||
vnf, path, region,
|
vnf, path, region,
|
||||||
|
@ -2975,12 +2975,10 @@ module attachable(
|
||||||
) {
|
) {
|
||||||
dummy1 =
|
dummy1 =
|
||||||
assert($children==2, "attachable() expects exactly two children; the shape to manage, and the union of all attachment candidates.")
|
assert($children==2, "attachable() expects exactly two children; the shape to manage, and the union of all attachment candidates.")
|
||||||
assert(is_undef(anchor) || is_vector(anchor) || is_string(anchor), str("Invalid anchor: ",anchor))
|
assert(is_vector(anchor) || is_string(anchor), str("Invalid anchor: ",anchor))
|
||||||
assert(is_finite(spin), str("Invalid spin: ",spin))
|
assert(is_finite(spin), str("Invalid spin: ",spin))
|
||||||
assert(is_undef(orient) || is_vector(orient,3), str("Invalid orient: ",orient));
|
assert(is_undef(orient) || is_vector(orient,3), str("Invalid orient: ",orient));
|
||||||
assert(in_list(axis,[UP,RIGHT,BACK]), "axis must be a positive coordinate direction, either UP, BACK or RIGHT");
|
assert(in_list(axis,[UP,RIGHT,BACK]), "axis must be a positive coordinate direction, either UP, BACK or RIGHT");
|
||||||
anchor = first_defined([anchor, CENTER]);
|
|
||||||
spin = default(spin, 0);
|
|
||||||
orient = is_def($anchor_override)? UP : default(orient, UP);
|
orient = is_def($anchor_override)? UP : default(orient, UP);
|
||||||
region = !is_undef(region)? region :
|
region = !is_undef(region)? region :
|
||||||
!is_undef(path)? [path] :
|
!is_undef(path)? [path] :
|
||||||
|
@ -3122,7 +3120,7 @@ module attachable(
|
||||||
// axis = The vector pointing along the axis of a geometry. Default: UP
|
// axis = The vector pointing along the axis of a geometry. Default: UP
|
||||||
// p = The VNF, path, or point to transform.
|
// p = The VNF, path, or point to transform.
|
||||||
function reorient(
|
function reorient(
|
||||||
anchor, spin, orient,
|
anchor=CENTER, spin=0, orient=UP,
|
||||||
size, size2, shift,
|
size, size2, shift,
|
||||||
r,r1,r2, d,d1,d2, l,h,
|
r,r1,r2, d,d1,d2, l,h,
|
||||||
vnf, path, region,
|
vnf, path, region,
|
||||||
|
@ -3135,13 +3133,10 @@ function reorient(
|
||||||
geom,
|
geom,
|
||||||
p=undef
|
p=undef
|
||||||
) =
|
) =
|
||||||
assert(is_undef(anchor) || is_vector(anchor) || is_string(anchor), str("Invalid anchor: ",anchor))
|
assert(is_vector(anchor) || is_string(anchor), str("Invalid anchor: ",anchor))
|
||||||
assert(is_finite(spin), str("Invalid spin: ",spin))
|
assert(is_finite(spin), str("Invalid spin: ",spin))
|
||||||
assert(is_undef(orient) || is_vector(orient,3), str("Invalid orient: ",orient))
|
assert(is_vector(orient,3), str("Invalid orient: ",orient))
|
||||||
let(
|
let(
|
||||||
anchor = default(anchor, CENTER),
|
|
||||||
spin = default(spin, 0),
|
|
||||||
orient = default(orient, UP),
|
|
||||||
region = !is_undef(region)? region :
|
region = !is_undef(region)? region :
|
||||||
!is_undef(path)? [path] :
|
!is_undef(path)? [path] :
|
||||||
undef,
|
undef,
|
||||||
|
@ -3618,14 +3613,11 @@ function _attach_geom_edge_path(geom, edge) =
|
||||||
/// geom = The geometry description of the shape.
|
/// geom = The geometry description of the shape.
|
||||||
/// p = If given as a VNF, path, or point, applies the affine3d transformation matrix to it and returns the result.
|
/// p = If given as a VNF, path, or point, applies the affine3d transformation matrix to it and returns the result.
|
||||||
|
|
||||||
function _attach_transform(anchor, spin, orient, geom, p) =
|
function _attach_transform(anchor=CENTER, spin=0, orient=UP, geom, p) =
|
||||||
assert(is_undef(anchor) || is_vector(anchor) || is_string(anchor), str("Invalid anchor: ",anchor))
|
assert(is_vector(anchor) || is_string(anchor), str("Invalid anchor: ",anchor))
|
||||||
assert(is_finite(spin), str("Invalid spin: ",spin))
|
assert(is_finite(spin), str("Invalid spin: ",spin))
|
||||||
assert(is_undef(orient) || is_vector(orient,3), str("Invalid orient: ",orient))
|
assert(is_vector(orient,3), str("Invalid orient: ",orient))
|
||||||
let(
|
let(
|
||||||
anchor = default(anchor, CENTER),
|
|
||||||
spin = default(spin, 0),
|
|
||||||
orient = default(orient, UP),
|
|
||||||
two_d = _attach_geom_2d(geom),
|
two_d = _attach_geom_2d(geom),
|
||||||
m = ($attach_to != undef) ? // $attach_to is the attachment point on this object
|
m = ($attach_to != undef) ? // $attach_to is the attachment point on this object
|
||||||
( // which will attach to the parent
|
( // which will attach to the parent
|
||||||
|
|
Loading…
Reference in a new issue