Internals
The internals of Meshing have been optimized for performance and to be generic. This is some brief documentation on the basic internal functions.
Common
Meshing._DEFAULT_SAMPLES
— Constant._DEFAULT_SAMPLES = (24,24,24)
Global default sampling count for functions.
Meshing._get_cubeindex
— Function._get_cubeindex(iso_vals, iso)
given iso_vals
and iso, return an 8 bit value corresponding to each corner of a cube. In each bit position, 0 indicates in the isosurface and 1 indicates outside the surface, where the sign convention indicates negative inside the surface
Meshing._get_cubeindex_pos
— Function._get_cubeindex_pos(iso_vals, iso)
given iso_vals
and iso, return an 8 bit value corresponding to each corner of a cube. In each bit position, 0 indicates in the isosurface and 1 indicates outside the surface, where the sign convention indicates positive inside the surface
Meshing._determine_types
— Function.determinetypes(meshtype, fieldtype=Float64, facelen=3)
Given a subtype of AbstractMesh, determine the type of vertex/point and face to use for internal computations.
Preference is given to the types specified by the Mesh call, and will default to the FieldType
for SignedDistanceField
, and Point{3,Float64}/Face{3,Int} for direct function sampling.
Marching Cubes
Meshing._mc_create_triangles!
— Function._mc_create_triangles!(vts, fcs, vertlist, cubeindex, FaceType)
Create triangles by adding every point within a triangle to the vertex vector.
Meshing._mc_unique_triangles!
— Function._mc_unique_triangles!(vts, fcs, vertlist, cubeindex, FaceType)
Create triangles by only adding unique vertices within the voxel. Each face may share a reference to a vertex with another face.
Meshing.find_vertices_interp
— Function.find_vertices_interp(points, iso_vals, cubeindex, iso, eps)
Find the vertices where the surface intersects the cube
Meshing.vertex_interp
— Function.vertex_interp(iso, p1, p2, valp1, valp2, eps = 0.00001)
Linearly interpolate the position where an isosurface cuts an edge between two vertices, each with their own scalar value
Meshing.mc_vert_points
— Function.mc_vert_points(xi,yi,zi, scale, origin, ::Type{VertType})
Returns a tuple of 8 points corresponding to each corner of a cube
Marching Tetrahedra
Voxel corner and edge indexing conventions
Z

556 Extra edges not drawn
/ / 
8  6   face diagonals
/ 9 / 10  13: 1 to 3
877   14: 1 to 8
     15: 1 to 6
 112  Y  16: 5 to 7
12 / 11 /  17: 2 to 7
 4  2  18: 4 to 7
/ /  body diagonal
433  19: 1 to 7
/
X
Missing docstring for Meshing._correct_vertices!
. Check Documenter's build log for details.
Meshing.procVox
— Function.procVox(vals, iso::Real, x, y, z, nx, ny,
vts::Dict, vtsAry::Vector, fcs::Vector,
eps::Real)
Processes a voxel, adding any new vertices and faces to the given containers as necessary.
Meshing.voxEdgeId
— Function.voxEdgeId(subTetIx, tetEdgeIx)
Given a subtetrahedron case and a tetrahedron edge ID, determines the corresponding voxel edge ID.
Meshing.getVertId
— Function.getVertId(e, x, y, z, nx, ny,
vals, iso::Real,
vts::Dict,
vtsAry::Vector,
eps::Real)
Gets the vertex ID, adding it to the vertex dictionary if not already present.
Meshing.vertPos
— Function.vertPos(e, x, y, z, vals::NTuple{8,T}, iso::Real, eps::Real, ::Type{VertType}) where {T<:Real, VertType}
Assuming an edge crossing, determines the point in space at which it occurs. eps represents the "bump" factor to keep vertices away from voxel corners (thereby preventing degeneracies).
Meshing.vertId
— Function.vertId(e, x, y, z, nx, ny)
Determines a unique integer ID associated with the edge. This is used as a key in the vertex dictionary. It needs to be both unambiguous (no two edges get the same index) and unique (every edge gets the same ID regardless of which of its neighboring voxels is asking for it) in order for vertex sharing to be implemented properly.
Meshing.tetIx
— Function.tetIx(tIx, cubeindex)
Determines which case in the triangle table we are dealing with