Vector API: Difference between revisions
(Marked this version for translation) |
Renatorivo (talk | contribs) No edit summary |
||
Line 3: | Line 3: | ||
<!--T:1--> |
<!--T:1--> |
||
{{VeryImportantMessage|(November 2018) This information may be incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation].}} |
{{VeryImportantMessage|(November 2018) This information may be incomplete and outdated. For the latest API, see the [https://www.freecadweb.org/api autogenerated API documentation].}} |
||
Vectors are used everywhere in FreeCAD. |
Vectors are used everywhere in FreeCAD. |
||
Revision as of 22:56, 3 March 2019
Vectors are used everywhere in FreeCAD.
Example:
v=FreeCAD.Vector()
v=FreeCAD.Vector(1,0,0)
v=FreeCAD.Base.Vector()
v2 = FreeCAD.Vector(3,2,-5)
v3 = v.add(v2)
print v3.Length
Description: the distance between the vector and a line through Vector1 in direction Vector2.
Returns: float
Description: a vector to the closest point on a line segment from Vector1 to Vector2.
Returns: vector
Description: the distance between the vector and a plane defined by a point and a normal.
Returns: float
Description: multiplies (uniform scale) a vector by the given factor.
Returns: nothing
Description: projects the vector on a line through Vector1 in direction Vector2.
Returns: nothing
Description: projects the vector on a plane defined by a point (Vector1) and a normal (Vector2).
Returns: nothing
Description: Same as multiply but lets specify different values for x, y and z directions. (non-uniform scale)
Returns: nothing