Class NurbsCurveTrans

    • Method Detail

      • newInstance

        public static NurbsCurveTrans newInstance​(NurbsCurve child,
                                                  GTransform transform)
        Returns a 3D NurbsCurveTrans instance holding the specified NurbsCurve and GTransform.
        Parameters:
        child - The NurbsCurve that is the child of this transform element (may not be null).
        transform - The transform held by this transform element (may not be null).
        Returns:
        the transform element having the specified values.
      • setTransform

        public void setTransform​(GTransform transform)
        Sets the transformation represented by this transformation element.
        Specified by:
        setTransform in interface GeomTransform<NurbsCurve>
        Parameters:
        transform - The transform to set this transform element to (may not be null).
      • size

        public int size()
        Returns the number of child-elements that make up this geometry element. This implementation returns the number of control points in the child NURBS curve.
        Specified by:
        size in interface GeomElement<NurbsCurve>
        Returns:
        The number of child-elements that make up this geometry element.
      • getDegree

        public int getDegree()
        Return the degree of the NURBS curve.
        Specified by:
        getDegree in class NurbsCurve
        Returns:
        degree of curve
      • getRealPoint

        public Point getRealPoint​(double s)
        Calculate a point on the curve for the given parametric distance along the curve, p(s).
        Specified by:
        getRealPoint in interface Curve<NurbsCurve>
        Parameters:
        s - parametric distance to calculate a point for (0.0 to 1.0 inclusive).
        Returns:
        the calculated point
      • getSDerivatives

        public java.util.List<Vector<javax.measure.quantity.Length>> getSDerivatives​(double s,
                                                                                     int grade)
        Calculate all the derivatives from 0 to grade with respect to parametric distance on the curve for the given parametric distance along the curve, d^{grade}p(s)/d^{grade}s.

        Example:
        1st derivative (grade = 1), this returns [p(s), dp(s)/ds];
        2nd derivative (grade = 2), this returns [p(s), dp(s)/ds, d^2p(s)/d^2s]; etc.

        Specified by:
        getSDerivatives in interface Curve<NurbsCurve>
        Parameters:
        s - Parametric distance to calculate derivatives for (0.0 to 1.0 inclusive).
        grade - The maximum grade to calculate the derivatives for (1=1st derivative, 2=2nd derivative, etc)
        Returns:
        A list of derivatives up to the specified grade of the curve at the specified parametric position.
        Throws:
        java.lang.IllegalArgumentException - if the grade is < 0.
      • getBoundsMin

        public Point getBoundsMin()
        Return the coordinate point representing the minimum bounding box corner of this geometry element (e.g.: min X, min Y, min Z).
        Specified by:
        getBoundsMin in interface GeomElement<NurbsCurve>
        Returns:
        The minimum bounding box coordinate for this geometry element.
        Throws:
        java.lang.IndexOutOfBoundsException - if this list contains no elements.
      • getBoundsMax

        public Point getBoundsMax()
        Return the coordinate point representing the maximum bounding box corner (e.g.: max X, max Y, max Z).
        Specified by:
        getBoundsMax in interface GeomElement<NurbsCurve>
        Returns:
        The maximum bounding box coordinate for this geometry element.
        Throws:
        java.lang.IndexOutOfBoundsException - if this list contains no elements.
      • getUnit

        public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
        Returns the unit in which the control points in this curve are stated.
        Specified by:
        getUnit in interface GeomElement<NurbsCurve>
        Returns:
        The unit in which the geometry in this element are stated.
      • to

        public NurbsCurveTrans to​(javax.measure.unit.Unit<javax.measure.quantity.Length> unit)
                           throws javax.measure.converter.ConversionException
        Returns the equivalent to this curve but stated in the specified unit.
        Specified by:
        to in interface Curve<NurbsCurve>
        Specified by:
        to in interface GeomElement<NurbsCurve>
        Specified by:
        to in interface ParametricGeometry<NurbsCurve>
        Parameters:
        unit - The length unit of the curve to be returned. May not be null.
        Returns:
        An equivalent to this curve but stated in the specified unit.
        Throws:
        javax.measure.converter.ConversionException - if the the input unit is not a length unit.
      • toDimension

        public NurbsCurveTrans toDimension​(int newDim)
        Return the equivalent of this curve converted to the specified number of physical dimensions. This implementation will throw an exception if the specified dimension is anything other than 3.
        Specified by:
        toDimension in interface Curve<NurbsCurve>
        Specified by:
        toDimension in interface GeomElement<NurbsCurve>
        Specified by:
        toDimension in interface ParametricGeometry<NurbsCurve>
        Parameters:
        newDim - The dimension of the curve to return. MUST equal 3.
        Returns:
        The equivalent of this curve converted to the new dimensions.
        Throws:
        java.lang.IllegalArgumentException - if the new dimension is anything other than 3.
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares this NurbsCurveTrans against the specified object for strict equality.
        Overrides:
        equals in class AbstractGeomElement<NurbsCurve>
        Parameters:
        obj - the object to compare with.
        Returns:
        true if this transform is identical to that transform; false otherwise.
      • recycle

        public static void recycle​(NurbsCurveTrans instance)
        Recycles a NurbsCurveTrans instance immediately (on the stack when executing in a StackContext).
        Parameters:
        instance - The instance to be recycled.