2.3.3.1.6. Computational and Constructive Solid Geometry¶
Introduction¶
A set of base classes to describe the location and shape of objects using concepts from the fields of computer graphics, computational geometry, and constructive solid geometry (CSG).
Base Classes¶
The following base classes are defined to incentivize the use of NeXus for using computational-geometry-based descriptions. In what follows, base classes for frequently used shapes and geometric primitives are proposed:
- NXcg_primitive
Base class from which most other NXcg classes that define specific primitives inherit.
- NXcg_ellipsoid
A description for a set of possibly dissimilar oriented ellipsoids.
- NXcg_cylinder
A description for a set of possibly dissimilar oriented cylinders.
- NXcg_point
A collection of points with labels.
- NXcg_polyline:
A collection of lines and linear segments.
- NXcg_triangle
A collection of triangles.
NXcg_parallelogram A collection of possibly dissimilar parallelograms.
- NXcg_polygon
A collection of polygons.
- NXcg_polyhedron
A collection of polyhedra.
- NXcg_roi
A container to host a number of different types of primitives.
- NXcg_tetrahedron
A collection of tetrahedra.
- NXcg_hexahedron
A collection of hexahedra with capabilities to represent also simpler (bounding) boxes for e.g. binary trees.
An example how to use these classes follows:
1/entry1:NXentry
2 /reference_frame:NXcoordinate_system
3 /x = [1, 0, 0]
4 /y = [0, 1, 0]
5 /z = [0, 0, 1]
6 /unit_cube:NXcg_hexahedron
7 /is_axis_aligned = True
8 /hexahedron1:NXcg_face_list_data_structure
9 /@depends_on = "/entry1/reference_frame"
10 /number_of_vertices = 8
11 /vertices = [[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0],
12 [0., 0, 1], [1, 0, 1], [1, 1, 1], [0, 1, 1]]
These base classes describe data structures used for more complex geometries:
- NXcg_face_list_data_structure
In essence, the usual way how polygon/polyhedra data are reported: A list of vertices and faces with identifier and properties.
- NXcg_half_edge_data_structure
A half-edge data structure (also known as a doubly connected edge list) is a useful complementary descriptor for polygon/polyhedra which enables topological analyses and traversal of the graph of how polygons and polyhedra are connected.
- NXcg_unit_normal
As an additional structuring element especially for meshes, well-documented normal information is crucial for distance computations.
- NXcg_alpha_complex
Alpha shapes and alpha wrappings, specifically the special case of the convex hull, are frequently used geometrical models for describing a boundary or edge to a set of geometric primitives.
Next, a few base classes are defined for documenting discretized representations of material (area or volume) which can be useful not only for stencil-based methods:
- NXcg_grid
A grid of cells.
- NXisocontour
A description for isocontour descriptions.
- NXdelocalization
An approach to document procedures whereby a scalar field is smoothed in a controlled manner.
- NXsimilarity_grouping
A description for clustering of objects (such as atoms or features).
- NXrotations
A set of parameters to describe the relative orientation of members of a set of features/objects.