Navigation
API > API/Plugins > API/Plugins/TetMeshing > API/Plugins/TetMeshing/TIsosurfaceStuffing
Description
Edge and Point ID Packing Scheme: We use a bit-packing scheme to generate unique int64 IDs for grid points and canonical BCC edges. This is adapted from the scheme used by MarchingCubes.h, extended to handle the BCC grid's diagonals and center points.
Grid points are defined by an X,Y,Z and a bool indicating if they are centered. We assume the grid dimensions cannot exceed 2^15 on any axis, so we can pack grid points in the first 49 bits of an int64: 16 bits per X, Y, Z, and 1 bit for the bIsCenter flag. Edge IDs are given by one of the grid points bitwise or'd with a 'Tag' indicating the attached edge. To make sure each edge only has one possible ID, by convention, the grid point for an edge is chosen by these rules:
- If the edge is a 'long' BCC edge, along a major axis, use the grid point with the lowest coordinates.
- Otherwise, for 'short' BCC edges, connecting centered to non-centered points, always use the centered point. Edge tags are numbered as follows:
- 1,2,3 for the long edges along the X,Y,Z axes respectively, as returned by GetMajorAxisEdgeTag.
- 4-11 for the short edges, as returned by GetCornerEdgeTag(Difference in coordinates). (Note that the coordinate difference from center->corner is always 0 or 1 in each dimension.) The tag number is bit-shifted by 50 to safely combine with the Point ID.
In sum, the bits of an Edge ID are laid out as: [Bits 53-50: 'Tag' indicating which edge] [Bits 48-0: Point ID for a grid point attached to the edge] And Point ID is laid out as: [Bit 48: bIsCenter flag] [Bits 47-32: Z coord] [Bits 31-16: Y coord] [Bits 15-0: X coord]
| Name | GetMajorAxisEdgeTag |
| Type | function |
| Header File | /Engine/Plugins/Experimental/TetMeshing/Source/TetMeshing/Public/Generate/IsosurfaceStuffing.h |
| Include Path | #include "Generate/IsosurfaceStuffing.h" |
static int64 GetMajorAxisEdgeTag
(
int64 Axis
)