mirror of
https://github.com/nophead/NopSCADlib.git
synced 2025-08-16 04:13:57 +02:00
Mods to allow the manifold experimetal option to be used.
This commit is contained in:
@@ -41,7 +41,7 @@ module box(xmin, ymin, zmin, xmax, ymax, zmax) //! Construct a box given its bou
|
||||
[0,2,3,1]] // left
|
||||
);
|
||||
|
||||
module clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf, convexity = 1) //! Clip child to specified boundaries
|
||||
module clip(xmin = -big, ymin = -big, zmin = -big, xmax = big, ymax = big, zmax = big, convexity = 1) //! Clip child to specified boundaries
|
||||
render(convexity = convexity) intersection() {
|
||||
children();
|
||||
|
||||
|
@@ -74,6 +74,10 @@ module render_if(render = true, convexity = 2) //! Renders an object if `re
|
||||
else
|
||||
children();
|
||||
|
||||
module render_manifold() //! Render if manifold to work around convexity bug in manifold
|
||||
render_if(manifold)
|
||||
children();
|
||||
|
||||
module extrude_if(h, center = true) //! Extrudes 2D object to 3D when `h` is nonzero, otherwise leaves it 2D
|
||||
if(h)
|
||||
linear_extrude(h, center = center, convexity = 5) // 3D
|
||||
|
@@ -47,11 +47,11 @@ module offset_3D(r, chamfer_base = false) { //! Offset 3D shape by specified rad
|
||||
else
|
||||
if(r < 0)
|
||||
render() difference() {
|
||||
cube(inf / 2, center = true);
|
||||
cube(big / 2, center = true);
|
||||
|
||||
minkowski() {
|
||||
difference() {
|
||||
cube(inf, center = true);
|
||||
cube(big, center = true);
|
||||
|
||||
children();
|
||||
}
|
||||
|
@@ -52,6 +52,6 @@ module cylindrical_wrap(r, h = eps) { //! Wrap a 2D child extruded to height `h`
|
||||
translate([(sides / 2 - i) * -dx, 0])
|
||||
children();
|
||||
|
||||
square([dx, inf], center = true);
|
||||
square([dx, big], center = true);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user