Draft CircularArray: Difference between revisions

From FreeCAD Documentation
m (Changed section to 'Usage')
(To position copies at specified points use PointArray or PointLinkArray.)
(21 intermediate revisions by 5 users not shown)
Line 14: Line 14:
{{GuiCommand
{{GuiCommand
|Name=Draft CircularArray
|Name=Draft CircularArray
|MenuLocation=Draft → Circular array
|MenuLocation=Modification → Array tools → Circular array
|Workbenches=[[Draft Module|Draft]]
|Workbenches=[[Draft Module|Draft]]
|Version=0.19
|Version=0.19
|SeeAlso=[[Draft_Array|Array]], [[Draft_PolarArray|PolarArray]], [[Draft_PathArray|PathArray]], [[Draft_PointArray|PointArray]], [[Draft_Clone|Clone]]
|SeeAlso=[[Draft_OrthoArray|Draft OrthoArray]], [[Draft_PolarArray|Draft PolarArray]], [[Draft_PathArray|Draft PathArray]], [[Draft_PathLinkArray|Draft PathLinkArray]], [[Draft_PointArray|Draft PointArray]], [[Draft_Clone|Draft Clone]]
}}
}}


Line 23: Line 23:


<!--T:4-->
<!--T:4-->
The [[Draft_CircularArray|Draft CircularArray]] tool creates an array from a selected object placing the copies along concentric circumferences. This is like using [[Draft_PolarArray|PolarArray]] with a polar angle of 360 degrees, and creating several such concentric arrays.
The {{Button|[[File:Draft_CircularArray.svg|16px]] [[Draft_CircularArray|Draft CircularArray]]}} tool creates an array from a selected object placing the copies along concentric circumferences. This is similar to using {{Button|[[Image:Draft_PolarArray.svg|16px]] [[Draft_PolarArray|PolarArray]]}} with a polar angle of 360 degrees, and creating several concentric arrays.


<!--T:5-->
<!--T:5-->
This tool can be used on 2D shapes created with the [[Draft_Workbench|Draft Workbench]] but can also be used on many types of 3D objects such as those created with the [[Part_Workbench|Part Workbench]] or [[PartDesign_Workbench|PartDesign Workbench]].
This tool can be used on any object that has a [[Part_TopoShape|Part TopoShape]], meaning 2D shapes created with the [[Draft_Workbench|Draft Workbench]], but also 3D solids created with other workbenches, for example, [[Part_Workbench|Part]], [[PartDesign_Workbench|PartDesign]], or [[Arch_Workbench|Arch]]. It can also create [[App_Link|App Links]] instead of simple copies.


<!--T:6-->
<!--T:6-->
* To create orthogonal or polar arrays, use the corresponding {{Button|[[File:Draft_OrthoArray.svg|16px]] [[Draft_OrthoArray|OrthoArray]]}} and {{Button|[[File:Draft_PolarArray.svg|16px]] [[Draft_PolarArray|PolarArray]]}} tools.
To position copies in a rectangular grid use [[Draft_Array|Array]]; to position in a polar pattern use [[Draft_PolarArray|PolarArray]]; to position copies along a path use [[Draft_PathArray|PathArray]]; to position copies at specified points use [[Draft_PointArray|PointArray]]; to create copies or clones, and manually place them use [[Draft_Move|Move]], [[Draft_Rotate|Rotate]], and [[Draft_Clone|Clone]].
* To position copies along a path use {{Button|[[File:Draft_PathArray.svg|16px]] [[Draft_PathArray|PathArray]]}} or {{Button|[[File:Draft_PathLinkArray.svg|16px]] [[Draft_PathLinkArray|PathLinkArray]]}}.
* To position copies at specified points use {{Button|[[File:Draft_PointArray.svg|16px]] [[Draft_PointArray|PointArray]]}} or {{Button|[[File:Draft_PointLinkArray.svg|16px]] [[Draft_PointLinkArray|PointLinkArray]]}}.
* To create copies and manually place them use {{Button|[[File:Draft_Move.svg|16px]] [[Draft_Move|Move]]}} or {{Button|[[File:Draft_Rotate.svg|16px]] [[Draft_Rotate|Rotate]]}}.
* To create exact copies and manually place or scale them, use {{Button|[[File:Draft_Clone.svg|16px]] [[Draft_Clone|Clone]]}} or {{Button|[[File:Std_LinkMake.svg|16px]] [[Std_LinkMake|Std LinkMake]]}}.


</translate>
</translate>
Line 41: Line 45:


<!--T:9-->
<!--T:9-->
# Select an object from which you wish to make the circular array.
# Select the object from which you wish to array.
# Press the {{Button|[[File:Draft_CircularArray.svg|16px]] [[Draft_CircularArray|Circular array]]}} button. If no object is selected, the [[task_panel|task panel]] will open, but you still need to select an object to proceed.
# Press the {{Button|[[File:Draft_CircularArray.svg|16px]] [[Draft_CircularArray|Circular array]]}} button. If no object is selected, you will be invited to select one before proceeding.
# The [[task_panel|task panel]] is launched where you can select the radial distance, the tangential distance, the number of circular layers, the symmetry parameter, and the center of the axis of rotation.
# Choose the radial distance, which determines the distance from the center of the array to the next circular layer, and between subsequent circular layers.
# You can click on the [[3D_view|3D view]] to simultaneously set the position of the center of rotation, and complete the command. Otherwise, just press {{KEY|Enter}} or the {{Button|OK}} button to complete the operation.
# Choose the tangential distance, which determines the distance from one element in the array to the next element in the same circular layer. This distance determines how many elements will be in the array; if the number is small, there will be many tightly packed copies; if the number is large, there will only be a few copies. This distance cannot be zero.

# Choose the number of circular layers. The original object is considered one layer by itself. Minimum of 2, maximum of 99.
===Notes=== <!--T:24-->
# Choose the symmetry number, which determines how the objects will be distributed in the array. Choose a number between 1 and 10.
# Choose the center of the axis of rotation. You can click on the [[3D_view|3D view]], to simultaneously set the position of the center of rotation, and complete the command.
# Optionally, check the fuse or link options.
# Press {{Button|OK}} to complete the command.


<!--T:10-->
<!--T:10-->
Notes:
* By default, the axis of rotation is the positive Z axis {{Value|(0, 0, 1)}}. This can be changed in the [[property_editor|property editor]] after the object is created.
* By default, the axis of rotation is the positive Z axis {{Value|(0, 0, 1)}}. This can be changed in the [[property_editor|property editor]] after the object is created.
* 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.
* 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 object as the one created with the [[Draft_Array|Array]] and [[Draft_PolarArray|PolarArray]] tools. Therefore, the array can be converted to orthogonal, polar, or circular just by changing its properties.
* This command creates the same parametric "Array" object as the one created with the {{Button|[[File:Draft_OrthoArray.svg|16px]] [[Draft_OrthoArray|OrthoArray]]}} and {{Button|[[File:Draft_PolarArray.svg|16px]] [[Draft_PolarArray|PolarArray]]}} tools. Therefore, the array can be converted to orthogonal, polar, or circular by changing its {{PropertyData|Array Type}} property.


== Options == <!--T:11-->
== Options == <!--T:11-->

<!--T:25-->
These are the options displayed in the [[task_panel|task panel]].


<!--T:12-->
<!--T:12-->
* Press {{Button|Reset point}} to set the center of the circular patterns to the origin {{Value|(0, 0, 0)}}.
* {{MenuCommand|Radial distance}}: the distance from the center of the array to the next circular layer, and between subsequent circular layers.
* {{MenuCommand|Tangential distance}}: the distance from one element in the array to the next element in the same circular layer. This distance determines how many elements will be in the array; if the number is small, there will be many tightly packed copies; if the number is large, there will only be a few copies. This distance cannot be zero.
* If the {{MenuCommand|Fuse}} checkbox is ticked, the resulting objects in the array will be fused into a single shape, if they touch or intersect each other.
* {{MenuCommand|Number of circular layers}}: the original object is considered one layer by itself. There must be minimum 2, maximum 99.
* If the {{MenuCommand|Use Links}} checkbox is ticked, the resulting objects in the array will be [[App_Link|App Links]] instead of simple copies. This improves the memory usage of the array, as the App Link re-uses the [[Shape|shape]] of the original object, and does not create new shapes. If this option is used, the {{MenuCommand|Fuse}} checkbox has no effect.
* {{MenuCommand|Symmetry}}: determines how the objects will be distributed in the array.
:With symmetry 1 the first element needs to be rotated a full circle to reach the same position, with 2 a rotation of half a circle (180°) is sufficient, with 3 a one third rotation of a circle (120°) is enough. This means that the symmetry parameter determines a rotation of 360°/n. For large values of symmetry the number of objects in the circular layers decreases, that eventually no object will be placed in the inner circle at all. In most cases you want a number between 1 and 6.
* {{MenuCommand|Center of rotation}}: the coordinates through which the axis of rotation goes through.
* {{MenuCommand|Reset point}}: it resets the center of rotation to the origin {{Value|(0, 0, 0)}}.
* {{MenuCommand|Fuse}}: if it is checked, the resulting objects in the array will fuse together if they touch each other. This only works if {{MenuCommand|Link array}} is unchecked.
* {{MenuCommand|Link array}}: if it is checked, the resulting array will be a "Link array". This array internally uses [[App_Link|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 {{KEY|Esc}} or the {{Button|Cancel}} button to abort the current command.
* Press {{KEY|Esc}} or the {{Button|Cancel}} button to abort the current command.

<!--T:26-->
{{Emphasis|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 == <!--T:13-->
== Properties == <!--T:13-->


<!--T:14-->
<!--T:14-->
An [[Draft_PolarArray|Array]] object is based on [[Part_Feature|Part Feature]] ({{incode|Part::Feature}} class), and thus shares all properties of the latter. In addition to the properties listed in [[Part_Feature|Part Feature]], the Array object has additional properties.
A [[Draft_CircularArray|CircularArray]] object internally is the same object produced with the {{Button|[[Image:Draft_OrthoArray.svg|16px]] [[Draft_OrthoArray|OrthoArray]]}} tool. It is based on [[Part_Feature|Part Feature]] ({{incode|Part::Feature}} class), and thus shares all properties of the latter.


<!--T:15-->
<!--T:15-->
See the {{Button|[[Image:Draft_OrthoArray.svg|16px]] [[Draft_OrthoArray|OrthoArray]]}} tool for the complete description of the properties. All properties apply, except for those under the {{TitleProperty|Orthogonal array}} and {{TitleProperty|Polar array}} groups.
See the [[Draft_Array|Array]] tool for the complete information.

<!--T:27-->
* For circular arrays, the {{PropertyData|Center|VectorDistance}} specifies an offset from the {{PropertyData|Placement}} of the {{PropertyData|Base}} object. That is, to keep the circular array centered on the {{PropertyData|Base}} object, keep {{PropertyData|Center}} to the default value {{Value|(0, 0, 0)}}.


== Scripting == <!--T:16-->
== Scripting == <!--T:16-->
Line 83: Line 98:
</translate>
</translate>
{{Code|code=
{{Code|code=
array_list = make_circular_array(obj, r_distance, tan_distance,
array = make_circular_array(base_object,
axis, center, number, symmetry,
r_distance=100, tan_distance=50,
use_link)
number=3, symmetry=1,
axis=App.Vector(0, 0, 1), center=App.Vector(0, 0, 0),
use_link=True):
}}
}}
<translate>
<translate>


<!--T:19-->
<!--T:19-->
* Creates an array from the objects contained in {{incode|obj}}, which can be a single object or a list of objects.
* Creates an {{incode|"Array"}} object from the {{incode|base_objectj}}.
* The values of {{incode|r_distance}} and {{incode|tan_distance}} correspond to the radial and tangential distances of the elements in the array.
** The values of {{incode|r_distance}} and {{incode|tan_distance}} correspond to the radial and tangential distances of the elements in the array.
* The values of {{incode|axis}} and {{incode|center}} are vectors that describe the direction of the axis of rotation, and a point through which that axis goes.
** The value of {{incode|number}} is the number of circular layers in the circular pattern; the original object counts as the first layer.
** The value of {{incode|symmetry}} is an integer that participates in some calculations that affect the way the copies are distributed around the circumferences. Usual values are from 1 to 6; higher values are not recommended and will make the copies in the inner layers to disappear.
* The value of {{incode|number}} is the number of circular layers in the circular pattern; the original object counts as the first layer.
** The values of {{incode|axis}} and {{incode|center}} are vectors that describe the direction of the axis of rotation, and a point through which that axis goes.
* The value of {{incode|symmetry}} is an integer that participates in some calculations that affect the way the copies are distributed around the circumferences. Try different values, from 1 to 10, to get different placements of the copies.
* If {{incode|use_link}} is {{TRUE}} the created copies will be [[App_Link|App Links]] and not regular copies.
** If {{incode|use_link}} is {{TRUE}} the created copies will be [[App_Link|App Links]] and not regular copies.
* {{incode|array_list}} is returned with the new copies.
** {{incode|array_list}} is either a single object or a list of objects, depending on the input {{incode|obj}}.


<!--T:20-->
<!--T:20-->
Line 105: Line 120:
import FreeCAD as App
import FreeCAD as App
import Draft
import Draft
import draftobjects.circulararray as ca


doc = App.newDocument()
doc = App.newDocument()


tri = Draft.makePolygon(3, 600)
tri = Draft.make_polygon(3, 600)

axis = App.Vector(0, 0, 1)
array = Draft.make_circular_array(tri, 1800, 1200, 4, 1)
center = App.Vector(0, 0, 0)
doc.recompute()
arr = ca.make_circular_array(tri, 1800, 1200, axis, center, 4, 1)
App.ActiveDocument.recompute()
}}
}}
<translate>
<translate>


<!--T:21-->
<!--T:21-->
{{Docnav
{{Draft Tools navi}}
|[[Draft_Draft2Sketch|Draft to Sketch]]
{{Userdocnavi}}
|[[Draft_LinkArray|Link Array]]
|[[Draft_Module|Draft]]
|IconL=Draft_Draft2Sketch.svg
|IconC=Workbench_Draft.svg
|IconR=Draft_LinkArray.svg
}}

</translate>
</translate>
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 05:16, 24 August 2020

Draft CircularArray

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

Description

The Draft CircularArray tool creates an array from a selected object placing the copies along concentric circumferences. This is similar to using PolarArray with a polar angle of 360 degrees, and creating several concentric arrays.

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.

A circular array of an object.

Usage

  1. Select the object from which you wish to array.
  2. Press the Circular array button. If no object is selected, you will be invited to select one before proceeding.
  3. The task panel is launched where you can select the radial distance, the tangential distance, the number of circular layers, the symmetry parameter, and the center of the axis of rotation.
  4. You can click on the 3D view to simultaneously set the position of the center of rotation, and complete the command. Otherwise, just press Enter or the OK button to complete the operation.

Notes

  • By default, the axis of rotation is the positive Z axis (0, 0, 1). This can be changed in the property editor after the object is created.
  • 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 OrthoArray and PolarArray 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.

  • Radial distance: the distance from the center of the array to the next circular layer, and between subsequent circular layers.
  • Tangential distance: the distance from one element in the array to the next element in the same circular layer. This distance determines how many elements will be in the array; if the number is small, there will be many tightly packed copies; if the number is large, there will only be a few copies. This distance cannot be zero.
  • Number of circular layers: the original object is considered one layer by itself. There must be minimum 2, maximum 99.
  • Symmetry: determines how the objects will be distributed in the array.
With symmetry 1 the first element needs to be rotated a full circle to reach the same position, with 2 a rotation of half a circle (180°) is sufficient, with 3 a one third rotation of a circle (120°) is enough. This means that the symmetry parameter determines a rotation of 360°/n. For large values of symmetry the number of objects in the circular layers decreases, that eventually no object will be placed in the inner circle at all. In most cases you want a number between 1 and 6.
  • Center of rotation: the coordinates through which the axis of rotation goes through.
  • Reset point: it resets the center of rotation to the origin (0, 0, 0).
  • 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

A CircularArray object internally is the same object produced with the OrthoArray tool. It is based on Part Feature (Part::Feature class), and thus shares all properties of the latter.

See the OrthoArray tool for the complete description of the properties. All properties apply, except for those under the Orthogonal array and Polar array groups.

  • For circular arrays, the DataCenter (VectorDistance) specifies an offset from the DataPlacement of the DataBase object. That is, to keep the circular array centered on the DataBase object, keep DataCenter to the default value (0, 0, 0).

Scripting

See also: Draft API and FreeCAD Scripting Basics.

The Array tool can be used in macros and from the Python console by using the following function.

array = make_circular_array(base_object,
                            r_distance=100, tan_distance=50,
                            number=3, symmetry=1,
                            axis=App.Vector(0, 0, 1), center=App.Vector(0, 0, 0),
                            use_link=True):
  • Creates an "Array" object from the base_objectj.
    • The values of r_distance and tan_distance correspond to the radial and tangential distances of the elements in the array.
    • The value of number is the number of circular layers in the circular pattern; the original object counts as the first layer.
    • The value of symmetry is an integer that participates in some calculations that affect the way the copies are distributed around the circumferences. Usual values are from 1 to 6; higher values are not recommended and will make the copies in the inner layers to disappear.
    • The values of axis and center are vectors that describe the direction of the axis of rotation, and a point through which that axis goes.
    • If use_link is true the created copies will be App Links and not regular copies.

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

tri = Draft.make_polygon(3, 600)

array = Draft.make_circular_array(tri, 1800, 1200, 4, 1)
doc.recompute()