Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
cartesian-theatrics committed Dec 25, 2024
1 parent 5b15c01 commit 428c5f0
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion src/cljc/clj_manifold3d/core.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -1111,6 +1111,36 @@ to the interpolated surface according to their barycentric coordinates."
(aget halfedges (+ idx 2))
(aget halfedges (+ idx 3))))))))))

#?(:clj
(defn get-vertices
"Get vertices of `man`."
[man]
(let [^floats vertices (.toFloatArray (.getVertices ^Manifold man))]
(loop [idx 0
ret (transient [])]
(if (>= idx (alength vertices))
(persistent! ret)
(recur
(+ idx 3)
(conj! ret [(aget vertices idx)
(aget vertices (+ idx 1))
(aget vertices (+ idx 2))])))))))

#?(:clj
(defn get-triangles
"Get triangles of `man`."
[man]
(let [^ints triangles (.toIntArray (.getTriangles ^Manifold man))]
(loop [idx 0
ret (transient [])]
(if (>= idx (alength triangles))
(persistent! ret)
(recur
(+ idx 3)
(conj! ret [(aget triangles idx)
(aget triangles (+ idx 1))
(aget triangles (+ idx 2))])))))))

#?(:clj
(defn get-face-normals [man]
(let [face-normals (.toFloatArray (.getFaceNormals ^Manifold man))]
Expand Down Expand Up @@ -1183,10 +1213,17 @@ to the interpolated surface according to their barycentric coordinates."
(-> (DoubleMat2x3/I))

(-> (tetrahedron)
(get-halfedges))
(.getTriangles)
(.toIntArray))

(seq (.getColumn m 3))

(sphere 50 100)
(loft [(square 30 30 true)
(circle 15 100)]
[(frame)
(translate (frame) [0 0 30])])

(def property (load-image "property_lines.png" 100.0))

(-> (hull (cylinder 10 100)
Expand Down

0 comments on commit 428c5f0

Please sign in to comment.