Class SymmetryVisitorMesh

java.lang.Object
cz.fidentis.analyst.engines.symmetry.SymmetryVisitor
cz.fidentis.analyst.engines.symmetry.impl.SymmetryVisitorMesh
All Implemented Interfaces:
MeshVisitor

public class SymmetryVisitorMesh extends SymmetryVisitor
A old implementation of the symmetry plane estimator taken from the old FIDENTIS. Conceptually, it is similar to the SymmetryVisitorRobustMesh. It also uses Gaussian curvature and normal vectors to prune candidate planes and measure their quality. But some additional criteria are used as well. Also, the calculation of "votes" differs. This implementation has the following properties:
  • Fast. A bit faster than the new robust algorithms of SymmetryVisitorRobust and much faster that the SymmetryVisitorRobustMesh.
  • Best candidate planes are chosen based on the similarity of Gauss curvatures on both sides of the plane, inverse direction of normal vectors, and the distance of plane from centroid.
  • Because the space of candidate planes is roughly approximated (several true-false rules), the final symmetry plane is computed by averaging best candidates (candidates with the most votes).
  • Best results are achieved with Uniform Grid sampling with 200-300 points and averaging turn on.
  • Should return reasonable results also for incomplete faces (was not tested).

This visitor is not thread-safe, i.e., a single instance of the visitor cannot be used to inspect multiple meshes simultaneously (sequential inspection is okay). It because the underlying visitors may not be thread-safe.

The main symmetry plane computation is performed by the getSymmetryPlane() method, not the visitMeshFacet(MeshFacet).

  • Field Details

    • MAX_REL_DISTANCE

      public static final double MAX_REL_DISTANCE
      See Also:
    • AVERAGING

      public static final boolean AVERAGING
      If true, then the final symmetry plane is computed by averaging the best candidates. If false, then the random top candidate is selected.
      See Also:
  • Constructor Details

    • SymmetryVisitorMesh

      public SymmetryVisitorMesh(PointSamplingConfig samplingStrategy)
      Constructor.
      Parameters:
      samplingStrategy - Sub-sampling strategy. Must not be null
      Throws:
      IllegalArgumentException - if some input parameter is missing
  • Method Details

    • isThreadSafe

      public boolean isThreadSafe()
      Description copied from interface: MeshVisitor
      Returns true if the implementation is thread-safe and then a single visitor instance can be applied to multiple mesh facets simultaneously.

      Thread-safe implementation means that any read or write from/to the visitor's state is protected by synchronized.

      Returns:
      true if the implementation is thread-safe.
    • visitMeshFacet

      public void visitMeshFacet(MeshFacet facet)
      Description copied from interface: MeshVisitor
      The inspection method to be implemented by specific visitors.
      Parameters:
      facet - Mesh facet to be visited.
    • getSymmetryPlane

      public Plane getSymmetryPlane()
      Description copied from class: SymmetryVisitor
      Returns a symmetry plane.
      Specified by:
      getSymmetryPlane in class SymmetryVisitor
      Returns:
      a symmetry plane or null
    • dispose

      public void dispose()
      Description copied from interface: MeshVisitor
      Dispose all disposable resources this visitor was using. Distances can still be retrieved after calling this method. Subclasses should override this method if they need to dispose something.
    • getSymmetryPlane

      public Plane getSymmetryPlane(boolean concurrently)
      Computes and returns the symmetry plane. The plane is computed only once, then the same instance is returned.
      Parameters:
      concurrently - If true, then parallel computation is used utilizing all CPU cores.
      Returns:
      the symmetry plane or null
    • calculateSymmetryPlane

      protected void calculateSymmetryPlane(boolean concurrently)
      Calculates the symmetry plane.
      Parameters:
      concurrently - If true, then parallel computation is used utilizing all CPU cores. Otherwise, the computation is sequential.
    • checkAndUpdatePlanes

      protected int checkAndUpdatePlanes(List<CandidatePlaneMesh> planes, CandidatePlaneMesh newPlane, int maxVotes)
    • setSymmetryPlane

      protected void setSymmetryPlane(List<CandidatePlaneMesh> planes)