RSpline
Class in Math Module
Header: #include <src/core/math/RSpline.h>
Inherits: RShape, RExplodable
Inherited by: RSplineData
Description
Section titled “Description”Low-level mathematical representation of a spline.
The spline may be defined by its control points or by its fit points but not both.
Scriptable: This class is available in script environments.
Shared Pointer Support: Objects can be used in QSharedPointer.
Copyable: Objects are cleaned up automatically by the garbage collector of the script engine.
Stream Operator: Object has a stream operator to present itself as string, for example when using toString() in a script.
Public Functions
Section titled “Public Functions”RSpline()Creates a spline object without controlPoints. |
|
RSpline(const QList< RVector > &controlPoints, int degree)Creates a spline object with the given control points and degree. |
|
RSpline(const RSpline &other) |
|
| void | appendControlPoint(const RVector &point)Disabled for splines (bad performance). |
| void | appendControlPoints(const QList< RVector > &points)Appends the given control points. |
| void | appendFitPoint(const RVector &point)Appends a fit point. |
| void | appendKnot(double k) |
| RPolyline | approximateWithArcs(double tolerance, double radiusLimit=RDEFAULT_MIN1) const |
| virtual QSharedPointer< RShape > | clone() const |
| QSharedPointer< RSpline > | cloneToSpline() const |
| void | copySpline(const RSpline &other) |
| int | countControlPoints() const |
| int | countFitPoints() const |
| virtual bool | flipHorizontal() |
| virtual bool | flipVertical() |
| QList< double > | getActualKnotVector() const |
| virtual double | getAngleAt(double distance, RS::From from=RS::FromStart) const |
| double | getAngleAtT(double t) const |
| QList< RSpline > | getBezierSegments(const RBox &queryBox=RDEFAULT_RBOX) const |
| virtual QList< bool > | getBoolProperties() const |
| virtual RBox | getBoundingBox() const |
| virtual QList< RVector > | getCenterPoints() const |
| RVector | getControlPointAt(int i) const |
| QList< RVector > | getControlPoints() const |
| QList< RVector > | getControlPointsWrapped() const |
| int | getDegree() const |
| virtual double | getDirection1() const |
| virtual double | getDirection2() const |
| QList< RVector > | getDiscontinuities() const |
| double | getDistanceAtT(double t) const |
| virtual double | getDistanceFromStart(const RVector &p) const |
| virtual QList< double > | getDoubleProperties() const |
| virtual RVector | getEndPoint() const |
| virtual QList< RVector > | getEndPoints() const |
| virtual QList< QSharedPointer< RShape > > | getExploded(int segments=RDEFAULT_MIN1) const |
| QList< QSharedPointer< RShape > > | getExplodedBezier(int segments) const |
| QList< QSharedPointer< RShape > > | getExplodedWithSegmentLength(double segmentLength) const |
| RVector | getFitPointAt(int i) const |
| QList< RVector > | getFitPoints() const |
| virtual QList< int > | getIntProperties() const |
| QList< double > | getKnotVector() const |
| virtual double | getLength() const |
| virtual RVector | getMiddlePoint() const |
| virtual QList< RVector > | getMiddlePoints() const |
| int | getOrder() const |
| RVector | getPointAt(double t) const |
| RVector | getPointAtDistance(double distance) const |
| virtual QList< RVector > | getPointCloud(double segmentLength) const |
| virtual QList< RVector > | getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) const |
| QList< RSpline > | getSegments(const QList< RVector > &points) const |
| virtual QList< RVector > | getSelfIntersectionPoints(double tolerance=RS::PointTolerance) const |
| virtual RShape::Type | getShapeType() const |
| virtual RS::Side | getSideOfPoint(const RVector &point) const |
| virtual RVector | getStartPoint() const |
| RSpline | getSubSpline(double t1, double t2) const |
| RVector | getTangentAtEnd() const |
| RVector | getTangentAtStart() const |
| double | getTAtDistance(double distance) const |
| double | getTAtPoint(const RVector &point) const |
| double | getTDelta() const |
| double | getTMax() const |
| double | getTMin() const |
| virtual QSharedPointer< RShape > | getTransformed(const QTransform &transform) const |
| virtual RS::Ending | getTrimEnd(const RVector &trimPoint, const RVector &clickPoint) |
| QList< double > | getTsAtPoint(const RVector &point, double tolerance=RS::PointTolerance) const |
| virtual QList< RVector > | getVectorProperties() const |
| virtual RVector | getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) const |
| QList< double > | getWeights() const |
| bool | hasFitPoints() const |
| void | insertFitPointAt(const RVector &point)Inserts a fit point at the point on the spline closest to the given position. |
| void | insertFitPointAt(double t, const RVector &point) |
| bool | isClosed() const |
| virtual bool | isDirected() const |
| bool | isDirty() const |
| bool | isGeometricallyClosed(double tolerance=RS::PointTolerance) const |
| virtual bool | isInterpolated() constReimplement and return true if this shape relies on interpolation for geometrical operations such as finding intersection points. |
| virtual bool | isOnShape(const RVector &point, bool limited=true, double tolerance=RDEFAULT_TOLERANCE_1E_MIN4) const |
| bool | isPeriodic() const |
| virtual bool | isValid() const |
| virtual bool | mirror(const RLine &axis) |
| virtual bool | move(const RVector &offset) |
| RSpline & | operator=(const RSpline &other) |
| void | prependFitPoint(const RVector &point)Prepends a fit point. |
| void | removeFirstFitPoint()Removes the first fit point. |
| void | removeFitPointAt(const RVector &point) |
| void | removeLastControlPoint()Removes the last control point. |
| void | removeLastFitPoint()Removes the last fit point. |
| virtual bool | reverse() |
| virtual bool | rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR) |
| virtual bool | scale(const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR) |
| void | setControlPoints(const QList< RVector > &points)Sets the control points of this spline. |
| void | setDegree(int d)Sets the degree of this spline (2 or 3 for control point defined spline, 3 for fit point defined spline). |
| void | setEndPoint(const RVector &v) |
| void | setFitPoints(const QList< RVector > &points)Sets the fit points. |
| void | setKnotVector(const QList< double > &knots)Sets the knot vector manually. |
| void | setPeriodic(bool on) |
| void | setStartPoint(const RVector &v) |
| void | setTangentAtEnd(const RVector &t)Sets the end tangent. |
| void | setTangentAtStart(const RVector &t)Sets the start tangent. |
| void | setTangents(const RVector &start, const RVector &end)Sets the start and end tangents. |
| void | setWeights(QList< double > &w) |
| virtual void | setZ(double z) |
| RSpline | simplify(double tolerance) |
| virtual QList< QSharedPointer< RShape > > | splitAt(const QList< RVector > &points) constSplits this spline at the given points. |
| QList< RSpline > | splitAtParams(const QList< double > ¶ms) const |
| QList< RSpline > | splitAtPoints(const QList< RVector > &points) const |
| virtual bool | stretch(const RPolyline &area, const RVector &offset) |
| RPolyline | toPolyline(int segments) const |
| virtual bool | trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false) |
| virtual bool | trimEndPoint(double trimDist) |
| virtual bool | trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false) |
| virtual bool | trimStartPoint(double trimDist) |
| void | unsetTangentAtEnd()Clears the valud of the end tangent. |
| void | unsetTangentAtStart()Clears the valud of the start tangent. |
| void | unsetTangents()Clears the valud of the start and end tangents. |
| void | update() const |
| void | updateFromControlPoints() const |
| void | updateFromFitPoints() constCloses this spline and makes it periodic if it isn’t already. |
| void | updateTangentsPeriodic()Updates the tangents at the start and end to make the spline periodic. |
Static Public Functions
Section titled “Static Public Functions”| static RSpline | createBezierFromSmallArc(double r, double a1, double a2)Cubic bezier approximation of a circular arc centered at the origin, from (radians) a1 to a2, where a2-a1 < pi/2. |
| static QList< RSpline > | createSplinesFromArc(const RArc &arc) |
| static RSplineProxy * | getSplineProxy() |
| static bool | hasProxy() |
| static void | setSplineProxy(RSplineProxy *p) |
Public Attributes
Section titled “Public Attributes”| QList< RVector > | controlPoints Getter function for this property: getControlPoints. |
| int | degree Getter function for this property: getDegree. |
| bool | dirty |
| QList< RVector > | fitPoints Getter function for this property: getFitPoints. |
| QList< double > | knotVector Getter function for this property: getKnotVector. |
| bool | periodic Closed periodic flag. |
| RVector | tangentEnd Unit vector end tangent. |
| RVector | tangentStart Unit vector start tangent. |
| bool | updateInProgress |
| QList< double > | weights Getter function for this property: getWeights. |
Protected Functions
Section titled “Protected Functions”| void | appendToExploded(const RLine &line) const |
| void | invalidate() const |
| virtual void | print(QDebug dbg) const |
| void | updateBoundingBox() constUpdates the internal bounding box. |
| void | updateInternal() const |
Private Attributes
Section titled “Private Attributes”| RBox | boundingBox |
| ON_NurbsCurve | curve |
| QList< QSharedPointer< RShape > > | exploded |
| double | length |
Static Private Attributes
Section titled “Static Private Attributes”| static RSplineProxy * | splineProxy |
Member Documentation
Section titled “Member Documentation”RSpline
Section titled “RSpline”RSpline::RSpline()Creates a spline object without controlPoints.
RSpline
Section titled “RSpline”RSpline::RSpline(const QList< RVector > &controlPoints, int degree)Creates a spline object with the given control points and degree.
RSpline
Section titled “RSpline”RSpline::RSpline(const RSpline &other)appendControlPoint
Section titled “appendControlPoint”void RSpline::appendControlPoint(const RVector &point)Disabled for splines (bad performance).
20120223: Re-enabled, seems to perform OK, needed by some users. Appends a control point.
appendControlPoints
Section titled “appendControlPoints”void RSpline::appendControlPoints(const QList< RVector > &points)Appends the given control points.
appendFitPoint
Section titled “appendFitPoint”void RSpline::appendFitPoint(const RVector &point)Appends a fit point.
appendKnot
Section titled “appendKnot”void RSpline::appendKnot(double k)approximateWithArcs
Section titled “approximateWithArcs”RPolyline RSpline::approximateWithArcs(double tolerance, double radiusLimit=RDEFAULT_MIN1) constconst
virtual QSharedPointer< RShape > RSpline::clone() constvirtual inline const
Reimplemented from clone.
cloneToSpline
Section titled “cloneToSpline”QSharedPointer< RSpline > RSpline::cloneToSpline() constinline const
copySpline
Section titled “copySpline”void RSpline::copySpline(const RSpline &other)countControlPoints
Section titled “countControlPoints”int RSpline::countControlPoints() constconst
Returns: Number of control points.
countFitPoints
Section titled “countFitPoints”int RSpline::countFitPoints() constconst
Returns: Number of fit points.
flipHorizontal
Section titled “flipHorizontal”virtual bool RSpline::flipHorizontal()virtual
Reimplemented from flipHorizontal.
Reimplemented in flipHorizontal.
flipVertical
Section titled “flipVertical”virtual bool RSpline::flipVertical()virtual
Reimplemented from flipVertical.
Reimplemented in flipVertical.
getActualKnotVector
Section titled “getActualKnotVector”QList< double > RSpline::getActualKnotVector() constconst
getAngleAt
Section titled “getAngleAt”virtual double RSpline::getAngleAt(double distance, RS::From from=RS::FromStart) constvirtual const
Returns: Angle on the entity at the given distance from the start point.
Reimplemented from getAngleAt.
Reimplemented in getAngleAt.
getAngleAtT
Section titled “getAngleAtT”double RSpline::getAngleAtT(double t) constconst
Returns: Tangent angle at the given spline parameter.
getBezierSegments
Section titled “getBezierSegments”QList< RSpline > RSpline::getBezierSegments(const RBox &queryBox=RDEFAULT_RBOX) constconst
Returns: List of bezier spline segments which together represent this curve.
getBoolProperties
Section titled “getBoolProperties”virtual QList< bool > RSpline::getBoolProperties() constvirtual const
Reimplemented from getBoolProperties.
getBoundingBox
Section titled “getBoundingBox”virtual RBox RSpline::getBoundingBox() constvirtual const
Returns: The bounding box of this shape.
Reimplemented from getBoundingBox.
getCenterPoints
Section titled “getCenterPoints”virtual QList< RVector > RSpline::getCenterPoints() constvirtual const
Returns: The center point(s) of this shape.
Reimplemented from getCenterPoints.
getControlPointAt
Section titled “getControlPointAt”RVector RSpline::getControlPointAt(int i) constconst
getControlPoints
Section titled “getControlPoints”QList< RVector > RSpline::getControlPoints() constconst
Returns: Control points.
getControlPointsWrapped
Section titled “getControlPointsWrapped”QList< RVector > RSpline::getControlPointsWrapped() constconst
Returns: Control points of internal spline representation (may be closed).
getDegree
Section titled “getDegree”int RSpline::getDegree() constconst
Returns: Degree of this spline.
getDirection1
Section titled “getDirection1”virtual double RSpline::getDirection1() constvirtual const
Returns: Tangent angle of spline at start point.
Reimplemented from getDirection1.
Reimplemented in getDirection1.
getDirection2
Section titled “getDirection2”virtual double RSpline::getDirection2() constvirtual const
Returns: Tangent angle of spline at end point.
Reimplemented from getDirection2.
Reimplemented in getDirection2.
getDiscontinuities
Section titled “getDiscontinuities”QList< RVector > RSpline::getDiscontinuities() constconst
getDistanceAtT
Section titled “getDistanceAtT”double RSpline::getDistanceAtT(double t) constconst
getDistanceFromStart
Section titled “getDistanceFromStart”virtual double RSpline::getDistanceFromStart(const RVector &p) constvirtual const
Returns: Distance of given point to start point of shape along shape.
Parameters:
p: Point (assumed to be on shape).
Reimplemented from getDistanceFromStart.
getDoubleProperties
Section titled “getDoubleProperties”virtual QList< double > RSpline::getDoubleProperties() constvirtual const
Reimplemented from getDoubleProperties.
getEndPoint
Section titled “getEndPoint”virtual RVector RSpline::getEndPoint() constvirtual const
Reimplemented from getEndPoint.
Reimplemented in getEndPoint.
getEndPoints
Section titled “getEndPoints”virtual QList< RVector > RSpline::getEndPoints() constvirtual const
Returns: The end point(s) of this shape.
Reimplemented from getEndPoints.
getExploded
Section titled “getExploded”virtual QList< QSharedPointer< RShape > > RSpline::getExploded(int segments=RDEFAULT_MIN1) constvirtual const
Returns: List of RLines describing this spline.
Reimplemented from getExploded.
getExplodedBezier
Section titled “getExplodedBezier”QList< QSharedPointer< RShape > > RSpline::getExplodedBezier(int segments) constconst
Returns: exploded spline, treated as one spline segment, typically only used for bezier spline segments (degree+1 control points).
getExplodedWithSegmentLength
Section titled “getExplodedWithSegmentLength”QList< QSharedPointer< RShape > > RSpline::getExplodedWithSegmentLength(double segmentLength) constconst
getFitPointAt
Section titled “getFitPointAt”RVector RSpline::getFitPointAt(int i) constconst
getFitPoints
Section titled “getFitPoints”QList< RVector > RSpline::getFitPoints() constconst
Returns: Fit points.
getIntProperties
Section titled “getIntProperties”virtual QList< int > RSpline::getIntProperties() constvirtual const
Reimplemented from getIntProperties.
getKnotVector
Section titled “getKnotVector”QList< double > RSpline::getKnotVector() constconst
Returns: Knot vector, internally calculated and updated.
getLength
Section titled “getLength”virtual double RSpline::getLength() constvirtual const
Returns: The total length of this shape if applicable or NaN if not.
Reimplemented from getLength.
Reimplemented in getLength.
getMiddlePoint
Section titled “getMiddlePoint”virtual RVector RSpline::getMiddlePoint() constvirtual const
Reimplemented from getMiddlePoint.
getMiddlePoints
Section titled “getMiddlePoints”virtual QList< RVector > RSpline::getMiddlePoints() constvirtual const
Returns: The middle point(s) of this shape.
Reimplemented from getMiddlePoints.
getOrder
Section titled “getOrder”int RSpline::getOrder() constconst
Returns: Order of this spline (=degree+1).
getPointAt
Section titled “getPointAt”RVector RSpline::getPointAt(double t) constconst
Returns: Point on spline at given position t (0..1).
getPointAtDistance
Section titled “getPointAtDistance”RVector RSpline::getPointAtDistance(double distance) constconst
getPointCloud
Section titled “getPointCloud”virtual QList< RVector > RSpline::getPointCloud(double segmentLength) constvirtual const
Reimplemented from getPointCloud.
getPointsWithDistanceToEnd
Section titled “getPointsWithDistanceToEnd”virtual QList< RVector > RSpline::getPointsWithDistanceToEnd(double distance, int from=RS::FromAny) constvirtual const
Returns: All points on this shape with the given distance to an endpoint.
Reimplemented from getPointsWithDistanceToEnd.
getSegments
Section titled “getSegments”QList< RSpline > RSpline::getSegments(const QList< RVector > &points) constconst
getSelfIntersectionPoints
Section titled “getSelfIntersectionPoints”virtual QList< RVector > RSpline::getSelfIntersectionPoints(double tolerance=RS::PointTolerance) constvirtual const
Returns: The points at which this spline crosses itself.
Requires a spline proxy (QCAD Professional): crossings between different bezier segments of the spline as well as loops inside a single bezier segment are found, the points at which consecutive segments meet are not reported. Used for snapping and for splitting a spline that crosses itself into simple pieces (see splitAt). Without a proxy, no points are returned.
Reimplemented from getSelfIntersectionPoints.
getShapeType
Section titled “getShapeType”virtual RShape::Type RSpline::getShapeType() constvirtual inline const
Reimplemented from getShapeType.
getSideOfPoint
Section titled “getSideOfPoint”virtual RS::Side RSpline::getSideOfPoint(const RVector &point) constvirtual const
Reimplemented from getSideOfPoint.
getStartPoint
Section titled “getStartPoint”virtual RVector RSpline::getStartPoint() constvirtual const
Reimplemented from getStartPoint.
Reimplemented in getStartPoint.
getSubSpline
Section titled “getSubSpline”RSpline RSpline::getSubSpline(double t1, double t2) constconst
Returns: Sub spline of this spline from parameter t1 to parameter t2 or an invalid spline on error. Computed from the internal, non-rational NURBS representation (weights are not considered, consistent with getPointAt, getExploded, etc.).
getTangentAtEnd
Section titled “getTangentAtEnd”RVector RSpline::getTangentAtEnd() constconst
Returns: The end tangent.
getTangentAtStart
Section titled “getTangentAtStart”RVector RSpline::getTangentAtStart() constconst
Returns: The start tangent.
getTAtDistance
Section titled “getTAtDistance”double RSpline::getTAtDistance(double distance) constconst
getTAtPoint
Section titled “getTAtPoint”double RSpline::getTAtPoint(const RVector &point) constconst
getTDelta
Section titled “getTDelta”double RSpline::getTDelta() constconst
getTMax
Section titled “getTMax”double RSpline::getTMax() constconst
getTMin
Section titled “getTMin”double RSpline::getTMin() constconst
getTransformed
Section titled “getTransformed”virtual QSharedPointer< RShape > RSpline::getTransformed(const QTransform &transform) constvirtual const
Reimplemented from getTransformed.
getTrimEnd
Section titled “getTrimEnd”virtual RS::Ending RSpline::getTrimEnd(const RVector &trimPoint, const RVector &clickPoint)virtual
Parameters:
trimPoint: Trim start point or end point to this coordinate.clickPoint: Point that was clicked by user.
Reimplemented from getTrimEnd.
Reimplemented in getTrimEnd.
getTsAtPoint
Section titled “getTsAtPoint”QList< double > RSpline::getTsAtPoint(const RVector &point, double tolerance=RS::PointTolerance) constconst
Returns: New spline that covers this spline from d1 to d2, where d1 and d2 are distances from the start point of this spline.
Returns: All parameters at which this spline passes through the given point (closer than the given tolerance), in ascending order. A spline that crosses itself passes through the intersection point twice and thus yields two parameters for it; for any other point on the spline a single parameter is returned. Points that the spline does not pass through yield no parameter at all. Unlike getTAtPoint this is not limited to a single (arbitrary) parameter for points the spline passes through more than once.
Requires a spline proxy (QCAD Professional), see RSplineProxy::getTsAtPoint.
getVectorProperties
Section titled “getVectorProperties”virtual QList< RVector > RSpline::getVectorProperties() constvirtual const
Reimplemented from getVectorProperties.
getVectorTo
Section titled “getVectorTo”virtual RVector RSpline::getVectorTo(const RVector &point, bool limited=true, double strictRange=RMAXDOUBLE) constvirtual const
Returns: Shortest vector from this shape to the given point.
Parameters:
point: the given pointlimited: If false, the shape is treated as an unlimited shape that extends in a logical way. For example an unlimited line for a line, full circle for an arc or a plane for a triangle.
Reimplemented from getVectorTo.
Reimplemented in getVectorTo.
getWeights
Section titled “getWeights”QList< double > RSpline::getWeights() constconst
Returns: Knot weights, internally calculated and updated.
hasFitPoints
Section titled “hasFitPoints”bool RSpline::hasFitPoints() constconst
Returns: True if this spline has fit points and is therefore defined by its fit points, false otherwise.
insertFitPointAt
Section titled “insertFitPointAt”void RSpline::insertFitPointAt(const RVector &point)Inserts a fit point at the point on the spline closest to the given position.
insertFitPointAt
Section titled “insertFitPointAt”void RSpline::insertFitPointAt(double t, const RVector &point)isClosed
Section titled “isClosed”bool RSpline::isClosed() constconst
Returns: True if this spline is closed, i.e. start point and end point are very close to each other.
isDirected
Section titled “isDirected”virtual bool RSpline::isDirected() constvirtual inline const
Reimplemented from isDirected.
isDirty
Section titled “isDirty”bool RSpline::isDirty() constinline const
isGeometricallyClosed
Section titled “isGeometricallyClosed”bool RSpline::isGeometricallyClosed(double tolerance=RS::PointTolerance) constconst
isInterpolated
Section titled “isInterpolated”virtual bool RSpline::isInterpolated() constvirtual inline const
Reimplement and return true if this shape relies on interpolation for geometrical operations such as finding intersection points.
E.g. splines.
Reimplemented from isInterpolated.
isOnShape
Section titled “isOnShape”virtual bool RSpline::isOnShape(const RVector &point, bool limited=true, double tolerance=RDEFAULT_TOLERANCE_1E_MIN4) constvirtual const
Returns: true if the given point is on this shape.
Reimplemented from isOnShape.
isPeriodic
Section titled “isPeriodic”bool RSpline::isPeriodic() constconst
Returns: True if this spline is periodic, i.e. closed and ‘smooth’ where start and end connect. The tangents at the start point and end point are nearly identical.
isValid
Section titled “isValid”virtual bool RSpline::isValid() constvirtual const
Reimplemented from isValid.
Reimplemented in isValid.
mirror
Section titled “mirror”virtual bool RSpline::mirror(const RLine &axis)virtual
Reimplemented from mirror.
Reimplemented in mirror.
virtual bool RSpline::move(const RVector &offset)virtual
Reimplemented from move.
Reimplemented in move.
operator=
Section titled “operator=”RSpline & RSpline::operator=(const RSpline &other)prependFitPoint
Section titled “prependFitPoint”void RSpline::prependFitPoint(const RVector &point)Prepends a fit point.
removeFirstFitPoint
Section titled “removeFirstFitPoint”void RSpline::removeFirstFitPoint()Removes the first fit point.
removeFitPointAt
Section titled “removeFitPointAt”void RSpline::removeFitPointAt(const RVector &point)removeLastControlPoint
Section titled “removeLastControlPoint”void RSpline::removeLastControlPoint()Removes the last control point.
Parameters:
upd: Update internal spline representation.
removeLastFitPoint
Section titled “removeLastFitPoint”void RSpline::removeLastFitPoint()Removes the last fit point.
reverse
Section titled “reverse”virtual bool RSpline::reverse()virtual
Reimplemented from reverse.
Reimplemented in reverse.
rotate
Section titled “rotate”virtual bool RSpline::rotate(double rotation, const RVector ¢er=RDEFAULT_RVECTOR)virtual
Reimplemented from rotate.
Reimplemented in rotate.
virtual bool RSpline::scale(const RVector &scaleFactors, const RVector ¢er=RDEFAULT_RVECTOR)virtual
Reimplemented from scale.
Reimplemented in scale.
setControlPoints
Section titled “setControlPoints”void RSpline::setControlPoints(const QList< RVector > &points)Sets the control points of this spline.
setDegree
Section titled “setDegree”void RSpline::setDegree(int d)Sets the degree of this spline (2 or 3 for control point defined spline, 3 for fit point defined spline).
setEndPoint
Section titled “setEndPoint”void RSpline::setEndPoint(const RVector &v)setFitPoints
Section titled “setFitPoints”void RSpline::setFitPoints(const QList< RVector > &points)Sets the fit points.
setKnotVector
Section titled “setKnotVector”void RSpline::setKnotVector(const QList< double > &knots)Sets the knot vector manually.
Mainly for importing ready data.
setPeriodic
Section titled “setPeriodic”void RSpline::setPeriodic(bool on)setStartPoint
Section titled “setStartPoint”void RSpline::setStartPoint(const RVector &v)setTangentAtEnd
Section titled “setTangentAtEnd”void RSpline::setTangentAtEnd(const RVector &t)Sets the end tangent.
setTangentAtStart
Section titled “setTangentAtStart”void RSpline::setTangentAtStart(const RVector &t)Sets the start tangent.
setTangents
Section titled “setTangents”void RSpline::setTangents(const RVector &start, const RVector &end)Sets the start and end tangents.
setWeights
Section titled “setWeights”void RSpline::setWeights(QList< double > &w)virtual void RSpline::setZ(double z)virtual
Reimplemented from setZ.
Reimplemented in setZ.
simplify
Section titled “simplify”RSpline RSpline::simplify(double tolerance)splitAt
Section titled “splitAt”virtual QList< QSharedPointer< RShape > > RSpline::splitAt(const QList< RVector > &points) constvirtual const
Splits this spline at the given points.
A point that the spline passes through more than once (a point where the spline crosses itself) splits the spline at every pass: a spline that crosses itself once is split into three pieces at the intersection point, none of which crosses itself. Requires a spline proxy (QCAD Professional), see RSplineProxy::splitAt.
Reimplemented from splitAt.
splitAtParams
Section titled “splitAtParams”QList< RSpline > RSpline::splitAtParams(const QList< double > ¶ms) constconst
splitAtPoints
Section titled “splitAtPoints”QList< RSpline > RSpline::splitAtPoints(const QList< RVector > &points) constconst
stretch
Section titled “stretch”virtual bool RSpline::stretch(const RPolyline &area, const RVector &offset)virtual
Reimplemented from stretch.
Reimplemented in stretch.
toPolyline
Section titled “toPolyline”RPolyline RSpline::toPolyline(int segments) constconst
trimEndPoint
Section titled “trimEndPoint”virtual bool RSpline::trimEndPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)virtual
Parameters:
trimPoint: Trim start point or end point to this coordinate.clickPoint: Point that was clicked by user.extend: True if the shape is to be extended. Used for polylines to determine that the last segment has to be trimmed even if another segment was clicked.
Reimplemented from trimEndPoint.
Reimplemented in trimEndPoint.
trimEndPoint
Section titled “trimEndPoint”virtual bool RSpline::trimEndPoint(double trimDist)virtual inline
Reimplemented from trimEndPoint.
trimStartPoint
Section titled “trimStartPoint”virtual bool RSpline::trimStartPoint(const RVector &trimPoint, const RVector &clickPoint=RVector::invalid, bool extend=false)virtual
Parameters:
trimPoint: Trim start point or end point to this coordinate.clickPoint: Point that was clicked by user.extend: True if the shape is to be extended. Used for polylines to determine that the first segment has to be trimmed even if another segment was clicked.
Reimplemented from trimStartPoint.
Reimplemented in trimStartPoint.
trimStartPoint
Section titled “trimStartPoint”virtual bool RSpline::trimStartPoint(double trimDist)virtual inline
Reimplemented from trimStartPoint.
unsetTangentAtEnd
Section titled “unsetTangentAtEnd”void RSpline::unsetTangentAtEnd()Clears the valud of the end tangent.
The end tangent is calculated and updated internally if not set manually.
unsetTangentAtStart
Section titled “unsetTangentAtStart”void RSpline::unsetTangentAtStart()Clears the valud of the start tangent.
The start tangent is calculated and updated internally if not set manually.
unsetTangents
Section titled “unsetTangents”void RSpline::unsetTangents()Clears the valud of the start and end tangents.
The tangents are calculated and updated internally if not set manually.
update
Section titled “update”void RSpline::update() constconst
updateFromControlPoints
Section titled “updateFromControlPoints”void RSpline::updateFromControlPoints() constconst
updateFromFitPoints
Section titled “updateFromFitPoints”void RSpline::updateFromFitPoints() constconst
Closes this spline and makes it periodic if it isn’t already.
Updates the internal spline data from fitPoints. Degree is always corrected to 3rd degree.
updateTangentsPeriodic
Section titled “updateTangentsPeriodic”void RSpline::updateTangentsPeriodic()Updates the tangents at the start and end to make the spline periodic.
createBezierFromSmallArc
Section titled “createBezierFromSmallArc”static RSpline RSpline::createBezierFromSmallArc(double r, double a1, double a2)static
Cubic bezier approximation of a circular arc centered at the origin, from (radians) a1 to a2, where a2-a1 < pi/2.
The arc’s radius is r.
Returns an spline approximation.
This algorithm is based on the approach described in: A. Riškus, “Approximation of a Cubic Bezier Curve by Circular Arcs and Vice Versa,” Information Technology and Control, 35(4), 2006 pp. 371-378.
createSplinesFromArc
Section titled “createSplinesFromArc”static QList< RSpline > RSpline::createSplinesFromArc(const RArc &arc)static
Returns: List of splines which approximate the given arc.
getSplineProxy
Section titled “getSplineProxy”static RSplineProxy * RSpline::getSplineProxy()static inline
Non-Scriptable: This function is not available in script environments.
hasProxy
Section titled “hasProxy”static bool RSpline::hasProxy()static inline
setSplineProxy
Section titled “setSplineProxy”static void RSpline::setSplineProxy(RSplineProxy *p)static
Non-Scriptable: This function is not available in script environments.
controlPoints
Section titled “controlPoints”QList<RVector> RSpline::controlPointsGetter function for this property: getControlPoints.
Setter function for this property: setControlPoints
degree
Section titled “degree”int RSpline::degreeGetter function for this property: getDegree.
Setter function for this property: setDegree
bool RSpline::dirtyfitPoints
Section titled “fitPoints”QList<RVector> RSpline::fitPointsGetter function for this property: getFitPoints.
Setter function for this property: setFitPoints
knotVector
Section titled “knotVector”QList<double> RSpline::knotVectorGetter function for this property: getKnotVector.
periodic
Section titled “periodic”bool RSpline::periodicClosed periodic flag.
tangentEnd
Section titled “tangentEnd”RVector RSpline::tangentEndUnit vector end tangent.
tangentStart
Section titled “tangentStart”RVector RSpline::tangentStartUnit vector start tangent.
updateInProgress
Section titled “updateInProgress”bool RSpline::updateInProgressweights
Section titled “weights”QList<double> RSpline::weightsGetter function for this property: getWeights.
Setter function for this property: setWeights
appendToExploded
Section titled “appendToExploded”void RSpline::appendToExploded(const RLine &line) constconst protected
invalidate
Section titled “invalidate”void RSpline::invalidate() constconst protected
virtual void RSpline::print(QDebug dbg) constvirtual const protected
Reimplemented from print.
updateBoundingBox
Section titled “updateBoundingBox”void RSpline::updateBoundingBox() constconst protected
Updates the internal bounding box.
updateInternal
Section titled “updateInternal”void RSpline::updateInternal() constconst protected
boundingBox
Section titled “boundingBox”RBox RSpline::boundingBoxprivate
ON_NurbsCurve RSpline::curveprivate
exploded
Section titled “exploded”QList<QSharedPointer<RShape> > RSpline::explodedprivate
length
Section titled “length”double RSpline::lengthprivate
splineProxy
Section titled “splineProxy”static RSplineProxy * RSpline::splineProxy = NULLstatic private