mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-27 17:19:54 +02:00
add req_children() and apply to distributors and rounding.
fix usage texts in paths.scad
This commit is contained in:
24
utility.scad
24
utility.scad
@@ -731,7 +731,7 @@ function segs(r) =
|
||||
// Usage:
|
||||
// no_children($children);
|
||||
// Topics: Error Checking
|
||||
// See Also: no_function(), no_module()
|
||||
// See Also: no_function(), no_module(), req_children()
|
||||
// Description:
|
||||
// Assert that the calling module does not support children. Prints an error message to this effect and fails if children are present,
|
||||
// as indicated by its argument.
|
||||
@@ -749,6 +749,28 @@ module no_children(count) {
|
||||
}
|
||||
|
||||
|
||||
// Module: req_children()
|
||||
// Usage:
|
||||
// req_children($children);
|
||||
// Topics: Error Checking
|
||||
// See Also: no_function(), no_module()
|
||||
// Description:
|
||||
// Assert that the calling module requires children. Prints an error message and fails if no
|
||||
// children are present as indicated by its argument.
|
||||
// Arguments:
|
||||
// $children = number of children the module has.
|
||||
// Example:
|
||||
// module foo() {
|
||||
// req_children($children);
|
||||
// }
|
||||
module req_children(count) {
|
||||
assert($children==0, "Module no_children() does not support child modules");
|
||||
if ($parent_modules>0) {
|
||||
assert(count>0, str("Module ",parent_module(1),"() requires children"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Function: no_function()
|
||||
// Usage:
|
||||
// dummy = no_function(name)
|
||||
|
Reference in New Issue
Block a user