Class PoissonDiskSubSamplingGPU

All Implemented Interfaces:
MeshVisitor, PointSamplingVisitor

public class PoissonDiskSubSamplingGPU extends PoissonDiskSubSampling
This implementation overrides PoissonDiskSubSampling sample generation to use GPU-based Ray Casting algorithm implemented in OpenCl. Each instance creates new OpenCL context and is responsible for it's disposing before destruction.
  • Field Details

    • PROJECTOR_MAX_ANGLE

      public static final double PROJECTOR_MAX_ANGLE
      See Also:
    • PROJECTOR_MIN_ROTATION

      public static final double PROJECTOR_MIN_ROTATION
      See Also:
    • MIN_PROJECTION_ITERATIONS

      public static final int MIN_PROJECTION_ITERATIONS
      See Also:
  • Constructor Details

    • PoissonDiskSubSamplingGPU

      public PoissonDiskSubSamplingGPU(int max, MeshTriangle.Smoothing smoothing)
      Constructor for the maximum number of samples. The density (minimal distance between samples) is approximated so that the mean absolut percentage error (MAPE) of this approximation is ~ 5.27%, and the median absolute percentage error (MDAPE) is ~ 4.52%.
      Parameters:
      max - Required number of samples. Must be bigger than zero
      smoothing - Surface samples can be equipped by interpolated normal and or adapted position to interpolate surface curvature. Use Smoothing.NONE to simply get samples from triangle planes without normal vectors.
      Throws:
      IllegalArgumentException - if the input parameter is wrong
  • Method Details

    • getSamples

      public List<MeshPoint> getSamples()
      Description copied from interface: PointSamplingVisitor
      Returns a list of vertices reduced according to the strategy. The returned mesh points are backed by original points.
      Specified by:
      getSamples in interface PointSamplingVisitor
      Overrides:
      getSamples in class PoissonDiskSubSampling
      Returns:
      selected vertices of inspected meshes
    • toString

      public String toString()
      Overrides:
      toString in class PoissonDiskSubSampling
    • 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.