Skip to main content

symmetry_plane

Function symmetry_plane 

Source
pub fn symmetry_plane(
    points: &[Point],
    normals: &[Vector],
    target: &Bvh,
    seeds: &[Plane],
    opts: &Icp,
) -> OgeomResult<SymmetryFit>
Expand description

The plane the points are the mirror image of the mesh target was built over in, from each of seeds, the best scored.

From a seed, each round reflects the samples in the plane, registers the reflection back onto the mesh from where it lies (as icp does from the identity, whatever Icp::starts says), and bisects each kept sample and its registered image: the new plane’s normal is the direction the samples’ displacements to their images share (the eigenvector of the largest eigenvalue of the sum of their outer products, in the sense of the old normal), and it passes through the mean of their midpoints. Where the reflection in a plane registers with no motion the plane bisects every sample and its image already, so the rounds stop once a round moves no sample’s reflection further than the confusion distance, or after Icp::max_iter rounds.

The seeds are ranked by the capped mean distance to the mesh of every sample reflected in the plane each ends at, ties going to the earlier seed; SymmetryFit::rms is the RMS of the kept ones’. normals, one per point, are reflected with them and used only for a facing limit.

§Errors

As Icp::check; OgeomError::Domain for no points, a point not finite, an empty mesh or no seeds; OgeomError::Dimension for normals not one per point.