JNISpice
version 2.0.0

spice.basic
Class TriangularPlateVertices

java.lang.Object
  extended by spice.basic.TriangularPlateVertices

public class TriangularPlateVertices
extends java.lang.Object

Class TriangularPlateVertices represents triangular shapes in 3-dimensional space as sets of three 3-vectors.

The order of a plate's vertices implies an "outward" normal direction: the vertices are ordered in the positive (counterclockwise) sense about the outward normal direction.

See the related class TriangularPlate which supports various geometric plate operations not covered by this class.

Version 1.0.0 31-DEC-2016 (NJB)


Field Summary
 Vector3[] vertices
           
 
Constructor Summary
TriangularPlateVertices()
          No-arguments constructor.
TriangularPlateVertices(double[][] vertices)
          Construct a triangular plate from an array of three vertex arrays.
TriangularPlateVertices(double[] v1, double[] v2, double[] v3)
          Construct a triangular plate array from three vertex arrays.
TriangularPlateVertices(TriangularPlateVertices p)
          Copy constructor.
TriangularPlateVertices(Vector3 v1, Vector3 v2, Vector3 v3)
          Construct a triangular plate array from three Vector3 objects.
 
Method Summary
 TriangularPlateVertices expand(double delta)
          Expand a triangular plate by a specified amount.
 Vector3 getCentroid()
          Compute the centroid of a triangular plate.
 Vector3 getNearPoint(Vector3 point)
          Find the nearest point on a triangular plate to a specified point.
 Vector3 getOutwardNormal()
          Compute an outward normal vector of a triangular plate.
 double[][] toArray()
          Extract the vertices of a TriangularPlateVertices instance into a two-dimensional array of doubles.
 double[] toArray1D()
          Extract the vertices of a TriangularPlateVertices instance into a one-dimensional array of doubles.
 Vector3[] toVectors()
          Extract the vertices of a TriangularPlateVertices instance into an array of 3-vectors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vertices

public Vector3[] vertices
Constructor Detail

TriangularPlateVertices

public TriangularPlateVertices()
No-arguments constructor. This constructor creates a set of zero vectors.


TriangularPlateVertices

public TriangularPlateVertices(Vector3 v1,
                               Vector3 v2,
                               Vector3 v3)
                        throws SpiceErrorException
Construct a triangular plate array from three Vector3 objects.

Throws:
SpiceErrorException

TriangularPlateVertices

public TriangularPlateVertices(double[] v1,
                               double[] v2,
                               double[] v3)
                        throws SpiceErrorException
Construct a triangular plate array from three vertex arrays.

Throws:
SpiceErrorException

TriangularPlateVertices

public TriangularPlateVertices(double[][] vertices)
                        throws SpiceErrorException
Construct a triangular plate from an array of three vertex arrays.

Throws:
SpiceErrorException

TriangularPlateVertices

public TriangularPlateVertices(TriangularPlateVertices p)
Copy constructor. This constructor generates a deep copy.

Method Detail

toVectors

public Vector3[] toVectors()
Extract the vertices of a TriangularPlateVertices instance into an array of 3-vectors.


toArray

public double[][] toArray()
Extract the vertices of a TriangularPlateVertices instance into a two-dimensional array of doubles.


toArray1D

public double[] toArray1D()
Extract the vertices of a TriangularPlateVertices instance into a one-dimensional array of doubles.


getOutwardNormal

public Vector3 getOutwardNormal()
                         throws SpiceErrorException
Compute an outward normal vector of a triangular plate. The vector does not necessarily have unit length.

Throws:
SpiceErrorException

expand

public TriangularPlateVertices expand(double delta)
                               throws SpiceErrorException
Expand a triangular plate by a specified amount. The expanded plate is co-planar with, and has the same orientation as, the original. The centroids of the two plates coincide.
   delta      is a fraction by which the plate is to be scaled.
              Scaling is done so that the scaled plate has the
              following properties:

                 -  it is co-planar with the input plate

                 -  its centroid coincides with that of the input
                    plate

                 -  its sides remain parallel to the corresponding
                    sides of the input plate

                 -  the distance of each vertex from the centroid is
                    (1+delta) times the corresponding distance for
                    the input plate

Throws:
SpiceErrorException

getNearPoint

public Vector3 getNearPoint(Vector3 point)
                     throws SpiceErrorException
Find the nearest point on a triangular plate to a specified point.

Throws:
SpiceErrorException

getCentroid

public Vector3 getCentroid()
                    throws SpiceErrorException
Compute the centroid of a triangular plate.

Throws:
SpiceErrorException

JNISpice
version 2.0.0

JNISpice Alpha Test Version 2.0.0 28-JAN-2017 (NJB)