java.lang.Object
simpa.core.api.utils.LocalFramesCalculator
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The MINIMIZE_TORSION strategy is searching for an initial vector normal the the first tangent vector of the curve such the total torsion is minimized along the curve. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final LocalFramesCalculator.Strategy
static final org.apache.commons.math3.geometry.euclidean.threed.Vector3D
-
Constructor Summary
ConstructorsConstructorDescriptionLocalFramesCalculator
(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. -
Method Summary
Modifier and TypeMethodDescriptionGet the local frame calculated.void
writeToFile
(String file, int increment) Writes the reference frame unit vectors into a file
-
Field Details
-
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
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
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.
-