Metrics for TriMesh and PointCloud

sample_points(m::TriMesh, num_samples::Int=5000; returns_normals::Bool=false, eps::Number = 1e-6)

Uniformly samples num_samples points from the surface of TriMesh m.

returns_normals is optional keyword argument, to returns normals from respective faces of samples. eps is optional keyword argument for a small number to prevent division by zero for small surface areas.


julia> m = load_trimesh("teapot.obj")
julia> points = sample_points(m, 5000)
julia> points, normals = sample_points(m, 5000; returns_normals=true)
edge_loss(m::TriMesh, target_length::Number = 0.0)

Computes mean edge length in TriMesh.

target_length is the optional arguments for computing edge length.


Computes the laplacian smoothning metrics for TriMesh m

chamfer_distance(A::PointCloud, B::PointCloud; w1=1.0, w2=1.0)

Computes the chamfer distance between PointCloud A and B.

w1 and w2 are optional arguments for specifying the weighted mean of between two pcloud for computing metrics.