Module simpa.core

Class LocalFramesCalculator

java.lang.Object
simpa.core.api.utils.LocalFramesCalculator

public class LocalFramesCalculator extends Object
Calculator class to define local frames along a curve. It uses a parallel transport algorithm. An initial vector is parallel transported along a general 3D curve. It can optimize an initial vector if the OPTIMIZE_TORSION strategy is selected or uses the given one when the PARALLEL_TRANSPORT_WITHOUT_OPTIMIZATION strategy is selected. For the algorithm of the parallel transport See: Parallel Transport Approach to Curve Framing Andrew J. Hanson and Hui Ma https://legacy.cs.indiana.edu/ftp/techreports/TR425.pdf
Author:
lbojtar
  • Field Details

    • DEFAULT_STRATEGY

      public static final LocalFramesCalculator.Strategy DEFAULT_STRATEGY
    • DEFAULT_VERTICAL

      public static final org.apache.commons.math3.geometry.euclidean.threed.Vector3D DEFAULT_VERTICAL
  • Constructor Details

    • LocalFramesCalculator

      public LocalFramesCalculator(List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> curve, boolean closed, LocalFramesCalculator.Strategy strategy, org.apache.commons.math3.geometry.euclidean.threed.Vector3D vertical)
      Constructor for LocalFramesCalculator.
      Parameters:
      curve - A curve in 3D.
      closed - Closed or open indicator. If closed the last point in the list considered connected to the first one.
      strategy - Strategy to optimize the initial vector. It determines how the local frame is constructed.
      vertical - Preferred vertical direction. It can be null, in this case by default it is the +Y global axis. There are two optimal initial orientation which minimizes the torsion of a planar curve. By setting this vector one can be chosen. The preferred vertical direction should be perpendicular to the first tangent vector of the curve.
  • Method Details

    • writeToFile

      public void writeToFile(String file, int increment)
      Writes the reference frame unit vectors into a file
      Parameters:
      file - Output file.
      increment - Increment of steps while sampling the curve. The value 1 takes all the curve points, 2 every second, 3 every third and so on.
    • getLocalFrames

      public List<LocalFrame> getLocalFrames()
      Get the local frame calculated. The calculation itself called by the constructor.
      Returns:
      List of local frame objects. There is a frame in the list for each curve points given at the constructor.