From d467ec1f4692fa9d84a1baed13d727586a9a8451 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Sat, 10 Oct 2015 21:58:51 +0100 Subject: [PATCH] [meshops] [svg] [voxel] update ref's to mesh.io ns in examples --- geom-meshops/src/meshio.org | 4 ++-- geom-meshops/src/polyhedra.org | 2 +- geom-meshops/src/slicing.org | 2 +- geom-svg/src/examples.org | 6 +++++- geom-voxel/src/examples.org | 12 +++++++++--- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/geom-meshops/src/meshio.org b/geom-meshops/src/meshio.org index 78819f65..2c34c6f7 100644 --- a/geom-meshops/src/meshio.org +++ b/geom-meshops/src/meshio.org @@ -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 diff --git a/geom-meshops/src/polyhedra.org b/geom-meshops/src/polyhedra.org index 5fd45d86..1f31b96e 100644 --- a/geom-meshops/src/polyhedra.org +++ b/geom-meshops/src/polyhedra.org @@ -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]] diff --git a/geom-meshops/src/slicing.org b/geom-meshops/src/slicing.org index 1e216111..f7807484 100644 --- a/geom-meshops/src/slicing.org +++ b/geom-meshops/src/slicing.org @@ -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 diff --git a/geom-svg/src/examples.org b/geom-svg/src/examples.org index 2f5ea2fd..3dd879be 100644 --- a/geom-svg/src/examples.org +++ b/geom-svg/src/examples.org @@ -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] diff --git a/geom-voxel/src/examples.org b/geom-voxel/src/examples.org index 84472456..73fb55a3 100644 --- a/geom-voxel/src/examples.org +++ b/geom-voxel/src/examples.org @@ -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 @@ -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 @@ -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