(coll-bounds coll)
Takes a seq of shape entities, calls g/bounds on each and returns union bounds. Does not support collections of mixed 2d/3d entities.
Takes a seq of shape entities, calls g/bounds on each and returns union bounds. Does not support collections of mixed 2d/3d entities.
(fit-all-into-bounds bounds coll)
Takes an AABB or rect and seq of shapes, proportionally scales and repositions all items to fit into given bounds. Returns lazyseq of transformed entities. Does not support collections of mixed 2D/3D entities. Use rects as target bounds for 2D colls.
Takes an AABB or rect and seq of shapes, proportionally scales and repositions all items to fit into given bounds. Returns lazyseq of transformed entities. Does not support collections of mixed 2D/3D entities. Use rects as target bounds for 2D colls.
(into-mesh mesh add-face mesh-or-faces)
Takes a target mesh, its add-face fn and a source mesh or face sequence. Adds faces to target mesh and returns it.
Takes a target mesh, its add-face fn and a source mesh or face sequence. Adds faces to target mesh and returns it.
(map-bilinear [a b c d] [u v])
Takes a seq of 4 points in ccw order and 2D vector of normalized UV coordinates. Applies bilinear interpolation to compute point within the rect: U is coord along AB/DC edge, V along BC/AD
Takes a seq of 4 points in ccw order and 2D vector of normalized UV coordinates. Applies bilinear interpolation to compute point within the rect: U is coord along AB/DC edge, V along BC/AD
(map-mesh f mesh)
Applies f to all faces of given mesh and adds resulting faces to new mesh. Thus f should return a seq of raw faces (i.e. each face as 2-elem vector of [verts attribs]. Returns new mesh.
Applies f to all faces of given mesh and adds resulting faces to new mesh. Thus f should return a seq of raw faces (i.e. each face as 2-elem vector of [verts attribs]. Returns new mesh.
(map-trilinear [a b c d e f g h] [u v w])
Takes a seq of 8 points defining a cuboid and vector of normalized UVW coordinates. Applies trilinear interpolation to compute point within the cuboid: U is coord along AD/BC edge, V along AE/BF, W along AB/DC (see above diagram)
Takes a seq of 8 points defining a cuboid and vector of normalized UVW coordinates. Applies trilinear interpolation to compute point within the cuboid: U is coord along AD/BC edge, V along AE/BF, W along AB/DC (see above diagram)
(point-at-index points t)
Takes a seq of points and normalized index (0.0 .. 1.0), returns interpolated point at position t.
Takes a seq of points and normalized index (0.0 .. 1.0), returns interpolated point at position t.
(transform-mesh mesh add-face tx)
Takes a mesh, its add-face fn and a vertex transformation fn. Transforms all mesh vertices and returns new mesh.
Takes a mesh, its add-face fn and a vertex transformation fn. Transforms all mesh vertices and returns new mesh.
(triangle-barycentric-coords [a b c] p)
(triangle-barycentric-coords a b c p)
(triangle-barycentric-coords a b c p u v)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close