Part Part2DObject: Difference between revisions

From FreeCAD Documentation
(New page to describe the base Part::Part2DObject, which can be used to derive many planar scripted objects.)
 
(→‎Introduction: This plane is defined by its DATAPlacement property (position, normal, and rotation). However, the plane can also be defined by supporting geometrical elements, such as the plane created by three arbitrary vertices, or a face of a solid)
Line 6: Line 6:
A [[Part Part2DObject|Part Part2DObject]], or formally a {{incode|Part::Part2DObject}}, is a simple element with a topological {{incode|Shape}} associated that can be displayed in the [[3D view|3D view]].
A [[Part Part2DObject|Part Part2DObject]], or formally a {{incode|Part::Part2DObject}}, is a simple element with a topological {{incode|Shape}} associated that can be displayed in the [[3D view|3D view]].


The {{incode|Part::Part2DObject}} is derived from [[Part Feature|{{incode|Part::Feature}}]], but it is specialized to be used for 2D geometry, given that its shape will lie of a plane. This plane can be changed by its {{PropertyData|Placement}}; moreover, it also allows attaching to a face in order to define the new position of this plane.
The {{incode|Part::Part2DObject}} is derived from a [[Part Feature|{{incode|Part::Feature}}]], but it is specialized for 2D geometry, given that its shape will lie on a plane. This plane is defined by its {{PropertyData|Placement}} property (position, normal, and rotation). However, the plane can also be defined by supporting geometrical elements, such as the plane created by three arbitrary vertices, or a face of a solid body.


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


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

Revision as of 20:42, 1 October 2019

Introduction

A Part Part2DObject, or formally a Part::Part2DObject, is a simple element with a topological Shape associated that can be displayed in the 3D view.

The Part::Part2DObject is derived from a Part::Feature, but it is specialized for 2D geometry, given that its shape will lie on a plane. This plane is defined by its DataPlacement property (position, normal, and rotation). However, the plane can also be defined by supporting geometrical elements, such as the plane created by three arbitrary vertices, or a face of a solid body.

The Part::Part2DObject 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) in the Sketcher Workbench, and for most objects created in 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.

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

Data

  • DataMap Mode: "Deactivated" by default. This determines a plane to which the object can be attached. 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.

View

  • ViewGrid Size: a float that determines the size of a grid in the 3D view.
  • ViewGrid Snap: if true the grid can be used to snap points.
  • ViewGrid Style: Dashed or Light; the style of the grid lines.
  • ViewShow Grid: if true a local grid to the object will be displayed in the 3D view.
  • ViewTight Grid: if true the local grid will be compact, otherwise it will extend itself more.