Part Part2DObject/de

Einleitung


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

Das ist von einem Part Feature abgeleitet, ist aber auf 2D Geometrie spezialisiert, da seine Form auf einer Ebene liegen wird. Diese Ebene wird durch die 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 Eckpunkte erzeugt wird, oder eine Fläche eines Volumenkörpers.



Kurzanleitung
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.

The is defined in the Part Workbench but can be used as the base class for scripted objects in all workbenches that produce 2D geometrical shapes. For example, it is the base object for sketches (Sketcher SketchObject), and for most objects created with the Draft Workbench.

Workbenches can add more properties to this basic element to produce an object with complex behavior.

Properties
See Property for all property types that scripted objects can have.

A Part Part2DObject ( class) is derived from a Part Feature ( class), therefore it shares all the latter's properties.

In addition to the properties described in Part Feature, the Part Part2DObject has the following properties in the property editor.

Data

 * : 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:, , , , , , , , , , , , , , , , , , , , , ,.

See Part Attachment for more information on all mapping modes.

The following two properties are normally hidden. They become visible once is something other than.
 * : it defaults to ; if it is the Z direction will be reversed. For example, a sketch will be flipped upside down.
 * : the position of the object in the 3D view, with respect to the attachment object's placement. The placement is defined by a point (vector), and a  (axis and angle). See Placement.

Hidden properties Data

 * : class name of the attach engine object driving the attachment. It defaults to.
 * : it is the plane or face supporting the 2D geometry. It defaults to an empty list.
 * : sets point of curve to map a sketch to. It goes from to, which corresponds to the  and . It defaults to.

View

 * : the size of the spacing of the local grid lines in the 3D view; it defaults to.
 * : it defaults to ; if the grid can be used to snap points.
 * : the style of the grid lines; (default) or.
 * : it defaults to ; if a grid local to the object will be displayed in the 3D view. This grid is independent of the Draft grid.
 * : if (default) the local grid will be localized around the origin of the shape, otherwise it will extend itself more.

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

Scripting
FreeCAD Scripting Basics, and scripted objects.

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

A Part2DObject is created with the method of the document.

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

Therefore, for Python scripting, the recommendation is to create the object.

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