Skip to content

Commit

Permalink
[meshops] [svg] [voxel] update ref's to mesh.io ns in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Oct 10, 2015
1 parent ea05fd7 commit d467ec1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions geom-meshops/src/meshio.org
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
** Stream wrappers

#+BEGIN_SRC clojure :noweb-ref wrappers
(def output-stream
(def wrapped-output-stream
"Alias for thi.ng.dstruct.streams/output-stream"
streams/output-stream)

(def input-stream
(def wrapped-input-stream
"Alias for thi.ng.dstruct.streams/input-stream"
streams/input-stream)
#+END_SRC
Expand Down
2 changes: 1 addition & 1 deletion geom-meshops/src/polyhedra.org
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ returns either a =BasicMesh= or =GMesh= instance.
(with-open [o (io/output-stream "icosphere.stl")]
(->> (poly/polyhedron-mesh poly/icosahedron sd/catmull-clark 1 3)
(g/tessellate)
(mio/write-stl o)))
(mio/write-stl (mio/wrapped-output-stream o))))
#+END_SRC

[[http://media.thi.ng/geom/mesh/icosphere.svg]]
Expand Down
2 changes: 1 addition & 1 deletion geom-meshops/src/slicing.org
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
(it/interval-tree median faces)))

(defn save-mesh
[m] (with-open [o (io/output-stream "p.ply")] (mio/write-ply o m)))
[m] (with-open [o (io/output-stream "p.ply")] (mio/write-ply (mio/wrapped-output-stream o) m)))

#+END_SRC

Expand Down
6 changes: 5 additions & 1 deletion geom-svg/src/examples.org
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ is defined in its own namespace and can be loaded from the REPL via:

(def mesh
(with-open [in (io/input-stream "../../assets/suzanne.stl")]
(-> (mio/read-stl in) (g/center) (g/scale 0.85))))
(-> in
(mio/wrapped-input-stream)
(mio/read-stl)
(g/center)
(g/scale 0.85))))

(defn render-svg
[path mesh mvp width height]
Expand Down
12 changes: 9 additions & 3 deletions geom-voxel/src/examples.org
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ This is a render of the voxel mesh generated with the code below:

(time
(with-open [o (io/output-stream "voxel.stl")]
(mio/write-stl o (g/tessellate (iso/surface-mesh v4 11 0.5)))))
(mio/write-stl
(mio/wrapped-output-stream o)
(g/tessellate (iso/surface-mesh v4 11 0.5)))))
#+END_SRC

** Example: Sphere erosion
Expand Down Expand Up @@ -114,7 +116,9 @@ This is a render of the voxel mesh generated with the code below:

(time
(with-open [o (io/output-stream "sphere.stl")]
(mio/write-stl o (g/tessellate (iso/surface-mesh v 10 0.5)))))
(mio/write-stl
(mio/wrapped-output-stream o)
(g/tessellate (iso/surface-mesh v 10 0.5)))))
#+END_SRC

** Example: 3D Simplex Noise
Expand All @@ -140,5 +144,7 @@ This is a render of the voxel mesh generated with the code below:

(time
(with-open [o (io/output-stream "noise.stl")]
(mio/write-stl o (g/tessellate (iso/surface-mesh v 10 iso-val)))))
(mio/write-stl
(mio/wrapped-output-stream o)
(g/tessellate (iso/surface-mesh v 10 iso-val)))))
#+END_SRC

0 comments on commit d467ec1

Please sign in to comment.