The main mesh type, stored as vertices and triangles. Contains methods to compute normals, curvatures, apparent ridges, etc.
Constructor
Variables
Dt1q1:Array<Float> = []
"D_{t_1} q_1
- the derivative of max view-dependent curvature
in the principal max view-dependent curvature direction." -- RTSC
Methods
apparentRidges(eye:Vec3, thresh:Float):Array<Ridge>
Find apparent ridges (3D)
Use Render.apparentRidges()
instead for 2D projections.
Parameters:
eye | view position |
---|---|
thresh | threshold value |
Returns:
an array of ridges
See also:
computeBVH():Void
Compute the bounding volume hierarchy of the mesh using default parameters. A simple wrapper around BVHTree class's more customizable constructor
computeBVHTrivial():Void
Generate a "trivial" BVH (bounding volume hierarchy), containing all the faces at the root node. This is a placeholder in situations where BVH is not actually necessary
Parameters:
eye | view position |
---|---|
thresh | threshold value |
computeFeatureSize():Void
"Compute a 'feature size' for the mesh: computed as 1% of the reciprocal of the 10-th percentile curvature" -- RTSC
computeNormals():Void
"Compute per-vertex normals Uses average of per-face normals, weighted according to: Max, N. 'Weights for Computing Vertex Normals from Facet Normals,' Journal of Graphics Tools, Vol. 4, No. 2, 1999." -- Trimesh2
computePointAreas():Void
"Compute the area 'belonging' to each vertex or each corner of a triangle (defined as Voronoi area restricted to the 1-ring of a vertex, or to the triangle)." -- Trimesh2
getFaceEdges(f:Face):Vector<Vec3>
Get the three edges from a face
Parameters:
face | the face |
---|
Returns:
3 vectors representing direction and length of each edge
precompute(doBVH:Bool = true, verb:Bool = false):Void
Call necessary pre-computations of mesh properties for computing
apparent ridges, in this order:
normals, point-areas, adjacent-faces, curvatures, bounding sphere,
feature size, bounding volume hierarchy.
Alternatively, you can call the computeXxxxx()
methods directly for
a more customized set of things to compute, but since some of them
depend on another so be careful of the order.
Parameters:
doBVH | whether to compute the bounding volume hiarchy, only necessary for hiding occluded ridges |
---|---|
verb | verbose: log progress |
visible(eye:Vec3, p:Vec3, tolerance:Float = 2):Bool
Check if a point in space is not occluded by the mesh
Parameters:
eye | view position |
---|---|
p | the point in question |
tolerance | a multiplier to the "epsilon", allowing only barely occluded points to pass the test. The epsilon is also a function of the mesh size (bsphere) and detail (number of faces) |
Returns:
true if visible, false if invisible