1
0
mirror of https://github.com/nophead/NopSCADlib.git synced 2025-08-06 07:27:23 +02:00

Added convexity parameter to clip().

This commit is contained in:
Chris Palmer
2022-06-14 15:13:21 +01:00
parent eda88cc8d7
commit 18f3d43780
2 changed files with 3 additions and 3 deletions

View File

@@ -6883,7 +6883,7 @@ Original version by Doug Moen on the OpenSCAD forum
| Module | Description | | Module | Description |
|:--- |:--- | |:--- |:--- |
| `box(xmin, ymin, zmin, xmax, ymax, zmax)` | Construct a box given its bounds | | `box(xmin, ymin, zmin, xmax, ymax, zmax)` | Construct a box given its bounds |
| `clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf)` | Clip child to specified boundaries | | `clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf, convexity = 1)` | Clip child to specified boundaries |
![clip](tests/png/clip.png) ![clip](tests/png/clip.png)

View File

@@ -41,8 +41,8 @@ module box(xmin, ymin, zmin, xmax, ymax, zmax) //! Construct a box given its bou
[0,2,3,1]] // left [0,2,3,1]] // left
); );
module clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf) //! Clip child to specified boundaries module clip(xmin = -inf, ymin = -inf, zmin = -inf, xmax = inf, ymax = inf, zmax = inf, convexity = 1) //! Clip child to specified boundaries
render() intersection() { render(convexity = convexity) intersection() {
children(); children();
box(xmin, ymin, zmin, xmax, ymax, zmax); box(xmin, ymin, zmin, xmax, ymax, zmax);