Package geomss.geom

Class GeomTriangle

    • Method Detail

      • getP1

        public abstract GeomPoint getP1()
        Return the first vertex in this triangle.
        Returns:
        The first vertex in this triangle.
      • getP2

        public abstract GeomPoint getP2()
        Return the second vertex in this triangle.
        Returns:
        The second vertex in this triangle.
      • getP3

        public abstract GeomPoint getP3()
        Return the third and last vertex in this triangle.
        Returns:
        The third and last vertex in this triangle.
      • getNormal

        public abstract GeomVector<javax.measure.quantity.Dimensionless> getNormal()
        Return the surface unit normal vector for this triangle. If the triangle is degenerate (zero area), then the normal vector will have zero length.
        Returns:
        The surface normal vector for this triangle.
      • getArea

        public abstract Parameter<javax.measure.quantity.Area> getArea()
        Return the surface area of one side of this triangle. The returned area is always positive, but can be zero.
        Returns:
        The surface area of one side of this triangle.
      • isDegenerate

        public boolean isDegenerate​(Parameter<javax.measure.quantity.Length> tol)
        Return true if this triangle is degenerate (i.e.: has zero surface area). A degenerate triangle is defined as a triangle that has any edge with length less than the input tolerance.
        Parameters:
        tol - The tolerance for determining if this triangle is degenerate. A value of null would indicate that exactly zero area is required to be degenerate.
        Returns:
        true if this triangle is degenerate.
      • reverse

        public abstract GeomTriangle reverse()
        Return a new triangle that is identical to this one, but with the order of the points (and the surface normal direction) reversed.
        Returns:
        A new Triangle that is identical to this one, but with the order of the points reversed.
      • getPoints

        public PointString<? extends GeomPointgetPoints()
        Return all three vertices of this triangle as an ordered list of points.
        Returns:
        A list containing the three vertices of this triangle in counter-clockwise order.
      • getPoints

        public GeomPoint[] getPoints​(GeomPoint[] points)
        Return all three vertices of this triangle contained in the supplied array of points. The input array must have at least 3 elements.
        Parameters:
        points - An existing array with at leat 3 elements that will be filled in with points from this triangle. May not be null.
        Returns:
        The input array with the three vertices of this triangle, in counter- clockwise order, placed in the 1st 3 elements.
      • getAll

        public GeomList<GeomPointgetAll()
        Returns an new GeomList containing the ordered points in this triangle.
        Returns:
        A new GeomList containing the ordered points from this triangle.
      • size

        public int size()
        Returns the number of child-elements that make up this geometry element. This implementation always returns 3 as a GeomTriangle has three vertices.
        Specified by:
        size in interface GeomElement<GeomTriangle>
        Returns:
        The number of points in this triangle (always returns 3).
      • getParDimension

        public int getParDimension()
        Returns the number of parametric dimensions of the geometry element. This implementation always returns 0 as a Triangle is not parametric.
        Specified by:
        getParDimension in interface GeomElement<GeomTriangle>
        Returns:
        The number of parametric dimensions of this geometry element.
      • getLimitPoint

        public GeomPoint getLimitPoint​(int dim,
                                       boolean max,
                                       double tol)
        Returns the most extreme point, either minimum or maximum, in the specified coordinate direction on this triangle.
        Specified by:
        getLimitPoint in interface GeomElement<GeomTriangle>
        Parameters:
        dim - An index indicating the dimension to find the min/max point for (0=X, 1=Y, 2=Z, etc).
        max - Set to true to return the maximum value, false to return the minimum.
        tol - Fractional tolerance (in parameter space) to refine the min/max point position to.
        Returns:
        The point found on this triangle that is the min or max in the specified coordinate direction.
        See Also:
        GeomElement.getBoundsMin(), GeomElement.getBoundsMax()
      • isValid

        public boolean isValid()
        Return true if this GeomTriangle contains valid and finite numerical components. A value of false will be returned if any of the coordinate values are NaN or Inf.
        Specified by:
        isValid in interface GeomElement<GeomTriangle>
        Returns:
        true if this GeomTriangle contains valid and finite data.
      • getUnit

        public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
        Returns the unit in which this GeomTriangle is stated.
        Specified by:
        getUnit in interface GeomElement<GeomTriangle>
        Returns:
        The unit in which this GeomTriangle is stated.
      • toText

        public javolution.text.Text toText()
        Returns the text representation of this geometry element that consists of the name followed by the three defining points. For example:
           {aTri = {{0.0 m, 0.0 m},{1.0 m, 0.0 m},{0.5 m, 1.0 m}}
         
        If there is no name, then the output looks like this:
           {{0.0 m, 0.0 m},{1.0 m, 0.0 m},{0.5 m, 1.0 m}}
         
        Specified by:
        toText in interface GeomElement<GeomTriangle>
        Overrides:
        toText in class AbstractGeomElement<GeomTriangle>
        Returns:
        the text representation of this geometry element.
      • reset

        public void reset()
        Resets the internal state of this object to its default values. Subclasses that override this method must call super.reset(); to ensure that the state is reset properly.
        Specified by:
        reset in interface javolution.lang.Reusable
        Overrides:
        reset in class AbstractGeomElement<GeomTriangle>