This is an old revision of the document!
Line (line segment) is defined with its two vertices.
line = curveset.add( Line(number, pt1, pt2) )
| ||user number (unique among Points and $\ge 1$)|
| || the 2
Arc of circle is defined using three points, as shown on the figure.
arc = curveset.add( Arc(number, pt1, pt2, pt3) )
spl = curveset.add( CubicSpline(number, [pt1, pt2, pt3, pt4]) ) spl.useLsTangent() # tangents are calculated # using local reconstruction [DEFAULT] spl.useLittTangents() # tangents are calculated # using Litt/Beckers lectures
To close a spline, the first and last points of the list must be the same.
spl = CubicSpline(number, [pt1, pt2, pt3, pt4, ..., pt1])
spl = CubicSpline(number, obj)
obj is a meshed object.
A circle is defined with its center and radius (this function is only defined in the $z=0$ plane)
circ2d = curset.add( Circle(number, pt1, radius) )
The orientation of the circle can be inverted (and so will its tangent and normal used for contact):
A Non-Uniform Rational Basis Spline (N.U.R.B.S.) is defined as:
nur = curset.add( NurbsCurve(number) ) nur.setDegree(degree) nur.push(pt1); nur.pushWeight(weight1) nur.push(pt2); nur.pushWeight(weight2) nur.pushKnot(knot1) nur.pushKnot(knot2)
| ||curve number|
| ||degré de la coube|
| ||knot vector|
| ||Boolean to determine whether the Nurb is closed|
| ||GObject support of a topology (curve,wire,group)|
If a curve cannot be defined with the functions above, it can be programmed in python using the generic Curve called
.push() is used to add points, and it possesses four member functions that can be overloaded. The method named
setEval(fct) is used to defined the evaluation python function. The methods named
setLen() respectively define the tangent, its derivative and the curvilinear abscissa. The function
setEval(fct) is the only one required to mesh the curve, when the other three are used for contact.
toolbox.curves which defines a
Parabola. The input file
apps.qs.parabola is an example of application.
from toolbox.curves import Parabola parab = curset.add(Parabola(1, pt1, pt6, pt2))
These lines create a parabola #1, based on the three previously defined points