Curve ===== .. py:module:: rhino3dm .. py:class:: Curve .. py:attribute:: Domain rhino3dm.Interval: Gets or sets the domain of the curve. .. py:attribute:: Dimension int: Gets the dimension of the object. The dimension is typically three. For parameter space trimming curves the dimension is two. In rare cases the dimension can be one or greater than three. .. py:attribute:: SpanCount int: Gets the number of non-empty smooth (c-infinity) spans in the curve. .. py:attribute:: Degree int: Gets the maximum algebraic degree of any span or a good estimate if curve spans are not algebraic. .. py:attribute:: IsClosed bool: Gets a value indicating whether or not this curve is a closed curve. .. py:attribute:: IsPeriodic bool: Gets a value indicating whether or not this curve is considered to be Periodic. .. py:attribute:: PointAtStart rhino3dm.Point3d: Evaluates point at the start of the curve. .. py:attribute:: PointAtEnd rhino3dm.Point3d: Evaluates point at the end of the curve. .. py:attribute:: TangentAtStart rhino3dm.Vector3d: Evaluates the unit tangent vector at the start of the curve. .. py:attribute:: TangentAtEnd rhino3dm.Vector3d: Evaluate unit tangent vector at the end of the curve. .. py:staticmethod:: CreateControlPointCurve(points, degree) Constructs a curve from a set of control-point locations. :param list[rhino3dm.Point3d] points: Control points. :param int degree: Degree of curve. The number of control points must be at least degree+1. :rtype: rhino3dm.Curve .. py:method:: ChangeDimension(desiredDimension) Changes the dimension of a curve. :param int desiredDimension: The desired dimension. :return: True if the curve's dimension was already desiredDimension \ or if the curve's dimension was successfully changed to desiredDimension; \ otherwise false. :rtype: bool .. py:method:: IsLinear(tolerance) Test a curve to see if it is linear to within RhinoMath.ZeroTolerance units (1e-12). :return: True if the curve is linear. :rtype: bool .. py:method:: IsPolyline() Several types of Curve can have the form of a polyline including a degree 1 NurbsCurve, a PolylineCurve, and a PolyCurve all of whose segments are some form of polyline. IsPolyline tests a curve to see if it can be represented as a polyline. :return: True if this curve can be represented as a polyline; otherwise, false. :rtype: bool .. py:method:: TryGetPolyline() Several types of Curve can have the form of a polyline including a degree 1 NurbsCurve, a PolylineCurve, and a PolyCurve all of whose segments are some form of polyline. IsPolyline tests a curve to see if it can be represented as a polyline. :return: tuple (bool, rhino3dm.Polyline) - True if this curve can be represented as a polyline; otherwise, false. - If True is returned, then the polyline form is returned here. \ :rtype: (bool, rhino3dm.Polyline) .. py:method:: IsArc(tolerance) Test a curve to see if it can be represented by an arc or circle within RhinoMath.ZeroTolerance. :return: True if the curve can be represented by an arc or a circle within tolerance. :rtype: bool .. py:method:: TryGetArc(tolerance) Try to convert this curve into an Arc using RhinoMath.ZeroTolerance. :return: tuple (bool, Arc) - True if the curve could be converted into an arc. - On success, the Arc will be filled in. \ :rtype: (bool, Arc) .. py:method:: IsCircle(tolerance) Test a curve to see if it can be represented by a circle within RhinoMath.ZeroTolerance. :return: True if the Curve can be represented by a circle within tolerance. :rtype: bool .. py:method:: TryGetCircle(tolerance) Try to convert this curve into a circle using RhinoMath.ZeroTolerance. :return: tuple (bool, Circle) - True if the curve could be converted into a Circle. - On success, the Circle will be filled in. \ :rtype: (bool, Circle) .. py:method:: IsEllipse(tolerance) Test a curve to see if it can be represented by an ellipse within RhinoMath.ZeroTolerance. :return: True if the Curve can be represented by an ellipse within tolerance. :rtype: bool .. py:method:: TryGetEllipse(tolerance) Try to convert this curve into an Ellipse within RhinoMath.ZeroTolerance. :return: tuple (bool, Ellipse) - True if the curve could be converted into an Ellipse. - On success, the Ellipse will be filled in. \ :rtype: (bool, Ellipse) .. py:method:: IsPlanar(tolerance) Test a curve for planarity. :return: True if the curve is planar (flat) to within RhinoMath.ZeroTolerance units (1e-12). :rtype: bool .. py:method:: ChangeClosedCurveSeam(t) If this curve is closed, then modify it so that the start/end point is at curve parameter t. :param float t: Curve parameter of new start/end point. The returned curves domain will start at t. :return: True on success, False on failure. :rtype: bool .. py:method:: IsClosable(tolerance, minimumAbsoluteSize, minimumRelativeSize) Decide if it makes sense to close off this curve by moving the endpoint to the start based on start-end gap size and length of curve as approximated by chord defined by 6 points. :return: True if start and end points are close enough based on above conditions. :rtype: bool .. py:method:: Reverse() Reverses the direction of the curve. :return: True on success, False on failure. :rtype: bool .. py:method:: ClosedCurveOrientation() Determines the orientation (counterclockwise or clockwise) of a closed, planar curve in the world XY plane. Only works with simple (no self intersections) closed, planar curves. :return: The orientation of this curve with respect to world XY plane. :rtype: CurveOrientation .. py:method:: ClosedCurveOrientation(plane) Determines the orientation (counterclockwise or clockwise) of a closed, planar curve in the world XY plane. Only works with simple (no self intersections) closed, planar curves. :return: The orientation of this curve with respect to world XY plane. :rtype: CurveOrientation .. py:method:: PointAt(t) Evaluates point at a curve parameter. :param float t: Evaluation parameter. :return: Point (location of curve at the parameter t). :rtype: rhino3dm.Point3d .. py:method:: SetStartPoint(point) Forces the curve to start at a specified point. Not all curve types support this operation. :param rhino3dm.Point3d point: New start point of curve. :return: True on success, False on failure. :rtype: bool .. py:method:: SetEndPoint(point) Forces the curve to end at a specified point. Not all curve types support this operation. :param rhino3dm.Point3d point: New end point of curve. :return: True on success, False on failure. :rtype: bool .. py:method:: TangentAt(t) Evaluates the unit tangent vector at a curve parameter. :param float t: Evaluation parameter. :return: Unit tangent vector of the curve at the parameter t. :rtype: rhino3dm.Vector3d .. py:method:: CurvatureAt(t) Evaluate the curvature vector at a curve parameter. :param float t: Evaluation parameter. :return: Curvature vector of the curve at the parameter t. :rtype: rhino3dm.Vector3d .. py:method:: FrameAt(t) Returns a 3d frame at a parameter. :param float t: Evaluation parameter. :return: tuple (bool, rhino3dm.Plane) - True on success, False on failure. - The frame is returned here. \ :rtype: (bool, rhino3dm.Plane) .. py:method:: DerivativeAt(t, derivativeCount) Evaluate the derivatives at the specified curve parameter. :param float t: Curve parameter to evaluate. :param int derivativeCount: Number of derivatives to evaluate, must be at least 0. :return: An array of vectors that represents all the derivatives starting at zero. :rtype: rhino3dm.Vector3d[] .. py:method:: DerivativeAt(t, derivativeCount, side) Evaluate the derivatives at the specified curve parameter. :return: An array of vectors that represents all the derivatives starting at zero. :rtype: rhino3dm.Vector3d[] .. py:method:: GetCurveParameterFromNurbsFormParameter(nurbsParameter) Convert a NURBS curve parameter to a curve parameter. :param float nurbsParameter: NURBS form parameter. :return: tuple (bool, float) - True on success, False on failure. - Curve parameter. \ :rtype: (bool, float) .. py:method:: GetNurbsFormParameterFromCurveParameter(curveParameter) Convert a curve parameter to a NURBS curve parameter. :param float curveParameter: Curve parameter. :return: tuple (bool, float) - True on success, False on failure. - NURBS form parameter. \ :rtype: (bool, float) .. py:method:: Trim(t0, t1) Removes portions of the curve outside the specified interval. :param float t0: Start of the trimming interval. Portions of the curve before curve(t0) are removed. :param float t1: End of the trimming interval. Portions of the curve after curve(t1) are removed. :return: Trimmed portion of this curve is successful, None on failure. :rtype: rhino3dm.Curve .. py:method:: Split(t) Splits (divides) the curve at the specified parameter. The parameter must be in the interior of the curve's domain. :param float t: Parameter to split the curve at in the interval returned by Domain(). :return: Two curves on success, None on failure. :rtype: rhino3dm.Curve[] .. py:method:: ToNurbsCurve() Constructs a NURBS curve representation of this curve. :return: NURBS representation of the curve on success, None on failure. :rtype: rhino3dm.NurbsCurve .. py:method:: ToNurbsCurve(subdomain) Constructs a NURBS curve representation of this curve. :return: NURBS representation of the curve on success, None on failure. :rtype: rhino3dm.NurbsCurve