Placement API/ro: Difference between revisions

From FreeCAD Documentation
(Created page with "În FreeCAD, Plasarea definește poziția și rotația unui obiect. Conceptul de Plasament este explicat în detaliu aici: Plasament.")
 
(Created page with "Exemplu de setare a destinației de plasare a obiectului de document:")
Line 2: Line 2:
În FreeCAD, Plasarea definește poziția și rotația unui obiect. Conceptul de Plasament este explicat în detaliu aici: Plasament.
În FreeCAD, Plasarea definește poziția și rotația unui obiect. Conceptul de Plasament este explicat în detaliu aici: Plasament.


Exemplu de setare a destinației de plasare a obiectului de document:
Example of setting a document object's Placement:
{{Code|code=
{{Code|code=
myObj = FreeCAD.ActiveDocument.ActiveObject
myObj = FreeCAD.ActiveDocument.ActiveObject

Revision as of 13:02, 31 January 2019

În FreeCAD, Plasarea definește poziția și rotația unui obiect. Conceptul de Plasament este explicat în detaliu aici: Plasament.

Exemplu de setare a destinației de plasare a obiectului de document:

myObj = FreeCAD.ActiveDocument.ActiveObject
pl = FreeCAD.Placement()
pl.move(FreeCAD.Vector(2,0,0))
myObj.Placement = pl


Placement( ) or (Placement) or (Matrix) or (Base, Rotation) or (Base,Rotation,Center) or (Base,Axis,Angle)

Description: Constructs a placement, empty or with the given arguments, or as a copy of the given placement.

Base

Returns: a vector representing the Placement's position.

Rotation

Returns: a quaternion representing the Placement's rotation.

inverse( )

Description: computes the inverse placement

Returns: a placement.

move(Vector)

Description: moves the Placement along the given vector

Returns: nothing

multVec(Vector)

Description: applies the Placement to the given vector

Returns: the resulting vector.

multiply(Placement)

Description: multiplies this placement with another one

Returns: the resulting placement.

toMatrix( )

Description:

Returns: a matrix representing the Placement's transformation.