Class MeshDistanceRC

java.lang.Object
cz.fidentis.analyst.engines.distance.impl.MeshDistanceVisitorImpl
cz.fidentis.analyst.engines.distance.impl.MeshDistanceRC
All Implemented Interfaces:
MeshVisitor, MeshDistanceVisitor, Serializable

public class MeshDistanceRC extends MeshDistanceVisitorImpl
This visitor searches for the closest points of the primary mesh (provided to the constructor) and inspected meshes by casting rays (RC) in the direction of normal vectors on the inspected mesh.

This visitor is instantiated with a single octree (either given as the input parameter, or automatically created from the triangular mesh). When applied to other mesh facets, it finds points from the octree that are the closest to each point of the inspected mesh.

This visitor is thread-safe, i.e., a single instance of the visitor can be used to inspect multiple meshes simultaneously.

The distance is computed either as absolute or relative. Absolute represents Euclidean distance (all numbers are positive). On the contrary, relative distance considers orientation of the visited mesh (determined by its normal vectors) and produces positive or negative distances depending on whether the primary mesh is "in front of" or "behind" the given vertex.

See Also:
  • Constructor Details

    • MeshDistanceRC

      public MeshDistanceRC(Octree mainOctree, boolean relativeDistance, boolean parallel)
      Constructor.
      Parameters:
      mainOctree - An octree to which distance from the visited facets is to be computed. Must not be null
      relativeDistance - If true, then the visitor calculates the relative distances with respect to the normal vectors of source facets (normal vectors have to present), i.e., we can get negative distances.
      parallel - If true, then the algorithm runs concurrently utilizing all CPU cores
      Throws:
      IllegalArgumentException - if some parameter is wrong
  • Method Details

    • visitMeshFacet

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

      protected void updateResults(RayIntersectionVisitor vis, List<Double> distList, List<MeshPoint> nearestPointsList)