Reference/API

PMesh.nearestfaceMethod
g = triangulated(geometry(mesh, x))
pl = pointlocation(g)

d, f, λ = nearestface(pl, y)

Given querypoint y, compute distance d to mesh, with the projection point in face f at barycentric cooordinates λ.

For an planar mesh in 2d, d is zero if y is within the triangulation. If y is outside, λ specifies a point on a boundary edge.

requires

The mesh must not have changed sicne calling pointlocation

See also geometry, triangulated, nearestvertex, nearest, projection

source
PMesh.pointlocationMethod
pl = pointlocation(g[; maxpoints, maxdepth])

d, f, λ = nearestface(pl, y)
d, v = nearestvertex(pl, y)

py = projection(pl, y)

The implementation uses DistanceQueries.

This method takes a "snapshot" of the geometry that is stored independently of the mesh in a kd-tree.

Warning

Handles returned by nearestvertex and nearestface become invalid if the mesh changes after calling pointlocation.

Note

Consider using compact, i.e., ensure iscontiguous before calling pointlocation!

See also geometry, triangulated, nearestface, nearestvertex, nearest, projection

source
PMesh.remesh!Function
remesh!(mesh[, len=meanedgelength(mesh);
        k=32, pos=:x, vnrm=:n, fnrm=:n, farea=:a)

Apply k iterations of isotropic remeshing (w/o projection onto the mesh).

Warning

This method is intended only for tests and benchmarks!

source
PMesh.@mt_strMacro
mt"3NT" === PMesh.Types.MESH3NT

Generate mesh template (type) from string literal.

source