Trace:

doc:user:geometry:user:courbes

This shows you the differences between two versions of the page.

doc:user:geometry:user:courbes [2015/01/07 17:30] boman [PythonCurve: Python-interpreted Curves] |
doc:user:geometry:user:courbes [2016/03/30 15:23] |
||
---|---|---|---|

Line 1: | Line 1: | ||

- | | ||

- | ====== Curves ====== | ||

- | ===== Introduction ===== | ||

- | |||

- | * '' | ||

- | * A curve orientation is given by the succession if its points. For example, a straight line is oriented from its first point towards its second point. This orientation is relevant when defining contact matrices, for instance. For 2D rigid-deformable contact, a curve must be defined with "area to the left", which means that the normal must point towards the inside of the matter (also applicable with '' | ||

- | * The normal of a curve is defined such as $\boldsymbol{t} \wedge \boldsymbol{n} = (0,0,1)$. | ||

- | |||

- | {{ doc: | ||

- | |||

- | ===== Line: straight segment ===== | ||

- | |||

- | {{ doc: | ||

- | |||

- | A '' | ||

- | |||

- | line = curveset.add( Line(number, | ||

- | |||

- | with | ||

- | | '' | ||

- | | '' | ||

- | |||

- | ===== Arc ===== | ||

- | |||

- | {{ doc: | ||

- | |||

- | An '' | ||

- | |||

- | arc = curveset.add( Arc(number, pt1, pt2, pt3) ) | ||

- | |||

- | with | ||

- | | '' | ||

- | | '' | ||

- | |||

- | |||

- | ===== Cubic Spline ===== | ||

- | |||

- | {{ doc: | ||

- | |||

- | ==== " | ||

- | |||

- | spl = curveset.add( CubicSpline(number, | ||

- | spl.useLsTangent() | ||

- | # using local reconstruction [DEFAULT] | ||

- | spl.useLittTangents() # tangents are calculated | ||

- | # using Litt/ | ||

- | | ||

- | with | ||

- | | '' | ||

- | | '' | ||

- | |||

- | ==== " | ||

- | |||

- | To close a spline, the first and last points of the list must be the same. | ||

- | |||

- | spl = CubicSpline(number, | ||

- | |||

- | ==== Spline-reconstruction based on a mesh ==== | ||

- | |||

- | {{ : | ||

- | It is possible to construct a spline based on the mesh of a line. This way, a smooth approximation of this mesh if obtained. | ||

- | |||

- | spl = CubicSpline(number, | ||

- | |||

- | where '' | ||

- | |||

- | ===== Full Circle ===== | ||

- | |||

- | {{ doc: | ||

- | |||

- | A circle is defined with its center and radius (this function is only defined in the $z=0$ plane) | ||

- | |||

- | circ2d = curset.add( Circle(number, | ||

- | |||

- | with | ||

- | | '' | ||

- | | '' | ||

- | | '' | ||

- | |||

- | The orientation of the '' | ||

- | circ2d.reverse() | ||

- | |||

- | |||

- | |||

- | ===== NURBS ===== | ||

- | |||

- | A Non-Uniform Rational Basis Spline (N.U.R.B.S.) is defined as: | ||

- | |||

- | {{ doc: | ||

- | |||

- | nur = curset.add( NurbsCurve(number) ) | ||

- | nur.setDegree(degree) | ||

- | nur.push(pt1); | ||

- | nur.push(pt2); | ||

- | nur.pushKnot(knot1) | ||

- | nur.pushKnot(knot2) | ||

- | |||

- | where | ||

- | |< 30em - >| | ||

- | | '' | ||

- | | '' | ||

- | | '' | ||

- | | '' | ||

- | | '' | ||

- | |||

- | |||

- | ===== PythonCurve: | ||

- | {{: | ||

- | |||

- | If a '' | ||

- | |||

- | The method '' | ||

- | |||

- | '' | ||

- | |||

- | __Example: | ||

- | |||

- | See '' | ||

- | |||

- | from toolbox.curves import Parabola | ||

- | parab = curset.add(Parabola(1, | ||

- | |||

- | These lines create a parabola #1, based on the three previously defined points '' | ||

- | |||

- | |||

- | |||

- | |||

- |

doc/user/geometry/user/courbes.txt · Last modified: 2016/03/30 15:23 (external edit)