Metafor

ULiege - Aerospace & Mechanical Engineering

User Tools

Site Tools


doc:user:geometry:user:courbes

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:user:geometry:user:courbes [2015/01/07 16:22]
boman
doc:user:geometry:user:courbes [2016/03/30 15:23] (current)
Line 10: Line 10:
 {{ doc:user:doc-courbe.png?300 |}} {{ doc:user:doc-courbe.png?300 |}}
  
-===== Line: straight segment =====+===== Line: Straight Segment =====
  
-{{ doc:user:doc-droite.png|}}+{{ doc:user:doc-droite.png |}}
  
 A ''Line'' (line segment) is defined with its two vertices. A ''Line'' (line segment) is defined with its two vertices.
Line 18: Line 18:
   line = curveset.add( Line(number, pt1, pt2) )    line = curveset.add( Line(number, pt1, pt2) )
  
-\\ +with 
-\\+| ''number''          | user number (unique among Curves and $\ge 1$)  | 
 +| ''pt1'',''pt2''     | the 2 ''Points'' used as vertices              |
  
 +===== Arc: Arc of Circle ===== 
  
-===== Arc =====  +{{ doc:user:doc-arc.png |}}
- +
-{{ doc:user:doc-arc.png|}}+
  
 An ''Arc'' of circle is defined using three points, as shown on the figure. An ''Arc'' of circle is defined using three points, as shown on the figure.
Line 30: Line 30:
   arc = curveset.add( Arc(number, pt1, pt2, pt3) )   arc = curveset.add( Arc(number, pt1, pt2, pt3) )
  
-\\ +with 
-\+| ''number''                  | user number (unique among Curves and $\ge 1$)  | 
- +| ''pt1'',''pt2'',''pt3''     | the 3 ''Points''              |
  
  
 ===== Cubic Spline ===== ===== Cubic Spline =====
  
-{{ doc:user:doc-spline.png|}}+{{ doc:user:doc-spline.png |}}
  
-==== "Open" cubic spline ====+==== "Open" Cubic Spline ====
  
   spl = curveset.add( CubicSpline(number, [pt1, pt2, pt3, pt4]) )    spl = curveset.add( CubicSpline(number, [pt1, pt2, pt3, pt4]) )
-  spl.useLsTangent()    # tangents are calculated +  spl.useLsTangent()    # tangents are computed 
                         # using local reconstruction [DEFAULT]                         # using local reconstruction [DEFAULT]
-  spl.useLittTangents() # tangents are calculated +  spl.useLittTangents() # tangents are computed 
                         # using Litt/Beckers lectures                         # using Litt/Beckers lectures
                                              
-  +with 
 +| ''number''          | user number (unique among Curves and $\ge 1$)  | 
 +| ''pt1'',''pt2'',''pt3'',...     | the list of ''Points''              | 
 ==== "Closed" Cubic Spline ==== ==== "Closed" Cubic Spline ====
  
Line 54: Line 56:
  
   spl = CubicSpline(number, [pt1, pt2, pt3, pt4, ..., pt1])   spl = CubicSpline(number, [pt1, pt2, pt3, pt4, ..., pt1])
- 
-or, if the curve is defined based on a mesh, the mesh must be chosen closed. 
  
 ==== Spline-reconstruction based on a mesh ==== ==== Spline-reconstruction based on a mesh ====
  
-{{  :doc:user:ico-advanced.png?40|Advanced}}+{{:doc:user:ico-advanced.png?40 |Advanced}}
 It is possible to construct a spline based on the mesh of a line. This way, a smooth approximation of this mesh if obtained. It is possible to construct a spline based on the mesh of a line. This way, a smooth approximation of this mesh if obtained.
  
Line 66: Line 66:
 where ''obj'' is a meshed object. where ''obj'' is a meshed object.
  
-===== Full Circle ===== +===== Circle: Full Circle ===== 
  
-{{ doc:user:doc-cercle.png|}}+{{ doc:user:doc-cercle.png |}}
  
 A circle is defined with its center and radius (this function is only defined in the $z=0$ plane) A circle is defined with its center and radius (this function is only defined in the $z=0$ plane)
  
-  circ2d = curset.add( Circle(number, pt1radius) )+  circ2d = curset.add( Circle(number, centreR) )
  
-The orientation of the circle can be inverted (and so will its tangent and normal used for contact):+with 
 +| ''number''  | user number (unique among Curves and $\ge 1$ | 
 +| ''centre''  | centre ''Point''                               | 
 +| ''R''       | radius                                         |
  
 +The orientation of the ''Circle'' can be inverted (and so will its tangent and normal used for contact):
   circ2d.reverse()         circ2d.reverse()      
  
  
  
-==== NURBS ====+===== NURBS =====
  
-A Non-Uniform Rational Basis Spline (Nurb) is defined as:+A Non-Uniform Rational Basis Spline (N.U.R.B.S.) is defined as:
  
-{{ doc:user:doc-nurbs.png|}}+{{ doc:user:doc-nurbs.png |}}
  
   nur = curset.add( NurbsCurve(number) )   nur = curset.add( NurbsCurve(number) )
Line 95: Line 99:
 where where
 |< 30em - >| |< 30em - >|
-| ''number''curve number | +| ''number''user number (unique among Curves and $\ge 1$)  |
 | ''pt1'', ''pt2'' | ''[[doc:user:geometry:user:points]]'' used as supports |  | ''pt1'', ''pt2'' | ''[[doc:user:geometry:user:points]]'' used as supports | 
 | ''degree'' | degré de la coube |  | ''degree'' | degré de la coube | 
 | ''weight1'', ''weight2'' | weights|  | ''weight1'', ''weight2'' | weights| 
 | ''knot1'', ''knot2'' | knot vector |  | ''knot1'', ''knot2'' | knot vector | 
-| ''closed'' | Boolean to determine whether the Nurb is closed |  
-| ''obj'' | GObject support of a topology (curve,wire,group) |  
  
  
-===== Interpreted curves ===== +===== PythonCurve: Python-interpreted Curves ===== 
-{{  :doc:user:ico-advanced.png?18|Advanced}}+{{:doc:user:ico-advanced.png?40 |Advanced}} 
 + 
 +If a ''Curve'' is not implemented in Metafor, it can be programmed in [[doc:user:general:glossaire#python]] using the generic Curve called ''PythonCurve''
 + 
 +The method ''.push()'' is used to add points.
  
-If a curve cannot be defined with the functions above, it can be programmed in [[doc:user:general:glossaire#python]], to avoid having to enter Metafor source code.+''PythonCurve'' possesses four member functions that can be overloaded. The method named ''setEval(fct)'' is used to defined the evaluation [[doc:user:tutorials:tuto0#fonctions|python function]]. The methods named ''setTg''''setDTg'' and''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.
  
-''PythonCurve'' is the object to use. It is a regular curve, ''.push()'' is used to add points, and it possesses four functions that can be parametrized. ''setEval(fct)'' is used to defined the evaluation [[doc:user:tutorials:tuto0#fonctions|python function]]. +__Example:__ 
-''setTg'', ''setDTg'' and''setLen()'' respectively define the tangent, its derivative and the curvilinear abscissa. The function ''setEval(fct)'' is required to mesh the curve, when the other three are used for contact.+
  
-Once this new curve is defined, it can be shaped as the already existing one, with a class. For example, if a parabola has just been defined (cfr. ''toolbox.curves''), it can be used quite simply in test case (cfr. ''apps.qs.parabola''):+See ''toolbox.curves'' which defines ''Parabola''The input file ''apps.qs.parabola'' is an example of application.
  
   from toolbox.curves import Parabola   from toolbox.curves import Parabola
   parab = curset.add(Parabola(1, pt1, pt6, pt2))   parab = curset.add(Parabola(1, pt1, pt6, pt2))
  
-These lines create a parabola of user number 1, based on the three previously defined point pt1, pt6 and pt2.+These lines create a parabola #1, based on the three previously defined points ''pt1''''pt6'' and ''pt2''.
  
  
doc/user/geometry/user/courbes.1420644150.txt.gz · Last modified: 2016/03/30 15:22 (external edit)