Metrics for TriMesh and PointCloud
Flux3D.sample_points
— Functionsample_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.
Examples:
julia> m = load_trimesh("teapot.obj")
julia> points = sample_points(m, 5000)
julia> points, normals = sample_points(m, 5000; returns_normals=true)
Flux3D.edge_loss
— Functionedge_loss(m::TriMesh, target_length::Number = 0.0)
Computes mean edge length in TriMesh.
target_length
is the optional arguments for computing edge length.
Flux3D.laplacian_loss
— Methodlaplacian_loss(m::TriMesh)
Computes the laplacian smoothning metrics for TriMesh m
Flux3D.chamfer_distance
— Methodchamfer_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.