Draft PathArray/it: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 35: Line 35:
==Alignment==
==Alignment==


The alignment of the elements in a Draft PathArray depends on the properties of the array, and the position and orientation of the subelements of the source object, relative to its local coordinates system. The {{PropertyData|Placement}} of the source object is ignored. If the {{PropertyData|Align}} property of the array is set to {{FALSE}} the orientation of the array elements is identical to that of the original subelements. If it is set to {{TRUE}} the X axis of the local coordinate system of each element placement is tangent to the path. The Y and Z axes of the local coordinate systems depend on the {{PropertyData|Align Mode}} property of the array. Other array properties involved in the alignment include {{PropertyData|Tangent Vector}}, {{PropertyData|Force Vertical}} and {{PropertyData|Vertical Vector}}.
The alignment of the elements in a Draft PathArray depends on the properties of the array and the orientation of the source object. The position of the source object is ignored: for the purpose of the array the {{Value|x}}, {{Value|y}} and {{Value|z}} are set to {{Value|0}}. If the {{PropertyData|Align}} property of the array is set to {{FALSE}} the orientation of the array elements is identical to that of the source object. If it is set to {{TRUE}} the X axis of the local coordinate system of each element placement is tangent to the path. The Y and Z axes of the local coordinate systems depend on the {{PropertyData|Align Mode}} property of the array. Other array properties involved in the alignment include {{PropertyData|Tangent Vector}}, {{PropertyData|Force Vertical}} and {{PropertyData|Vertical Vector}}.


[[Image:Draft_PathArray_example2.png|600px]]
[[Image:Draft_PathArray_example2.png|600px]]

Revision as of 09:59, 14 July 2021

Serie su tracciato

Posizione nel menu
Modifiche → Strumenti serie → Serie su tracciato
Ambiente
Draft, Arch
Avvio veloce
Nessuno
Introdotto nella versione
0.14
Vedere anche
Serie ortognale, Serie polare, Serie circolare, Serie di link su tracciato, Serie su punti, Clone

Descrizione

Lo strumento Serie su tracciato posiziona le copie di una forma selezionata lungo un percorso selezionato, che può essere una Polilinea, una B-spline, e bordi simili.

Questo strumento può essere utilizzato su qualsiasi oggetto che abbia una Part TopoShape, che significa forme 2D create con Draft, ma anche solidi 3D creati con altri ambienti, ad esempio Part, PartDesign o Arch.

Oggetto disposto lungo un percorso

Utilizzo

  1. Selezionare un oggetto che si desidera distribuire.
  2. Selezionare un oggetto percorso o alcuni bordi lungo i quali si vuole distribuire l'oggetto.
  3. Premere il pulsante Serie su tracciato.
  4. L'oggetto Array viene creato immediatamente. È necessario modificare le proprietà dell'array per modificare il numero e la direzione delle copie create.

Alignment

The alignment of the elements in a Draft PathArray depends on the properties of the array and the orientation of the source object. The position of the source object is ignored: for the purpose of the array the x, y and z are set to 0. If the DatiAlign property of the array is set to false the orientation of the array elements is identical to that of the source object. If it is set to true the X axis of the local coordinate system of each element placement is tangent to the path. The Y and Z axes of the local coordinate systems depend on the DatiAlign Mode property of the array. Other array properties involved in the alignment include DatiTangent Vector, DatiForce Vertical and DatiVertical Vector.

3 arrays based on the same non-planar path. From left to right: Align is false, Align is true with Align Mode Original and Align is true with Align Mode Frenet

.

Align Mode

Three modes are available:

Original

This mode comes closest to the single DatiAlign Mode available in version 0.18. It relies on a fixed normal vector. If the path is planar this vector is perpendicular to the plane of the path, else a default vector, the positive Z axis, is used. From this normal vector and the local tangent vector (the local X axis) a cross product is calculated. This new vector is used as the local Z axis. The orientation of the local Y axis is determined from the local X and Z axes.

Frenet

This mode uses the local normal vector derived from the path at each element placement. If this vector cannot be determined (for example in the case of a straight segment) a default vector, again the positive Z axis, is used instead. With this vector and the local tangent vector the local coordinate system is determined using the same procedure as in the previous paragraph.

Tangent

This mode is similar to DatiAlign Mode Original but includes the possibility to pre-rotate the source object by specifying a DatiTangent Vector.

Force Vertical and Vertical Vector

These properties are only available if DatiAlign Mode is Original or Tangent. If DatiForce Vertical is set to true the local coordinate system is calculated in a different manner. The DatiVertical Vector is used as a fixed normal vector. From this normal vector and the local tangent vector (the local X axis) again a cross product is calculated. But now this vector is used as the local Y axis. The orientation of the local Z axis is determined from the local X and Y axes.

Using these properties can be required if one of the edged of the path is (almost) parallel to the default normal of the path.

Proprietà

See also: Property editor.

Una Serie su tracciato deriva da una Part Feature (classe Part::Feature), quindi condivide tutte le proprietà di quest'ultima. Oltre alle proprietà descritte in Funzione Part, Serie su tracciato ha le seguenti proprietà nell'editor delle proprietà.

Data

Link

The properties in this group are only available for Link arrays. See Std LinkMake for more information.

  • DatiScale (Float)
  • Dati (Hidden)Scale Vector (Vector)
  • DatiScale List (VectorList)
  • Dati (Hidden)Visibility List (BoolList)
  • Dati (Hidden)Placement List (PlacementList)
  • Dati (Hidden)Element List (LinkList)
  • Dati (Hidden)_ Link Touched (Bool)
  • Dati (Hidden)_ Child Cache (LinkList)
  • Dati (Hidden)Colored Elements (LinkSubHidden)
  • DatiLink Transform (Bool)

Alignment

Alignment

  • DatiAlign (Bool): se è true le copie sono allineate al percorso; altrimenti vengono lasciate nel loro orientamento predefinito.
Nota: in alcuni casi la forma appare piatta, in realtà potrebbe essersi spostata nello spazio 3D, quindi, anziché utilizzare una vista piatta, cambiare la vista in assonometrica.
  • DatiAlign Mode (Enumeration): tre modalità, Original, Frenet, Tangent.
  • DatiExtra Translation (VectorDistance): vettore di spostamento aggiuntivo (x, y, z) che verrà applicato a ciascuna copia lungo il percorso. Questo è utile per apportare piccole modifiche alla posizione delle copie, ad esempio, quando il suo punto di riferimento non corrisponde al punto centrale della sua forma.
  • DatiForce Vertical (Bool): se è true, il valore di DatiVertical Vector verrà utilizzata come direzione Z locale, quando DatiAlign Mode è Original o Tangent. disponibile dalla versione 0.19
  • DatiTangent Vector (Vector): il valore predefinito è (1, 0, 0); vettore unità di allineamento che verrà utilizzato quando DatiAlign Mode è Tangent. disponibile dalla versione 0.19
  • DatiVertical Vector (Vector): il valore predefinito è (0, 0, 1); vettore unitario della direzione Z locale che verrà utilizzato quando DatiVertical Vector è true. disponibile dalla versione 0.19

Objects

Objects

  • DatiBase (LinkGlobal): specifica l'oggetto da duplicare nel percorso.
  • DatiCount (Integer): specifica il numero di copie da creare nel percorso.
  • DatiPath Object (LinkGlobal): specifica l'oggetto lungo il quale verranno distribuite le copie. Deve contenere degli 'Edges' nella sua topologia; ad esempio, potrebbe essere una polilinea o una BSpline.
  • DatiPath Subelements (LinkSubListGlobal): specifica i sottoelementi (bordi) del DatiPath Object su cui verranno create le copie. Le copie verranno create solo su questi bordi. Se questa proprietà è vuota, le copie verranno distribuite sull'intero
DatiPath Object.

View

Link

The properties in this group, with the exception of the inherited property, are only available for Link arrays. See Std LinkMake for more information.

  • VistaDraw Style (Enumeration)
  • VistaLine Width (FloatConstraint)
  • VistaOverride Material (Bool)
  • VistaPoint Size (FloatConstraint)
  • VistaSelectable (Bool): this is an inherited property that appears in the Selection group for other arrays
  • VistaShape Material (Material)

Base

The properties in this group, with the exception of the inherited property, are only available for Link arrays. See Std LinkMake for more information.

  • Vista (Hidden)Child View Provider (PersistentObject)
  • Vista (Hidden)Material List (MaterialList)
  • Vista (Hidden)Override Color List (ColorList)
  • Vista (Hidden)Override Material List (BoolList)
  • Vista (Hidden)Proxy (PythonObject): this is an inherited property.

Display Options

The properties in this group are inherited properties. See Part Feature for more information.

  • VistaBounding Box (Bool): this property is not inherited by Link arrays.
  • VistaDisplay Mode (Enumeration): for Link arrays it can be Link or ChildView. For other arrays it can be: Flat Lines, Shaded, Wireframe or Points
  • VistaShow In Tree (Bool)
  • VistaVisibility (Bool)

Draft

  • VistaPattern (Enumeration): not used.
  • VistaPattern Size (Float): not used.

Object style

The properties in this group are not inherited by Link arrays.

Scripting

Lo strumento PathArray può essere utilizzato nelle macro e dalla console Python utilizzando la seguente funzione:

path_array = make_path_array(base_object, path_object,
                             count=4, extra=App.Vector(0, 0, 0), subelements=None,
                             align=False, align_mode="Original", tan_vector=App.Vector(1, 0, 0),
                             force_vertical=False, vertical_vector=App.Vector(0, 0, 1),
                             use_link=True)
  • Crea un oggetto "PathArray" da un base_object, inserendo fino a count copie lungo un path_object.
    • Invece di un riferimento a un oggetto, base_object e path_object possono anche essere delle Labels (stringhe) di oggetti esistenti nel documento corrente.
    • Se viene fornito un extra, esso è un vettore che sposta ciascuna delle singole copie di una piccola quantità.
    • Se vengono forniti dei subelements, è un elenco di bordi di path_object, per esempio, ['Edge1', 'Edge2']; le copie verranno create lungo questo percorso più breve.
    • Se align è True, le copie sono allineate lungo il path_object a seconda del valore di align_mode, che può essere "Original", "Frenet" o "Tangent".
    • Se viene fornito un tan_vector, è un vettore unitario che definisce la direzione tangente locale della copia lungo il percorso. Viene utilizzato quando align_mode è "Tangent".
    • Se force_vertical è True, il valore di vertical_vector viene utilizzato per determinare la direzione Z locale della copia lungo il percorso. Viene utilizzato quando align_mode è "Original" o "Tangent".
    • Se use_link è True, il tipo di serie creata sarà una Serie di link su tracciato, i cui elementi sono delle istanze App Link invece di normali copie.

Esempio:

import FreeCAD as App
import Draft

doc = App.newDocument()

p1 = App.Vector(500, -1000, 0)
p2 = App.Vector(1500, 1000, 0)
p3 = App.Vector(3000, 500, 0)
p4 = App.Vector(4500, 100, 0)
spline = Draft.make_bspline([p1, p2, p3, p4])
obj = Draft.make_polygon(3, 500)

path_array = Draft.make_path_array(obj, spline, 6)
doc.recompute()

wire = Draft.make_wire([p1, -p2, -p3, -p4])
path_array2 = Draft.make_path_array(obj, wire, count=3, extra=App.Vector(0, -500, 0), subelements=["Edge2", "Edge3"], align=True, force_vertical=True)
doc.recompute()