Part Part2DObject/de: Difference between revisions

From FreeCAD Documentation
(Created page with "Ein Part Teil2DObjekt ({{incode|PartDesign::Body}} Klasse) wird von einem Part Formelement ({{incode|Part::Feature}} Klasse) abge...")
(Created page with "Zusätzlich zu den in Part Formelement beschriebenen Eigenschaften hat das Part Teil2DObjekt im Eigenschaftseditor die folgenden Eig...")
Line 27: Line 27:
Ein [[Part_Part2DObject/de|Part Teil2DObjekt]] ({{incode|PartDesign::Body}} Klasse) wird von einem [[Part_Feature/de|Part Formelement]] ({{incode|Part::Feature}} Klasse) abgeleitet, daher teilt sie alle Eigenschaften der letzteren.
Ein [[Part_Part2DObject/de|Part Teil2DObjekt]] ({{incode|PartDesign::Body}} Klasse) wird von einem [[Part_Feature/de|Part Formelement]] ({{incode|Part::Feature}} Klasse) abgeleitet, daher teilt sie alle Eigenschaften der letzteren.


In addition to the properties described in [[Part Feature|Part Feature]], the Part Part2DObject has the following properties in the [[property editor|property editor]]. Hidden properties can be shown by using the {{MenuCommand|Show all}} command in the context menu of the [[property editor|property editor]].
Zusätzlich zu den in [[Part Feature/de|Part Formelement]] beschriebenen Eigenschaften hat das Part Teil2DObjekt im [[property editor/de|Eigenschaftseditor]] die folgenden Eigenschaften. Ausgeblendete Eigenschaften können unter Verwendung des {{MenuCommand/de|Alles anzeigen}} Befehl im Kontextmenü des [[property editor/de|Eigenschaftseditor]] angezeigt werden.


=== Data ===
=== Data ===

Revision as of 08:30, 21 August 2020

Einführung

Ein Part Teil2DObjekt, oder formal ein Part::Part2DObject, ist ein einfaches Element mit einer topologische Form, das in der 3D Ansicht angezeigt werden kann.

Das Part::Part2DObject ist von einem Part Formelement abgeleitet, ist aber auf 2D Geometrie spezialisiert, da seine Form auf einer Ebene liegen wird. Diese Ebene wird durch die Daten-EigenschaftPlatzierung Eigenschaft definiert (Position, Normale und Rotation). Die Ebene kann aber auch durch unterstützende geometrische Elemente definiert werden, wie z.B. die Ebene, die durch drei beliebige Knoten erzeugt wird, oder eine Fläche eines Volumenkörpers.

Vereinfachtes Diagramm der Beziehungen zwischen den Kernobjekten im Programm. Die Klasse Part::Part2DObject ist auf 2D Formen spezialisiert, so dass sie die Basisklasse für planare Objekte ist, die mit den Werkbänken Draft und Sketcher erstellt werden. Sie enthält eine Erweiterung, mit der sie an Flächen und Ebenen angehängt werden kann.

Anwendung

Das Part2DObject ist ein internes Objekt, kann also nicht von der grafischen Oberfläche aus erzeugt werden, sondern nur von der Python Konsole, wie im Abschnitt Scripting beschrieben.

Das Part::Part2DObject ist im Part Arbeitsbereich festgelegt, kann aber als Basisklasse für geskriptete Objekte in allen Arbeitsbereichen die geometrische 2D Formen erzeugen, verwendet werden. Beispielsweise ist sie das Basisobjekt für Skizzen (Skizzierer SkizzeObjekt), und für die meisten Objekte, die mit der Draft Workbench erstellt werden.

Arbeitsbereiche können diesem Grundelement weitere Eigenschaften hinzufügen, um ein Objekt mit komplexem Verhalten zu erzeugen.

Eigenschaften

Siehe Eigenschaft für alle Eigenschaftstypen, die geskriptete Objekte haben können.

Ein Part Teil2DObjekt (PartDesign::Body Klasse) wird von einem Part Formelement (Part::Feature Klasse) abgeleitet, daher teilt sie alle Eigenschaften der letzteren.

Zusätzlich zu den in Part Formelement beschriebenen Eigenschaften hat das Part Teil2DObjekt im Eigenschaftseditor die folgenden Eigenschaften. Ausgeblendete Eigenschaften können unter Verwendung des Template:MenuCommand/de Befehl im Kontextmenü des Eigenschaftseditor angezeigt werden.

Data

Attachment

  • DatenMap Mode (Enumeration): Deactivated by default. This property determines a plane which the object will use as reference for 2D geometry. Clicking on the ellipsis ... (three dots), to the right of the entry field opens the Part Attachment task panel that allows selecting the supporting plane by picking different elements in the 3D view. The different modes are: Deactivated, Translate origin, Object's XY, Object's XZ, Object's YZ, Plane face, Tangent to surface, Normal to edge, Frenet NB, Frenet TN, Frenet TB, Concentric, Revolution section, Plane by 3 points, Normal to 3 points, Folding, Inertia 2-3, Align O-N-X, Align O-N-Y, Align O-X-Y, Align O-X-N, Align O-Y-N, Align O-Y-X.

See Part Attachment for more information on all mapping modes.

The following two properties are normally hidden. They become visible once DatenMap Mode is something other than Deactivated.

  • DatenMap Reversed (Bool): it defaults to false; if it is true the Z direction will be reversed. For example, a sketch will be flipped upside down.
  • DatenAttachment Offset (Placement): the position of the object in the 3D view, with respect to the attachment object's placement. The placement is defined by a Base point (vector), and a Rotation (axis and angle). See Placement.

Hidden properties Data

Base

  • DatenProxy (PythonObject): a custom class associated with this object. This only exists for the Python version. See Scripting.

Attachment

  • DatenAttacher Type (String): class name of the attach engine object driving the attachment. It defaults to Attacher::AttachEnginePlane.
  • DatenSupport (LinkSubList): it is the plane or face supporting the 2D geometry. It defaults to an empty list [].
  • DatenMap Path Parameter (Float): sets point of curve to map a sketch to. It goes from 0 to 1, which corresponds to the start and end. It defaults to 0.

View

Grid

  • AnsichtGrid Size (Length): the size of the spacing of the local grid lines in the 3D view; it defaults to 10 mm.
  • AnsichtGrid Snap (Bool): it defaults to false; if true the grid can be used to snap points.
  • AnsichtGrid Style (Enumeration): the style of the grid lines; Dashed (default) or Light.
  • AnsichtShow Grid (Bool): it defaults to false; if true a grid local to the object will be displayed in the 3D view. This grid is independent of the Draft Grid.
  • AnsichtTight Grid (Bool): if true (default) the local grid will be localized around the origin of the shape, otherwise it will extend itself more.

Hidden properties View

Base

  • AnsichtProxy (PythonObject): a custom view provider class associated with this object. This only exists for the Python version. See Scripting.

All other view properties, including hidden properties, are those of the base Part Feature object.

Scripting

See also: FreeCAD Scripting Basics, and scripted objects.

See Part Feature for the general information on adding objects to the document.

A Part2DObject is created with the addObject() method of the document.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("Part::Part2DObject", "Name")
obj.Label = "Custom label"

This basic Part::Part2DObject doesn't have a Proxy object so it can't be fully used for sub-classing.

Therefore, for Python subclassing, you should create the Part::Part2DObjectPython object.

import FreeCAD as App

doc = App.newDocument()
obj = App.ActiveDocument.addObject("Part::Part2DObjectPython", "Name")
obj.Label = "Custom label"

For example, most tools from the Draft Workbench, like Draft Line, Draft Rectangle, Draft Polygon, etc., are Part::Part2DObjectPython objects with a custom icon and additional properties.