Modificare: Poziționarea ...
|
|
| Menu location |
|---|
| Edit → Placement... |
| Workbenches |
| All |
| Default shortcut |
| None |
| Introduced in version |
| - |
| See also |
| Tasks Placement, Placement |
Descriere
Placement este modul în care FreeCAD specifică locația și atitudinea (orientarea) unui obiect în spațiu. Placement can be specified in multiple forms and manipulated via scripting, the Properties panel or the Edit → Placement... dialog.
The Placement task panel
Utilizare
- Short description
- Select an object in the tree view.
- In the Edit menu, select Placements...
- Change the parameters for the translation or rotation, according to the desired action.
- Click OK or Apply
- For a full description see Tasks Placement and Placement
- Select a single object that has a DatePlacement property.
- Select the Edit →
Placement option from the menu.
- Change one or more of the translation and rotation parameters.
- Do one of the following:
- Press the OK button to apply the changes and close the task panel.
- Press the Apply button to apply the changes, but keep the task panel open for further changes.
- Press Esc or the Cancel button to abort the operation. This will undo any changes that have not been applied.
The dialog can also be launched by clicking on the ellipsis button … that appears in the Property View when you click on the DatePlacement property.
Notes
- For more information about the placement parameters see the Placement page, and the Aeroplane tutorial.
- The rotation angle can be set in degrees in the GUI but is stored in radians internally so that angles usually have to be converted when used in scripts.
Scripting
See also: Autogenerated API documentation and FreeCAD Scripting Basics.
See the Python scripting tutorial.
A placement is internally defined by a matrix; in many cases it is simpler to represent it by means of two components, a Base point (vector), and a Rotation value. The Rotation itself has different representations; it can be entirely defined by the value of a "quaternion" (xi + yj + zk + w), but it can also be described by a rotation Axis (unit vector) and a rotation Angle (radians).
import FreeCAD as App
doc = App.newDocument()
obj = doc.addObject("Part::Cylinder", "Cylinder")
print(obj.Placement)
# Placement [Pos=(0,0,0), Yaw-Pitch-Roll=(0,0,0)]
print(obj.Placement.Base)
# Vector (0.0, 0.0, 0.0)
print(obj.Placement.Rotation)
# Rotation (0.0, 0.0, 0.0, 1.0)
print(obj.Placement.Rotation.Angle)
# 0.0
print(obj.Placement.Rotation.Axis)
# Vector (0.0, 0.0, 1.0)
print(obj.Placement.Rotation.Q)
# (0.0, 0.0, 0.0, 1.0)
Move the base point of the object, then rotate the object 45 degrees around the X-axis.
The math module supplies a method radians() to easily convert degrees to radians and has to be imported at first.
import math
obj.Placement.Base = App.Vector(5, 3, 1)
obj.Placement.Rotation.Axis = App.Vector(1, 0, 0)
obj.Placement.Rotation.Angle = math.radians(45)
print(obj.Placement)
# Placement [Pos=(5,3,1), Yaw-Pitch-Roll=(0,0,45)]
print(obj.Placement.Rotation.Q)
# (0.3826834323650898, 0.0, 0.0, 0.9238795325112867)
print(obj.Placement.Matrix)
# Matrix ((1,0,0,5),(0,0.707107,-0.707107,3),(0,0.707107,0.707107,1),(0,0,0,1))
To rotate the object 90 degrees around both the X-axis and Z-axis, obj.Placement.Rotation.setYawPitchRoll can be used.
obj.Placement.Base = App.Vector(5, 3, 1)
obj.Placement.Rotation.Axis = App.Vector(1, 0, 0)
obj.Placement.Rotation.setYawPitchRoll(90, 0, 90)
print(obj.Placement)
# Placement [Pos=(5,3,1), Yaw-Pitch-Roll=(90,0,90)]
- File: New Document, Open, Open Recent, Close, Close All, Save, Save As, Save Copy, Save All, Revert, Import, Export,Merge Document, Document Information, Print, Print Preview, Export PDF, Exit
- Edit: Undo, Redo, Cut, Copy, Paste, Duplicate Object, Recompute, Box Selection, Box Element Selection, Select All, Delete, Send to Python Console, Placement, Transform, Align To, Toggle Edit Mode, Properties, Edit Mode, Preferences
- View:
- Miscellaneous: New 3D View, Orthographic View, Perspective View, Fullscreen, Bounding Box, Toggle Axis Cross, Clipping View, Texture Mapping, Toggle Navigation/Edit Mode, Material, Appearance, Random Color, Appearance per Face, Toggle Transparency, Workbench, Status Bar
- Standard Views: Fit All, Fit Selection, Align to Selection, Isometric, Dimetric, Trimetric, Home, Front, Top, Right, Rear, Bottom, Left, Rotate Left, Rotate Right, Store Working View, Recall Working View
- Freeze Display: Save Views, Load Views, Freeze View, Clear Views
- Draw Style: As Is, Points, Wireframe, Hidden Line, No Shading, Shaded, Flat Lines
- Stereo: Stereo Red/Cyan, Stereo Quad Buffer, Stereo Interleaved Rows, Stereo Interleaved Columns, Stereo Off, Issue Camera Position
- Zoom: Zoom In, Zoom Out, Box Zoom
- Document Window: Docked, Undocked, Fullscreen
- Visibility: Toggle Visibility, Show Selection, Hide Selection, Select Visible Objects, Toggle All Objects, Show All Objects, Hide All Objects, Toggle Selectability
- Toolbars: File, Edit, Clipboard, Workbench, Macro, View, Individual Views, Structure, Help, Lock Toolbars
- Panels: Tree View, Property View, Model, Selection View, Python Console, Report View, Tasks, DAG View
- Overlay Docked Panel: Toggle Overlay for All Panels, Toggle Transparent Panels, Toggle Overlay, Toggle Transparent Mode, Bypass Mouse Events in Overlay Panels, Toggle Left, Toggle Right, Toggle Top, Toggle Bottom
- Link Navigation: Go to Linked Object, Go to Deepest Linked Object, Select All Links
- Tree View Actions: Sync View, Sync Selection, Sync Placement, Preselection, Record Selection, Single Document, Multi Document, Collapse/Expand, Initiate Dragging, Go to Selection, Selection Back, Selection Forward
- Tools: Addon Manager, Measure, Clarify Selection, Quick Measure, Units Converter, Load Image, Save Image, Text Document, View Turntable, Scene Inspector, Dependency Graph, Export Dependency Graph, Document Utility, Edit Parameters, Customize
- Macro: Record Macro, Macros, Recent Macros, Execute Macro, Attach to Remote Debugger, Debug Macro, Stop Debugging, Step Over, Step Into, Toggle Breakpoint
- Help: What's This, Start Page, Users Documentation, FreeCAD Forum, Report an Issue, Restart in Safe Mode, Developers Handbook, Python Modules Documentation, FreeCAD Website, Donate to FreeCAD, About FreeCAD
- Additional:
- Miscellaneous: New Part, New Group, Variable Set, Link Group, Select All Instances, Toggle Freeze
- Datums: Coordinate System, Datum Plane, Datum Line, Datum Point
- Link Actions: Make Link, Make Sub-Link, Replace With Link, Unlink, Import Link, Import All Links
- Expression Actions: Copy Selected, Copy Active Document, Copy All Documents, Paste
- Selection Filter: Vertex Selection, Edge Selection, Face Selection, No Selection Filters
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Assembly, BIM, CAM, Draft, FEM, Inspection, Material, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub
