Class Curve


  • public class Curve
    extends java.lang.Object
    Curve is an abstract representation of a smooth curve geometry in 3D.

    The interface provides functions for affine transformations, such as scaling, rotation and
    translation. In case of a limited curve segment, it is also possible to make a discretization
    of the curve into line segments.
    • Constructor Detail

      • Curve

        public Curve​(long cPtr,
                     boolean cMemoryOwn)
    • Method Detail

      • getCPtr

        public static long getCPtr​(Curve obj)
      • delete

        public void delete()
      • transform

        public CurvePtr transform​(Transform3D T)
        Transform curve.
        Parameters:
        T - [in] transformation of curve.
        Returns:
        a new transformed curve.
      • transform

        public CurvePtr transform​(Vector3D P)
        Transform curve.
        Parameters:
        P - [in] positional offset.
        Returns:
        a new transformed curve.
      • scale

        public CurvePtr scale​(double factor)
        Get a scaled version of the curve.
        Parameters:
        factor - [in] the factor to scale with.
        Returns:
        a new scaled curve.
      • reverse

        public CurvePtr reverse()
        Make a curve where time variable runs in opposite direction.
        Returns:
        reversed curve.
      • clone

        public CurvePtr clone()
        Make a copy of the curve.
        Returns:
        a new copy of the curve.
      • extremums

        public pair_d_d extremums​(Vector3D dir)
        Get extremums of curve in given direction.

        Notice that the limits are taken into account.

        Parameters:
        dir - [in] direction to get extremums for.
        Returns:
        the minimum and maximum value of the curve in the given direction.
      • discretizeAdaptive

        public SWIGTYPE_p_std__listT_rw__math__Vector3DT_double_t_t discretizeAdaptive​(double stepsPerRevolution)
        Make a discretization of the curve.

        The curve must be limited. The discretization is based on the curvature, such
        that the sampling starts at maximum curvature points (or in limits). The step
        size to the next point is based on the curvature in the current point.

        A line will always give to points, regardless of the chosen number of steps per
        revolution.

        Parameters:
        stepsPerRevolution - [in] the number of points to sample if the curve is a perfect
        circle.
        Returns:
        a list of points on the curve.
      • obr

        public OBB obr()
        Bounding rectangle of curve.

        The curve must be limited.

        Returns:
        the bounding rectangle.
      • CurveEqual

        public boolean CurveEqual​(CurveCPtr curve,
                                  double eps)
        Check if this curve is equal to another curve.
        Parameters:
        curve - [in] other curve.
        eps - [in] distance threshold.
        Returns:
        true if curves are identical, false otherwise.