Skip to content

Commit

Permalink
fix slices example code
Browse files Browse the repository at this point in the history
  • Loading branch information
cartesian-theatrics committed Oct 22, 2024
1 parent 09df6ce commit 7037793
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,14 @@ Slice solves for the cross-section of a manifold that intersects the x/y plane.
There is an efficient aglorithm that solves for N equally spaces slices.

``` clojure
(-> (for [[i slice] (map-indexed vector (slices (scale (tetrahedron) [5 10 15]) 5 10 10))]
(-> slice
(translate [0 0 (* i 0.5)])))
(extrude 1/2))
(-> (union
(for [[i slice] (map-indexed vector (slices (scale (tetrahedron) [5 10 15]) 5 10 10) )]
(-> slice
(extrude 1/8)
(translate [0 0 (* i 0.5)]))))
(get-mesh)
(export-mesh "slices.glb" :material mesh-material))

```

![Slices](resources/images/slices.png)
Expand Down

0 comments on commit 7037793

Please sign in to comment.