diff --git a/readme.md b/readme.md index 8526db4..4fd7866 100644 --- a/readme.md +++ b/readme.md @@ -6787,7 +6787,7 @@ The `pose()` module allows assembly views in the readme to be posed differently |:--- |:--- | | `assembly(name, big = undef, ngb = false)` | Name an assembly that will appear on the BOM, there needs to a module named `_assembly` to make it. `big` can force big or small assembly diagrams. | | `dxf(name)` | Name a dxf that will appear on the BOM, there needs to a module named `_dxf` to make it | -| `explode(d, explode_children = false, offset = [0,0,0])` | Explode children by specified Z distance or vector `d`, option to explode grand children | +| `explode(d, explode_children = false, offset = [0,0,0], show_line = true)` | Explode children by specified Z distance or vector `d`, option to explode grand children | | `hidden()` | Make item invisible, except on the BOM | | `no_explode()` | Prevent children being exploded | | `no_pose()` | Force children not to be posed even if parent is | diff --git a/utils/core/bom.scad b/utils/core/bom.scad index 8d29833..31bfeb4 100644 --- a/utils/core/bom.scad +++ b/utils/core/bom.scad @@ -49,17 +49,18 @@ function show_supports() = !$preview || exploded(); //! True if module no_explode() //! Prevent children being exploded let($exploded_parent = true) children(); -module explode(d, explode_children = false, offset = [0,0,0]) { //! Explode children by specified Z distance or vector `d`, option to explode grand children +module explode(d, explode_children = false, offset = [0,0,0], show_line = true) { //! Explode children by specified Z distance or vector `d`, option to explode grand children v = is_list(d) ? d : [0, 0, d]; o = is_list(offset) ? offset : [0, 0, offset]; if(exploded() && norm(v)) { - translate(o) // Draw the line first in case the child is transparent - color("yellow") hull() { - sphere(0.2); - - translate(v * exploded()) + if(show_line) + translate(o) // Draw the line first in case the child is transparent + color("yellow") hull() { sphere(0.2); - } + + translate(v * exploded()) + sphere(0.2); + } translate(v * exploded()) let($exploded_parent = explode_children ? undef : true)