Part Feature/it: Difference between revisions

From FreeCAD Documentation
(Created page with "* {{PropertyData|Placement}}: la posizione dell'oggetto nella Vista 3D. Il posizionamento è definito da un punto {{incode|Base}} (vettore) e una {{incode| Rota...")
(Created page with "* {{PropertyView|Angular Deflection}}: accompagna {{PropertyView|Deviation}}. È un altro modo per specificare la precisione con cui generare la mesh per il rendering sullo sc...")
Line 31: Line 31:
{{TitleProperty|Base}}
{{TitleProperty|Base}}


* {{PropertyView|Angular Deflection}}: it is a companion to {{PropertyView|Deviation}}. It is another way to specify how finely to generate the mesh for rendering on screen or when exporting. The default value is 28.5 degrees, or 0.5 radians. The smaller the value the smoother the appearance will be in the [[3D view|3D view]], and the finer the mesh that will be exported.
* {{PropertyView|Angular Deflection}}: accompagna {{PropertyView|Deviation}}. È un altro modo per specificare la precisione con cui generare la mesh per il rendering sullo schermo o durante l'esportazione. Il valore predefinito è 28,5 gradi o 0,5 radianti. Minore è il valore, più uniforme sarà l'aspetto nella [[3D view/it|vista 3D]] e più fine sarà la mesh che verrà esportata.
* {{PropertyView|Bounding Box}}: if it is {{TRUE}}, the object will show the bounding box in the [[3D view|3D view]].
* {{PropertyView|Bounding Box}}: se è {{TRUE}}, l'oggetto mostra il parallelepipedo che lo contiene nella [[3D view/it|vista 3D]].
* {{PropertyView|Deviation}}: it is a companion to {{PropertyView|Angular Deflection}}. It is another way to specify how finely to generate the mesh for rendering on screen or when exporting. The default value is 0.5. The smaller the value the smoother the appearance will be in the [[3D view|3D view]], and the finer the mesh that will be exported.
* {{PropertyView|Deviation}}: accompagna {{PropertyView|Angular Deflection}}. È un altro modo per specificare la precisione con cui generare la mesh per il rendering sullo schermo o durante l'esportazione. Il valore predefinito è 28,5 gradi o 0,5 radianti. Minore è il valore, più uniforme sarà l'aspetto nella [[3D view/it|vista 3D]] e più fine sarà la mesh che verrà esportata.
* {{PropertyView|Display Mode}}: Flat Lines (regular visualization), Shaded (soft edges), Wireframe (no faces), Points (only vertices).
* {{PropertyView|Display Mode}}: Flat lines (visualizzazione normale con facce piene), Ombreggiato (bordi leggeri), Wireframe (solo reticolo e facce vuote), Punti (solo vertici).
* {{PropertyView|Draw Style}}: Solid, Dashed, Dotted, Dashdot; defines the style of the edges in the [[3D view|3D view]].
* {{PropertyView|Draw Style}}: Solid, Dashed, Dotted, Dashdot; definisce lo stile dei bordi nella [[3D view/it|vista 3D]].
* {{PropertyView|Lighting}}: Two side, One side; the illumination comes from two sides or one side in the [[3D view|3D view]].
* {{PropertyView|Lighting}}: Two side, One side; l'illuminazione proviene da due lati o un lato nella [[3D view/it|vista 3D]].
* {{PropertyView|Line Color}}: a tuple of three values {{incode|(r,g,b)}} to define the color of the edges in the [[3D view|3D view]].
* {{PropertyView|Line Color}}: una tupla di tre valori {{incode|(r,g,b)}} per definire il colore dei bordi nella [[3D view/it|vista 3D]].
* {{PropertyView|Line Width}}: a float that determines the width in pixels of the edges in the [[3D view|3D view]].
* {{PropertyView|Line Width}}: un flottante che determina la larghezza in pixel dei bordi nella [[3D view/it|vista 3D]].
* {{PropertyView|On Top When Selected}}: Disabled, Enabled, Object, Element.
* {{PropertyView|On Top When Selected}}: Disabled, Enabled, Object, Element.
* {{PropertyView|Point Color}}: a tuple of three values {{incode|(r,g,b)}} to define the color of the vertices in the [[3D view|3D view]].
* {{PropertyView|Point Color}}: una tupla di tre valori {{incode|(r,g,b)}} per definire il colore dei vertici nella [[3D view/it|vista 3D]].
* {{PropertyView|Point Size}}: a float that determines the size in pixels of the vertices in the [[3D view|3D view]].
* {{PropertyView|Point Size}}: un flottante che determina la dimensione in pixel dei vertici nella [[3D view/it|vista 3D]].
* {{PropertyView|Selectable}}: if it is {{TRUE}}, the object can be picked with the pointer in the [[3D view|3D view]]. Otherwise, the object cannot be selected until this option is set to {{TRUE}}.
* {{PropertyView|Selectable}}: se è {{TRUE}}, l'oggetto può essere selezionato con il puntatore nella [[3D view/it|vista 3D]]. Altrimenti, l'oggetto non può essere selezionato fino a quando questa opzione non è impostata su {{TRUE}}.
* {{PropertyView|Selection Style}}: Shape, BoundBox.
* {{PropertyView|Selection Style}}: Shape, BoundBox.
* {{PropertyView|Shape Color}}: a tuple of three values {{incode|(r,g,b)}} to define the color of the faces in the [[3D view|3D view]].
* {{PropertyView|Shape Color}}: una tupla di tre valori {{incode|(r,g,b)}} per definire il colore delle facce nella [[3D view/it|vista 3D]].
* {{PropertyView|Show In Tree}}: if it is {{TRUE}}, the object appears in the [[tree view|tree view]]. Otherwise, it is set as invisible.
* {{PropertyView|Show In Tree}}: se è {{TRUE}}, l'oggetto appare nella [[tree view/it|vista ad albero]]. Altrimenti, è impostato come invisibile.
* {{PropertyView|Transparency}}: a float from 0 to 100 that determines the level of transparency of the faces in the [[3D view|3D view]]. A value of 100 indicates completely invisible faces; the faces are invisible but they can still be picked as long as {{PropertyView|Selectable}} is {{TRUE}}.
* {{PropertyView|Transparency}}: un valore da 0 a 100 che determina il livello di trasparenza delle facce nella [[3D view/it|vista 3D]]. Un valore di 100 indica facce completamente invisibili; le facce che sono invisibili possono comunque essere selezionate se {{PropertyView|Selectable}} è {{TRUE}}.
* {{PropertyView|Visibility}}: if it is {{TRUE}}, the object appears in the [[3D view|3D view]]; otherwise it is not present.
* {{PropertyView|Visibility}}: se è {{TRUE}}, l'oggetto appare nella [[3D view/it|vista 3D]]; altrimenti non è visibile.


== Scripting ==
== Scripting ==

Revision as of 16:19, 20 November 2019

Introduzione

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

L'oggetto Part::Feature è definito in Part ma può essere usato come classe base per script di oggetti in tutti gli [[Workbenches/it|ambienti] ] che producono forme geometriche 2D e 3D.

Un oggetto Part::Feature ha proprietà semplici come il posizionamento e i colori per definire l'aspetto dei suoi vertici, bordi e facce. Gli ambienti possono aggiungere altre proprietà a questo elemento di base per produrre un oggetto con un comportamento complesso.

Proprietà

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

Queste sono le proprietà disponibili nell'editor delle proprietà.

Dati

Base

  • DatiPlacement: la posizione dell'oggetto nella Vista 3D. Il posizionamento è definito da un punto Base (vettore) e una Rotation (asse e angolo).
    • Template:ProertyData: l'angolo di rotazione attorno al DatiAxis.
    • DatiAxis: il vettore unitario che definisce l'asse di rotazione per il posizionamento. Ogni valore è compreso tra 0 e 1. Se un valore è superiore a 1, il vettore viene normalizzato in modo che l'entità del vettore sia 1.
    • DatiPosition: le coordinate 3D del punto base del posizionamento.
  • DatiLabel: la descrizione modificabile dall'utente di questo oggetto.

Vista

Base

  • VistaAngular Deflection: accompagna VistaDeviation. È un altro modo per specificare la precisione con cui generare la mesh per il rendering sullo schermo o durante l'esportazione. Il valore predefinito è 28,5 gradi o 0,5 radianti. Minore è il valore, più uniforme sarà l'aspetto nella vista 3D e più fine sarà la mesh che verrà esportata.
  • VistaBounding Box: se è true, l'oggetto mostra il parallelepipedo che lo contiene nella vista 3D.
  • VistaDeviation: accompagna VistaAngular Deflection. È un altro modo per specificare la precisione con cui generare la mesh per il rendering sullo schermo o durante l'esportazione. Il valore predefinito è 28,5 gradi o 0,5 radianti. Minore è il valore, più uniforme sarà l'aspetto nella vista 3D e più fine sarà la mesh che verrà esportata.
  • VistaDisplay Mode: Flat lines (visualizzazione normale con facce piene), Ombreggiato (bordi leggeri), Wireframe (solo reticolo e facce vuote), Punti (solo vertici).
  • VistaDraw Style: Solid, Dashed, Dotted, Dashdot; definisce lo stile dei bordi nella vista 3D.
  • VistaLighting: Two side, One side; l'illuminazione proviene da due lati o un lato nella vista 3D.
  • VistaLine Color: una tupla di tre valori (r,g,b) per definire il colore dei bordi nella vista 3D.
  • VistaLine Width: un flottante che determina la larghezza in pixel dei bordi nella vista 3D.
  • VistaOn Top When Selected: Disabled, Enabled, Object, Element.
  • VistaPoint Color: una tupla di tre valori (r,g,b) per definire il colore dei vertici nella vista 3D.
  • VistaPoint Size: un flottante che determina la dimensione in pixel dei vertici nella vista 3D.
  • VistaSelectable: se è true, l'oggetto può essere selezionato con il puntatore nella vista 3D. Altrimenti, l'oggetto non può essere selezionato fino a quando questa opzione non è impostata su true.
  • VistaSelection Style: Shape, BoundBox.
  • VistaShape Color: una tupla di tre valori (r,g,b) per definire il colore delle facce nella vista 3D.
  • VistaShow In Tree: se è true, l'oggetto appare nella vista ad albero. Altrimenti, è impostato come invisibile.
  • VistaTransparency: un valore da 0 a 100 che determina il livello di trasparenza delle facce nella vista 3D. Un valore di 100 indica facce completamente invisibili; le facce che sono invisibili possono comunque essere selezionate se VistaSelectable è true.
  • VistaVisibility: se è true, l'oggetto appare nella vista 3D; altrimenti non è visibile.

Scripting

See also: FreeCAD Scripting Basics, and scripted objects.

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

obj = App.ActiveDocument.addObject("Part::Feature", "Name")
obj.Label = "Custom label"
  • The first argument indicates the type of object, in this case, "Part::Feature".
  • The second argument is a string that defines the Name attribute. If it is not provided, it defaults to "Part__Feature".
    • The Name is fixed at creation time; it cannot be modified afterwards.
    • The Name can only include simple alphanumeric characters, and the underscore, [_0-9a-zA-Z]. If other symbols are given, these will be converted to underscores; for example, "A+B:C*" is converted to "A_B_C_".
    • The Name must be unique in the entire document. If more objects with the same name are created, a sequential number will be appended to distinguish them, for example, "Name001", "Name002", etc.
  • If desired, the Label attribute can be changed to a more meaningful text.
    • By default, the Label is equal to the Name.
    • Unlike the Name, the Label can accept any UTF8 string, including accents and spaces. Since the tree view displays the Label, it is a good practice to change the Label to a more descriptive string.
    • By default the Label must be unique. This behavior can be changed in the preferences editor, Edit → Preferences → General → Document → Allow duplicate object labels in one document.