Part Part2DObject/it: Difference between revisions

From FreeCAD Documentation
(Created page with "Vedere Proprietà per tutti i tipi di proprietà che possono avere gli oggetti con script.")
(Created page with "Un Part Part2DObject (classe {{incode|Part::Part2DObject}}) è derivato da una Part Feature (classe {{incode|Part::Feature}}), per...")
Line 25: Line 25:
Vedere [[Property/it|Proprietà]] per tutti i tipi di proprietà che possono avere gli oggetti con script.
Vedere [[Property/it|Proprietà]] per tutti i tipi di proprietà che possono avere gli oggetti con script.


A [[Part_Part2DObject|Part Part2DObject]] ({{incode|Part::Part2DObject}} class) is derived from a [[Part_Feature|Part Feature]] ({{incode|Part::Feature}} class), therefore it shares all the latter's properties.
Un [[Part_Part2DObject/it|Part Part2DObject]] (classe {{incode|Part::Part2DObject}}) è derivato da una [[Part_Feature/it|Part Feature]] (classe {{incode|Part::Feature}}), pertanto condivide tutte le proprietà di quest'ultimo.


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

Revision as of 16:07, 1 December 2019

Introduzione

Un Part Part2DObject, o formalmente un Part::Part2DObject, è un elemento semplice a cui è associato un Shape topologico che può essere visualizzato nella Vista 3D.

Part::Part2DObject è derivato da una Part Feature, ma è specializzato nella geometria 2D, dato che la sua forma è posizionata su un piano. Il piano è definito dalla sua proprietà DatiPlacement (posizione, normale e rotazione). Tuttavia, il piano può anche essere definito supportando elementi geometrici, come il piano creato da tre vertici arbitrari o una faccia di un corpo solido.

Diagramma semplificato delle relazioni tra gli oggetti principali in FreeCAD. La classe Part::Part2DObject è specializzata per le forme 2D, quindi è la classe di base per gli oggetti planari creati con gli ambienti Draft e Sketcher.

Utilizzo

Part Part2DObject è un oggetto interno, quindi non può essere creato dall'interfaccia grafica, ma solo dalla console Python come descritto nel paragrafo Script.

Part::Part2DObject è definito nell'ambiente Part ma può essere usato come classe base per gli oggetti da script in tutti gli [[Workbenches/it|ambienti] ] che producono forme geometriche 2D. Ad esempio, è l'oggetto base per gli (Sketcher SketchObject) degli schizzi e per la maggior parte degli oggetti creati con Draft.

I workbench possono aggiungere diverse proprietà a questo elemento di base per produrre un oggetto con comportamento complesso.

Proprietà

Vedere Proprietà per tutti i tipi di proprietà che possono avere gli oggetti con script.

Un Part Part2DObject (classe Part::Part2DObject) è derivato da una Part Feature (classe Part::Feature), pertanto condivide tutte le proprietà di quest'ultimo.

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

Dati

Attachment

  • DatiMap Mode: "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.

Vista

Grid

  • VistaGrid Size: a float that determines the size of the spacing of the local grid lines in the 3D view.
  • VistaGrid Snap: if true the grid can be used to snap points.
  • VistaGrid Style: Dashed or Light; the style of the grid lines.
  • VistaShow Grid: if true a grid local to the object will be displayed in the 3D view. This grid is independent of the Draft grid.
  • VistaTight Grid: if true the local grid will be localized around the origin of the shape, otherwise it will extend itself more.

Script

See also: FreeCAD Scripting Basics, and scripted objects.

See Part Feature for the general information.

A Part 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"