Draft OrthoArray: Difference between revisions

From FreeCAD Documentation
Line 145: Line 145:


<!--T:19-->
<!--T:19-->
* {{PropertyData|Angle|Angle}}: specifies the aperture of the circular arc to cover with copies; use 360 to cover an entire circle.
* {{PropertyData|Angle|Angle}}: specifies the aperture of the circular arc. Use {{value|360&#176;}} for a full circle.
* {{PropertyData|Interval Axis|VectorDistance}}: distance and orientation of each copy in {{PropertyData|Axis}} direction.
* {{PropertyData|Interval Axis|VectorDistance}}: specifies the interval between elements in the {{PropertyData|Axis}} direction.
* {{PropertyData|Number Polar|Integer}}: number of copies in the polar direction.
* {{PropertyData|Number Polar|Integer}}: specifies the number of elements in the polar direction.


<!--T:60-->
<!--T:60-->

Revision as of 09:33, 27 May 2021

This documentation is a work in progress. Please don't mark it as translatable since it will change in the next hours and days.

Draft OrthoArray

Menu location
Modification → Array tools → Array
Workbenches
Draft
Default shortcut
None
Introduced in version
0.19
See also
Draft PolarArray, Draft CircularArray, Draft PathArray, Draft PathLinkArray, Draft PointArray, Draft Clone

Description

The Draft OrthoArray tool creates an orthogonal (3-axes) array from a selected object.

This 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. It can also create App Links instead of simple copies.

This command deprecates the previously existing Array as well as the short lived LinkArray tools.

Orthogonal array from a solid object.

Usage

  1. Select the object that you wish to duplicate.
  2. Press the Array button. If no object is selected, you will be invited to select one.
  3. The task panel is launched, where you can select the number of elements in each X, Y, Z direction; and the interval between each created element.
  4. You can click on the 3D view to set up all the numbers and intervals, and complete the command. Otherwise, just press Enter or the OK button to complete the operation.

Notes

  • 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.
  • This command creates the same parametric "Array" object as the one created with the PolarArray and CircularArray tools. Therefore, the array can be converted to orthogonal, polar, or circular by changing its DataArray Type property.

Options

These are the options displayed in the task panel.

  • Number of elements: the elements in the X, Y, and Z directions. A copy of the original object is always produced, so this number must be at least 1 in every direction.
  • X intervals: the values of displacement for the copies in the X direction. To create strictly rectangular arrays, the Y and Z values should be zero (x, 0, 0).
  • Y intervals: the values of displacement for the copies in the Y direction. To create strictly rectangular arrays, the X and Z values should be zero (0, y, 0).
  • Z intervals: the values of displacement for the copies in the Z direction. To create strictly rectangular arrays, the X and Y values should be zero (0, 0, z).
  • Reset X, Y, Z: it resets the interval vectors to a rectangular displacement, that is (x, 0, 0), (0, y, 0), and (0, 0, z).
  • Fuse: if it is checked, the resulting objects in the array will fuse together if they touch each other. This only works if Link array is unchecked.
  • Link array: if it is checked, the resulting array will be a "Link array". This array internally uses App Link objects, so it is more efficient when handling many copies of complex shapes. However, in this case, the objects cannot be fused together.
  • Press Esc or the Cancel button to abort the current command.

Note: if a Link array is created, this object cannot be converted to a regular array. And similarly, a regular array cannot be converted to a Link array. Therefore, you must choose the type of array that you want at creation time.

Properties

See also: Property editor.

The Draft OrthoArray command, the Draft PolarArray command and the Draft CircularArray command create the same object. This object is derived from a Part Feature object and inherits all its properties (with the exception of some View properties that are not inherited by Link arrays). The following properties are additional unless otherwise stated:

Data

Link

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

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

Circular array

The properties in this group are hidden for Orthogonal arrays and Polar array.

  • DataNumber Circles (Integer): specifies the number of circular layers. Must be at least 1.
  • DataRadial Distance (Distance): specifies the distance between circular layers.
  • DataSymmetry (Integer): specifies the number of symmetry lines. This number changes the distribution of the elements in the array.
  • DataTangential Distance (Distance): specifies the distance between elements in the same circular layer.

Objects

  • DataArray Type (Enumeration): specifies the type of array, which can be ortho, polar or circular.
  • DataAxis Reference (LinkGlobal): specifies the object and edge to be used instead of the DataAxis and DataCenter properties. Not used for Orthogonal arrays.
  • DataBase (Link): specifies the object to duplicate in the array.
  • DataCount (Integer): (only available for Link arrays, read-only) specifies the total number of elements in the array.
  • DataExpand Array (Bool): (only available for Link arrays) specifies whether to expand the array in the Tree view to enable the selection of its individual elements.
  • DataFuse (Bool): specifies if overlapping elements in the array are fused or not. Not used for Link arrays.

Orthogonal array

The properties in this group are hidden for Circular arrays and Polar array.

  • DataInterval X (VectorDistance): specifies the interval between elements in the X direction.
  • DataInterval Y (VectorDistance): specifies the interval between elements in the Y direction.
  • DataInterval Z (VectorDistance): specifies the interval between elements in the Z direction.
  • DataNumber X (Integer): specifies the number of elements in the X direction. Must be at least 1.
  • DataNumber Y (Integer): specifies the number of elements in the Y direction. Must be at least 1.
  • DataNumber Z (Integer): specifies the number of elements in the Z direction. Must be at least 1.

Polar array

The properties in this group are hidden for Circular arrays and Orthogonal array.

  • DataAngle (Angle): specifies the aperture of the circular arc. Use 360° for a full circle.
  • DataInterval Axis (VectorDistance): specifies the interval between elements in the DataAxis direction.
  • DataNumber Polar (Integer): specifies the number of elements in the polar direction.

Polar/circular array

The properties in this group are hidden for Orthogonal array.

  • DataAxis (Vector): the axis direction around which the elements in a polar or circular array are created.
  • DataCenter (VectorDistance): specifies the center point of the polar or circular array. The DataAxis passes through this point. For circular arrays, the DataCenter specifies an offset from the DataPlacement of the DataBase 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.

  • ViewDraw Style (Enumeration)
  • ViewLine Width (FloatConstraint)
  • ViewOverride Material (Bool)
  • ViewPoint Size (FloatConstraint)
  • ViewSelectable (Bool): this is an inherited property that appears in the Selection group for other arrays
  • ViewShape 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.

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

Display Options

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

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

Draft

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

Object style

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

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

Parametric array

To create a parametric orthogonal array use the make_array method (introduced in version 0.19) of the Draft module. This method replaces the deprecated makeArray method. The make_array method can create Draft OrthoArrays, Draft PolarArrays and Draft CircularArrays. For each array type one or more wrappers are available.

The main method:

array = make_array(base_object, arg1, arg2, arg3, arg4=None, arg5=None, arg6=None, use_link=True)

The wrappers for orthogonal arrays are:

array = make_ortho_array(base_object,
                         v_x=App.Vector(10, 0, 0), v_y=App.Vector(0, 10, 0), v_z=App.Vector(0, 0, 10),
                         n_x=2, n_y=2, n_z=1,
                         use_link=True)
array = make_ortho_array2d(base_object,
                           v_x=App.Vector(10, 0, 0), v_y=App.Vector(0, 10, 0),
                           n_x=2, n_y=2,
                           use_link=True)

The wrappers for rectangular arrays are:

array = make_rect_array(base_object,
                        d_x=10, d_y=10, d_z=10,
                        n_x=2, n_y=2, n_z=1,
                        use_link=True)
array = make_rect_array2d(base_object,
                          d_x=10, d_y=10,
                          n_x=2, n_y=2,
                          use_link=True)
  • base_object is the object to be arrayed. It can also be the Label (string) of an object in the current document.
  • v_x, v_y, and v_z are the vectors between the base points of the elements in the respective directions.
  • d_x, d_y, and d_z are the distances between the base points of the elements in the respective directions.
  • n_x, n_y, and n_z are the numbers of elements in the respective directions.
  • If use_link is True the created elements are App Links instead of regular copies.
  • array is returned with the created array object.

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

rect = Draft.make_rectangle(1500, 500)
v_x = App.Vector(1600, 0, 0)
v_y = App.Vector(0, 600, 0)

array = Draft.make_ortho_array2d(rect, v_x, v_y, 3, 4)
doc.recompute()

Non-parametric array

To create a non-parametric orthogonal array use the array method of the Draft module. This method returns None.

array(objectslist, xvector, yvector, xnum, ynum)
array(objectslist, xvector, yvector, zvector, xnum, ynum, znum)

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

rect = Draft.make_rectangle(1500, 500)
v_x = App.Vector(1600, 0, 0)
v_y = App.Vector(0, 600, 0)

Draft.array(rect, v_x, v_y, 3, 4)
doc.recompute()