mirror of
https://github.com/DJSundog/NopSCADlib.git
synced 2024-11-27 09:10:02 -05:00
Merge branch 'martinbudden-render_if'
This commit is contained in:
commit
76ea28e88e
@ -6098,6 +6098,7 @@ Global constants, functions and modules. This file is used directly or indirectl
|
|||||||
| ```ellipse(xr, yr)``` | Draw an ellipse |
|
| ```ellipse(xr, yr)``` | Draw an ellipse |
|
||||||
| ```extrude_if(h, center = true)``` | Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D |
|
| ```extrude_if(h, center = true)``` | Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D |
|
||||||
| ```hflip(flip=true)``` | Invert children by doing a 180° flip around the Y axis |
|
| ```hflip(flip=true)``` | Invert children by doing a 180° flip around the Y axis |
|
||||||
|
| ```render_if(render = true, convexity = 2)``` | Renders an object if ```render``` is true, otherwise leaves it unrendered |
|
||||||
| ```right_triangle(width, height, h, center = true)``` | A right angled triangle with the 90° corner at the origin. 3D when ```h``` is nonzero, otherwise 2D |
|
| ```right_triangle(width, height, h, center = true)``` | A right angled triangle with the 90° corner at the origin. 3D when ```h``` is nonzero, otherwise 2D |
|
||||||
| ```semi_circle(r, d = undef)``` | A semi circle in the positive Y domain |
|
| ```semi_circle(r, d = undef)``` | A semi circle in the positive Y domain |
|
||||||
| ```translate_z(z)``` | Shortcut for Z only translations |
|
| ```translate_z(z)``` | Shortcut for Z only translations |
|
||||||
|
@ -52,6 +52,13 @@ function slice(list, start = 0, end = undef) = let( //! Slice a list or string w
|
|||||||
) is_string(list) ? slice_str(list, start, end) : [for(i = [start : 1 : end - 1]) list[i]];
|
) is_string(list) ? slice_str(list, start, end) : [for(i = [start : 1 : end - 1]) list[i]];
|
||||||
|
|
||||||
|
|
||||||
|
module render_if(render = true, convexity = 2) //! Renders an object if ```render``` is true, otherwise leaves it unrendered
|
||||||
|
if (render)
|
||||||
|
render(convexity = convexity)
|
||||||
|
children();
|
||||||
|
else
|
||||||
|
children();
|
||||||
|
|
||||||
module extrude_if(h, center = true) //! Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D
|
module extrude_if(h, center = true) //! Extrudes 2D object to 3D when ```h``` is nonzero, otherwise leaves it 2D
|
||||||
if(h)
|
if(h)
|
||||||
linear_extrude(h, center = center, convexity = 2) // 3D
|
linear_extrude(h, center = center, convexity = 2) // 3D
|
||||||
|
Loading…
Reference in New Issue
Block a user