Part Part2DObject/it: Difference between revisions
(Updating to match new version of source page) |
No edit summary |
||
(37 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
{{TOCright}} |
|||
<span id="Introduction"></span> |
|||
== Introduzione == |
== Introduzione == |
||
[[File:Tree_Part2D.svg|32px]] |
[[File:Tree_Part2D.svg|32px]] |
||
⚫ | |||
<div class="mw-translate-fuzzy"> |
|||
⚫ | |||
</div> |
|||
{{Incode|Part::Part2DObject}} è derivato |
{{Incode|Part::Part2DObject}} è derivato dalla [[Part Feature/it|Part Feature]], ma è specializzato nella geometria 2D, dato che la sua forma è posizionata su un piano. Il piano è definito dalla sua proprietà {{PropertyData|Placement}} (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. |
||
[[File:FreeCAD_core_objects.svg|800px]] |
[[File:FreeCAD_core_objects.svg|800px]] |
||
{{Caption|Diagramma semplificato delle relazioni tra gli oggetti principali in FreeCAD}} |
|||
<div class="mw-translate-fuzzy"> |
|||
{{Caption|Diagramma semplificato delle relazioni tra gli oggetti principali in FreeCAD. La classe {{incode|Part::Part2DObject}} è specializzata per le forme 2D, quindi è la classe di base per gli oggetti planari creati con gli ambienti Draft e Sketcher.}} |
|||
</div> |
|||
<span id="Usage"></span> |
|||
<div class="mw-translate-fuzzy"> |
|||
== |
==Utilizzo== |
||
</div> |
|||
[[Part Part2DObject|Part Part2DObject]] è un oggetto interno, quindi non può essere creato dall'interfaccia grafica, ma solo dalla [[Python console/it|console Python]] come descritto nel paragrafo [[ |
[[Part Part2DObject|Part Part2DObject]] è un oggetto interno, quindi non può essere creato dall'interfaccia grafica, ma solo dalla [[Python console/it|console Python]] come descritto nel paragrafo [[#Script|Scripting]]. |
||
{{Incode|Part::Part2DObject}} è definito nell'ambiente [[ |
{{Incode|Part::Part2DObject}} è definito nell'ambiente [[Part_Workbench/it|Part]] ma può essere usato come classe base per gli [[Scripted_objects/it|oggetti da script]] in tutti gli [[Workbenches/it|ambienti] ] che producono forme geometriche 2D. Ad esempio, è l'oggetto base per gli ([[Sketcher_SketchObject/it|Sketcher SketchObject]]) degli schizzi e per la maggior parte degli oggetti creati con [[Draft_Workbench/it|Draft]]. |
||
I workbench possono aggiungere diverse proprietà a questo elemento di base per produrre un oggetto con comportamento complesso. |
I workbench possono aggiungere diverse proprietà a questo elemento di base per produrre un oggetto con comportamento complesso. |
||
<span id="Properties"></span> |
|||
== Proprietà == |
== Proprietà == |
||
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. |
||
Il [[Part_Part2DObject/it|Part Part2DObject]] (classe {{incode|Part::Part2DObject}}) è derivato da [[Part_Feature/it|Part Feature]] (classe {{incode|Part::Feature}}) e ne eredita tutte le proprietà. |
|||
Il Part Part2DObject ha anche le seguenti proprietà aggiuntive nell'[[Property_editor/it|editor delle proprietà]]. Le proprietà nascoste possono essere visualizzate utilizzando il comando {{MenuCommand|Mostra tutto}} nel menu contestuale dell'[[Property_editor/it|editor delle proprietà]]. |
|||
<div class="mw-translate-fuzzy"> |
|||
Oltre alle proprietà descritte in [[Part Feature/it|Part Feature]], Part Part2DObject ha le seguenti proprietà nell'[[property editor/it|editor delle proprietà]]. |
|||
</div> |
|||
<span id="Data"></span> |
|||
=== Dati === |
=== Dati === |
||
<div class="mw-translate-fuzzy"> |
|||
{{TitleProperty|Attachment}} |
{{TitleProperty|Attachment}} |
||
⚫ | * {{PropertyData|Map Mode}}: |
||
</div> |
|||
* <div id="Property_Attacher_Type"></div>{{PropertyData|Attacher Type|String|Hidden}}: nome della classe dell'oggetto motore di collegamento che guida l'allegato. Il valore predefinito è {{incode|Attacher::AttachEnginePlane}}. |
|||
Vedere [[Part Attachment/it|Part Attachment]] per ulteriori informazioni su tutte le modalità di associazione. |
|||
* <div id="Property_Support"></div>{{PropertyData|Support|LinkSubList}}: è il piano o la faccia che supporta la geometria 2D. Il valore predefinito è un elenco vuoto {{incode|[]}}. |
|||
⚫ | * <div id="Property_Map_Mode"></div>{{PropertyData|Map Mode|Enumeration}}: {{value|Deactivated}} per impostazione predefinita. Questa proprietà determina un piano che l'oggetto utilizzerà come riferimento per la geometria 2D. Cliccando sui puntini di sospensione {{KEY|...}} (tre punti), a destra del campo di immissione si avvia il comando [[Part_EditAttachment/it|Part EditAttachment]] che consente di selezionare il piano di appoggio selezionando diversi elementi nella [[3D_view/it|Vista 3D]]. Le diverse modalità sono: {{value|Deactivated}}, {{value|Translate origin}}, {{value|Object's XY}}, {{value|Object's XZ}}, {{value|Object's YZ}}, {{value|Plane face}}, {{value|Tangent to surface}}, {{value|Normal to edge}}, {{value|Frenet NB}}, {{value|Frenet TN}}, {{value|Frenet TB}}, {{value|Concentric}}, {{value|Revolution section}}, {{value|Plane by 3 points}}, {{value|Normal to 3 points}}, {{value|Folding}}, {{value|Inertia 2-3}}, {{value|Align O-N-X}}, {{value|Align O-N-Y}}, {{value|Align O-X-Y}}, {{value|Align O-X-N}}, {{value|Align O-Y-N}}, {{value|Align O-Y-X}}. |
||
* <div id="Property_Map_Reversed"></div>{{PropertyData|Map Reversed|Bool}}: il valore predefinito è {{FALSE}}; se è {{TRUE}} la direzione Z verrà invertita. Ad esempio, uno [[Sketch/it|schizzo]] verrà capovolto. Nascosto se {{PropertyData|Map Mode}} è {{value|Deactivated}}. |
|||
⚫ | |||
* <div id="Property_Attachment_Offset"></div>{{PropertyData|Attachment Offset|Placement}}: la posizione dell'oggetto nella [[3D_view/it|vista 3D]], rispetto al posizionamento dell'oggetto allegato. Il posizionamento è definito da un punto {{incode|Base}} (vettore) e da una {{incode|Rotazione}} (asse e angolo). Vedi [[Placement/it|Posizionamento]]. Nascosto se {{PropertyData|Map Mode}} è {{value|Deactivated}}. |
|||
<span id="Scripting"></span> |
|||
The following two properties are normally hidden. They become visible once {{PropertyData|Map Mode}} is something other than {{value|Deactivated}}. |
|||
⚫ | |||
* {{PropertyData|Map Reversed|Bool}}: it defaults to {{FALSE}}; if it is {{TRUE}} the Z direction will be reversed. For example, a [[sketch|sketch]] will be flipped upside down. |
|||
* {{PropertyData|Attachment Offset|Placement}}: the position of the object in the [[3D view|3D view]], with respect to the attachment object's placement. The placement is defined by a {{incode|Base}} point (vector), and a {{incode|Rotation}} (axis and angle). See [[Placement|Placement]]. |
|||
⚫ | |||
==== Hidden properties Data ==== |
|||
⚫ | |||
{{TitleProperty|Base}} |
|||
⚫ | |||
* {{PropertyData|Proxy|PythonObject}}: a custom class associated with this object. This only exists for the [[Python|Python]] version. See [[Part_Part2DObject#Scripting|Scripting]]. |
|||
{{TitleProperty|Attachment}} |
|||
* {{PropertyData|Attacher Type|String}}: class name of the attach engine object driving the attachment. It defaults to {{incode|Attacher::AttachEnginePlane}}. |
|||
* {{PropertyData|Support|LinkSubList}}: it is the plane or face supporting the 2D geometry. It defaults to an empty list {{incode|[]}}. |
|||
⚫ | |||
===Vista=== |
|||
<div class="mw-translate-fuzzy"> |
|||
{{TitleProperty|Grid}} |
|||
* {{PropertyView|Grid Size}}: un valore che determina la dimensione della spaziatura delle linee della griglia locale nella [[3D view/it|vista 3D]]. |
|||
* {{PropertyView|Grid Snap}}: se è {{TRUE}} la griglia può essere utilizzata per agganciare i punti. |
|||
* {{PropertyView|Grid Style}}: Dashed or Light; lo stile delle linee della griglia. |
|||
* {{PropertyView|Show Grid}}: se è {{TRUE}} nella [[3D view/it|vista 3D]] viene visualizzata una griglia locale all'oggetto. Questa griglia è indipendente dalla griglia di [[Draft_ToggleGrid/it|Draft]]. |
|||
* {{PropertyView|Tight Grid}}: se è {{TRUE}} la griglia locale è localizzata attorno all'origine della forma, altrimenti si estende oltre. |
|||
</div> |
|||
==== Hidden properties View ==== |
|||
{{TitleProperty|Base}} |
|||
* {{PropertyView|Proxy|PythonObject}}: a custom view provider class associated with this object. This only exists for the [[Python|Python]] version. See [[Part_Part2DObject#Scripting|Scripting]]. |
|||
All other view properties, including hidden properties, are those of the base [[Part_Feature|Part Feature]] object. |
|||
⚫ | |||
⚫ | |||
<div class="mw-translate-fuzzy"> |
|||
⚫ | |||
</div> |
|||
<div class="mw-translate-fuzzy"> |
|||
⚫ | |||
</div> |
|||
{{Code|code= |
{{Code|code= |
||
import FreeCAD as App |
import FreeCAD as App |
||
Line 100: | Line 62: | ||
}} |
}} |
||
⚫ | |||
This basic {{incode|Part::Part2DObject}} doesn't have a Proxy object so it can't be fully used for sub-classing. |
|||
⚫ | |||
{{Code|code= |
{{Code|code= |
||
Line 112: | Line 72: | ||
}} |
}} |
||
For example, most tools from the [[Draft_Workbench|Draft Workbench]], like [[Draft_Line|Draft Line]], [[Draft_Rectangle|Draft Rectangle]], [[Draft_Polygon|Draft Polygon]], etc., are {{incode|Part::Part2DObjectPython}} objects with a custom icon and additional properties. |
|||
<div class="mw-translate-fuzzy"> |
|||
{{Part Tools navi/it}} |
|||
</div> |
|||
{{Document_objects_navi{{#translation:}}}} |
|||
{{Userdocnavi |
{{Userdocnavi{{#translation:}}}} |
Latest revision as of 23:11, 29 December 2023
Introduzione
Un Part Part2DObject, o formalmente un Part::Part2DObject
, è un elemento semplice con una forma topologica che può essere visualizzato nella Vista 3D.
Part::Part2DObject
è derivato dalla 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
Utilizzo
Part Part2DObject è un oggetto interno, quindi non può essere creato dall'interfaccia grafica, ma solo dalla console Python come descritto nel paragrafo Scripting.
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.
Il Part Part2DObject (classe Part::Part2DObject
) è derivato da Part Feature (classe Part::Feature
) e ne eredita tutte le proprietà.
Il Part Part2DObject ha anche le seguenti proprietà aggiuntive nell'editor delle proprietà. Le proprietà nascoste possono essere visualizzate utilizzando il comando Mostra tutto nel menu contestuale dell'editor delle proprietà.
Dati
Attachment
- Dati (Hidden)Attacher Type (
String
): nome della classe dell'oggetto motore di collegamento che guida l'allegato. Il valore predefinito èAttacher::AttachEnginePlane
. - DatiSupport (
LinkSubList
): è il piano o la faccia che supporta la geometria 2D. Il valore predefinito è un elenco vuoto[]
. - DatiMap Mode (
Enumeration
):Deactivated
per impostazione predefinita. Questa proprietà determina un piano che l'oggetto utilizzerà come riferimento per la geometria 2D. Cliccando sui puntini di sospensione ... (tre punti), a destra del campo di immissione si avvia il comando Part EditAttachment che consente di selezionare il piano di appoggio selezionando diversi elementi nella Vista 3D. Le diverse modalità sono: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
. - DatiMap Reversed (
Bool
): il valore predefinito èfalse
; se ètrue
la direzione Z verrà invertita. Ad esempio, uno schizzo verrà capovolto. Nascosto se DatiMap Mode èDeactivated
. - Dati (Hidden)Map Path Parameter (
Float
): imposta il punto della curva su cui mappare uno schizzo. Va da0
a1
, che corrisponde astart
eend
. Il valore predefinito è0
. - DatiAttachment Offset (
Placement
): la posizione dell'oggetto nella vista 3D, rispetto al posizionamento dell'oggetto allegato. Il posizionamento è definito da un puntoBase
(vettore) e da unaRotazione
(asse e angolo). Vedi Posizionamento. Nascosto se DatiMap Mode èDeactivated
.
Script
Vedere anche: Script di base per FreeCAD, e script di oggetti.
Vedere Part Feature per le informazioni generali sull'aggiunta di oggetti al documento..
Un Part2DObject viene creato con il metodo addObject()
del documento.
import FreeCAD as App
doc = App.newDocument()
obj = App.ActiveDocument.addObject("Part::Part2DObject", "Name")
obj.Label = "Custom label"
Per la sottoclasse Python, è necessario creare un oggetto Part::Part2DObjectPython
.
import FreeCAD as App
doc = App.newDocument()
obj = App.ActiveDocument.addObject("Part::Part2DObjectPython", "Name")
obj.Label = "Custom label"
- Cuore: App DocumentObject
- Base: App FeaturePython, App GeoFeature, Part Feature, Mesh Feature, Fem FemMeshObject
- Forme interne: Part TopoShape, Mesh MeshObject, Fem FemMesh
- Struttura: App DocumentObjectGroup (Std Group), App Part (Std Part), App Link
- Derivate: Part Part2DObject, Sketcher SketchObject, PartDesign Body, PartDesign Feature
- 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, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Surface, TechDraw, Test Framework
- Hubs: User hub, Power users hub, Developer hub