Skip to content

Commit

Permalink
load-image
Browse files Browse the repository at this point in the history
  • Loading branch information
cartesian-theatrics committed Nov 30, 2024
1 parent 667456d commit 5a6075f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
4 changes: 2 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

:clj-dev
{:extra-deps {badigeon/badigeon {:mvn/version "1.7"}
org.clojars.cartesiantheatrics/manifold3d$linux-x86_64 {:mvn/version "1.0.88"}
;; {:local/root "../manifold/bindings/java/target/manifold3d-1.0.39.jar"}
org.clojars.cartesiantheatrics/manifold3d$linux-x86_64 {:mvn/version "1.0.89"}
#_{:local/root "../manifold/bindings/java/target/manifold3d-1.0.39.jar"}

jme-clj/jme-clj {:mvn/version "0.1.13"}
com.github.stephengold/Heart {:mvn/version "9.1.0"}}
Expand Down
27 changes: 17 additions & 10 deletions src/cljc/clj_manifold3d/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@
#?(:clj
(defn ply-file-to-surface
"Load a ply file and convert it to a rectangular heat map."

([filepath]
(MeshUtils/PlyToSurface filepath 10.0 20.0 304.8))
([filepath cell-size]
Expand All @@ -215,6 +216,13 @@
([filename pixel-width]
(MeshUtils/CreateSurface filename pixel-width))))

#?(:clj
(defn load-image
([filename depth]
(MeshUtils/LoadImage filename depth))
([filename depth pixel-width]
(MeshUtils/LoadImage filename depth pixel-width))))

(defn cube
"Creates a cube with specified dimensions.
Expand Down Expand Up @@ -1140,17 +1148,16 @@ to the interpolated surface according to their barycentric coordinates."

(comment

(while true
(let [mesh (get-mesh (cube [10 10 10] true))
verts (.triVerts mesh)]
(System/gc)
(doall(eduction
(map (fn [idx]
[(.x idx)
(.y idx)
(.z idx)]))
verts))))
(def property (load-image "property_lines.png" 100.0))

(project property)

(-> property
(mirror [0 1 0])
(center)
(project)
(get-mesh-gl)
(export-mesh "property.glb" :material (material :metalness 0.0 :roughness 0.0 :color-channels [3 4 5 -1])))


)

0 comments on commit 5a6075f

Please sign in to comment.