Data¶
In 3D data visualization, we distinguish two types of 3D data: 3D geometry and data associated with 3D geometry.
- 3D geometry as data: In this category, we are mainly interested in visualizing the shape/location of the 3D geometry. For example, the shape of a deformed mesh or the location of points in a point cloud.
- Data associated with 3D geometry: In this category, the data is a spatially varying field, and we would like to visualize its value at different locations. For example, the Gaussian curvature field on a curved surface, or the geodesic distance on a surface with respect to a source surface point.
3D geometry are often represented as a mesh for visualization purposes. A mesh, such as the bunny model on the right1, consists of a set of vertices edges and facets. Data associated with 3D geometry are represented as an attribute of a mesh. Each attribute is defined for a specific element type (vertex, edge or facet).
In Hakowan, we leverage Lagrange's SurfaceMesh data structure to represent both 3D geometry and store data associated with 3D geometry as mesh attributes. In a sense, the elements of a mesh defines the "rows" of a 3D data frame, and the attributes of a mesh defines the "columns" of a 3D data frame. In addition, Hakowan can also extract geometry and data associated with geometry from a number of common 3D file formats such as OBJ, PLY, GLTF and MSH.
Here is a quick example demonstrating the various ways of specifying data in Hakowan:
# As argument to hkw.layer() method.
l0 = hkw.layer("shape.obj")
# As argument to .data overwrite function.
l1 = hkw.layer().data("shape.obj")
# Lagrange SurfaceMesh object can also be used instead of filename.
mesh = lagrange.io.load_mesh("shape.obj")
l2 = hkw.layer(mesh)
l3 = hkw.layer().data(mesh)
See the Mesh Deformation example for a use case of reusing the same layer specification with different data fields.
Region of interest¶
When we specifying the data, we can optionally specify a region of interest. The region of interest is an axis-aligned box that defines the region in the center of the rendering.
See the Smoothed Particle Hydrodynamics example for a usage of region of interest.
-
3D model source: origamix rabbit ↩