Package geomss.geom

Class SubrangeCurve

    • Method Detail

      • newInstance

        public static SubrangeCurve newInstance​(ParametricGeometry child,
                                                Curve par)
        Returns a SubrangeCurve instance referring to the specified ParametricGeometry and parametric location.
        Parameters:
        child - The ParametricGeometry object that this curve is subranged onto (may not be null).
        par - A curve of the parametric position (between 0 and 1) along each parametric dimension where the curve is located (may not be null).
        Returns:
        the subrange curve having the specified values.
        Throws:
        DimensionException - if the input child object's parametric dimension is not compatible with the input parametric distance point.
      • getParPosition

        public Curve getParPosition()
        Returns the parametric position on the child object that this curve refers to.
        Specified by:
        getParPosition in interface Subrange<Curve>
        Returns:
        The parametric position on the child object that this curve refers to.
      • setParPosition

        public void setParPosition​(Curve par)
        Sets the parametric position on the child object that this curve refers to.
        Specified by:
        setParPosition in interface Subrange<Curve>
        Parameters:
        par - The parametric position (between 0 and 1) along each parametric dimension where the curve is located (may not be null).
      • recycle

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

        public int size()
        Returns the number of child-elements that make up this geometry element. This implementation returns the size of the child object.
        Specified by:
        size in interface GeomElement<SubrangeCurve>
        Returns:
        The number of child-elements that make up this geometry element.
      • 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<SubrangeCurve>
        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<SubrangeCurve>
        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<SubrangeCurve>
        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<SubrangeCurve>
        Returns:
        The maximum bounding box coordinate for this geometry element.
        Throws:
        java.lang.IndexOutOfBoundsException - if this list contains no elements.
      • isValid

        public boolean isValid()
        Return true if this SubrangeCurve 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<SubrangeCurve>
        Returns:
        true if this element contains valid and finite numerical values.
      • getUnit

        public javax.measure.unit.Unit<javax.measure.quantity.Length> getUnit()
        Returns the unit in which this curves values are stated.
        Specified by:
        getUnit in interface GeomElement<SubrangeCurve>
        Returns:
        The unit that this object is stated in.
      • to

        public SubrangeCurve 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<SubrangeCurve>
        Specified by:
        to in interface GeomElement<SubrangeCurve>
        Specified by:
        to in interface ParametricGeometry<SubrangeCurve>
        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 SubrangeCurve toDimension​(int newDim)
        Return the equivalent of this curve converted to the specified number of physical dimensions. If the number of dimensions is greater than this element, then zeros are added to the additional dimensions. If the number of dimensions is less than this element, then the extra dimensions are simply dropped (truncated). If the new dimensions are the same as the dimension of this element, then this element is simply returned.
        Specified by:
        toDimension in interface Curve<SubrangeCurve>
        Specified by:
        toDimension in interface GeomElement<SubrangeCurve>
        Specified by:
        toDimension in interface ParametricGeometry<SubrangeCurve>
        Parameters:
        newDim - The dimension of the curve to return.
        Returns:
        The equivalent of this curve converted to the new dimensions.
      • toNurbs

        public NurbsCurve toNurbs​(Parameter<javax.measure.quantity.Length> tol)
        Return a NURBS curve representation of this curve to within the specified tolerance.
        Specified by:
        toNurbs in interface Curve<SubrangeCurve>
        Parameters:
        tol - The greatest possible difference between this curve and the NURBS representation returned. May not be null.
        Returns:
        A NURBS curve that represents this curve to within the specified tolerance.
      • reverse

        public SubrangeCurve reverse()
        Return a new curve that is identical to this one, but with the parameterization reversed.
        Specified by:
        reverse in interface Curve<SubrangeCurve>
        Returns:
        A new curve identical to this one, but with the parameterization reversed.
      • splitAt

        public GeomList<SubrangeCurvesplitAt​(double s)
        Split this SubrangeCurve at the specified parametric position returning a list containing two curves (a lower curve with smaller parametric positions than "s" and an upper curve with larger parametric positions).
        Specified by:
        splitAt in interface Curve<SubrangeCurve>
        Parameters:
        s - The parametric position where this curve should be split (must not be 0 or 1!).
        Returns:
        A list containing two curves: 0 == the lower curve, 1 == the upper curve.
      • copyToReal

        public SubrangeCurve copyToReal()
        Return a copy of this object with any transformations or subranges removed (applied). This method is not yet implemented and current returns a new SubrangeCurve with the child and subrange curve geometry copied to real.
        Specified by:
        copyToReal in interface Curve<SubrangeCurve>
        Specified by:
        copyToReal in interface GeomElement<SubrangeCurve>
        Returns:
        A copy of this object with any transformations or subranges removed (applied).
      • getTransformed

        public SubrangeCurve getTransformed​(GTransform transform)
        Returns transformed version of this element. The returned object implements is a new SubrangeCurve instance with the transformed version of this object's child as it's child.
        Specified by:
        getTransformed in interface Transformable<SubrangeCurve>
        Parameters:
        transform - The transformation to apply to this geometry. May not be null.
        Returns:
        A new triangle that is identical to this one with the specified transformation applied.
        Throws:
        DimensionException - if this point is not 3D.
      • equals

        public boolean equals​(java.lang.Object obj)
        Compares this SubrangeCurve against the specified object for strict equality (same values and same units).
        Overrides:
        equals in class AbstractGeomElement<SubrangeCurve>
        Parameters:
        obj - the object to compare with.
        Returns:
        true if this point is identical to that point; false otherwise.