Draft: PathArray

From FreeCAD Documentation
Revision as of 11:41, 24 August 2020 by FuzzyBot (talk | contribs) (Updating to match new version of source page)

Draft PathArray

poziția meniului
Draft → PathArray
Ateliere
Draft, Arch
scurtătură
nici unul
Prezentat în versiune
-
A se vedea, de asemenea,
Draft Array

Descriere

Instrumentul PathArray plasează copii ale unei forme selectate de-a lungul unei căi selectate. Calea poate fi un Filament sau una sau mai multe muchii. Formele pot fi opțional aliniate cu tangenta traiectoriei. Dacă este necesar, poate fi specificat un Vector de tranlație pentru a deplasa formele astfel încât centroidul să fie pe traiectorie. Dacă nu sunt selectate obiecte, veți fi invitat să le selectați.

The PathArray tool can be used on any object that has a Part TopoShape, meaning 2D shapes created with the Draft Workbench, but also 3D solids created with other workbenches, for example, Part, PartDesign, or Arch.

Object arranged along a path

Cum se folosește

  1. Creați un obiect tip formă pe care doriți să îl distribuiți/multiplicați. Veți obține cele mai bune rezultate dacă obiectul dvs. este centrat în jurul originii, chiar dacă calea începe în altă parte.
  2. Selectați un obiect tip traiectorie de-a lungul căruia vor fi distribuite formele. -sau-
  3. Selectați unele margini ale unui obiect traiectorie.
  4. Apasați pe butonul Draft PathArray.

Each element in the array is an exact clone of the original object, but the entire array is considered a single unit in terms of properties and appearance.

Note: if the DateBase object doesn't seem to be positioned correctly in the path, check that its DatePlacement is in the origin (0,0,0). Certain objects can be placed anywhere in the 3D space when used with the PathArray tool, but others must be at the origin, particularly those created by using Part Extrude with a 2D profile like a Sketch.

Opţiuni

  • Matricea de repetabilitate începe cu copii ale formelor care nu sunt aliniate la cale, nici traduse la o nouă poziție în mod implicit. Apoi puteți schimba vectorul numărătoare, aliniere și/sau traducere în proprietăți.

Proprietăți

A PathArray is derived from a Part Feature (Part::Feature class), therefore it shares all the latter's properties. In addition to the properties described in Part Feature, the PathArray has the following properties in the property editor.

  • DateBase: Obiectul tip formă
  • DatePathObj: Obeictul tip traiectorie
  • DatePathSubs: Sub-elementele(edges) obeictului tip traiectorie car va fi utilizat
  • DateCount: Numărul de ori de repetarea a formei
  • DateXlate: Vectorul de translație
  • DateAlign: Este adevărat să aliniați formele la traiectorie, False pentru a lăsa forme în orientarea lor implicită.

Objects

  • DateBase (LinkGlobal): specifies the object to duplicate in the path.
  • DateCount (Integer): specifies the number of copies to create in the path.
  • DatePath Object (LinkGlobal): specifies the object along which the copies will be distributed. It must contain 'Edges' in its Part TopoShape; for example, it could be a Wire or BSpline.
  • DatePath Subelements (LinkSubListGlobal): specifies the sub-elements (edges) of the DatePath Object on which the copies will be created. The copies will be created only on these edges. If this property is empty, the copies will be distributed on the entire DatePath Object.

Scrip-Programare

Instrumentul PathArray poate fi utilizat în macros și de la consola Python utilizând umătoarea funcție:

Older call

path_array = makePathArray(base_object, path_object, count, xlate=None, align=False, pathobjsubs=[])

New call

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):
  • Plasează un numpr de copii ale unui obiect tip formă al documentului de-a lungul unui obiect tip traiectorie sau sub-obiecte ale unui path-object. Opțional translatează fiecare copie prin FreeCAD.Vector xlate pe direcția și la distanța pentru a ajusta pentru diferența de formă centru vs punct de referință. Opțional, aliniază elementul de bază la calea tangentă/normală/binormală.

Exempluː

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()

Explicație tehnică

Când "Align = false", logica PathArray este destul de ușor de înțeles.

Align false
Align false
Align false
Align false

Object arranged along a closed path in the original orientation

Când "Align = true" logica este puțin mai dificil de înțeles:

  1. Construiți sistemele de coordonate Frenet pe cale (X este tangent, Z este normal, Y este binormal).
  2. Copiați obiectul original la fiecare sistem de coordonate pe traseu, astfel încât originea globală să corespundă originii sistemului de coordonate pe traseu.

Object arranged along a closed path; description of components and path

Este mult mai ușor de înțeles cu imagini. Următoarele imagini arată modul în care este produsă matricea de repetatibilitate, în funcție de planul în care se află traiectoria.

XY Plane
XY Plane

Path on XY Plane

XZ Plane
XZ Plane

Path on XZ Plane

YZ Plane
YZ Plane

Path on YZ Plane

Object arranged along a closed path which is aligned to the XY plane

Path on XZ Plane:

Object arranged along a closed path which is aligned to the XZ plane

Path on YZ Plane:

Object arranged along a closed path which is aligned to the YZ plane

Avantajul clar al acestei logici este că, pe măsură ce reorientezi traiectoria, dar nu obiectul, rezultatul este consecvent - obiectul rămâne aliniat la cale așa cum a fost înainte de reorientarea traiectoriei.

(Thanks to @DeepSOIC for this explanation)

Additional alignment modes and options introduced in v0.19

Original mode (the default) is the historic alignment mode as in version 0.18. It is not really the Frenet alignment. Original mode uses the normal parameter from Draft.getNormal (or the default) as a constant - it does not calculate curve normal. X follows the curve tangent, Y is the normal parameter, Z is X.Cross(Y).

Tangent mode is similar to Original, but includes a rotation to align the Base object's X to the TangentVector before placing copies. After the rotation, Tangent behaves the same as Original. In previous versions this rotation would be performed manually before invoking PathArray.

Frenet mode orients the copies to a coordinate system along the path. X is tangent to curve, Y is curve normal, Z is curve binormal. If a normal can not be computed (ex a straight line), the default is used.

The ForceVertical option applies to Original and Tangent modes. When this option is applied, the normal parameter from Draft.getNormal is ignored. X follows the curve tangent, Z is the VerticalVector property and Y is X.Cross(Z).

Version 18 cycle chain - Original mode

Align false
Align false

Railway cross ties (sleepers) - Tangent mode + ForceVertical

Align false
Align false

Frenet Mode

Align false
Align false