Draft CircularArray: Difference between revisions

From FreeCAD Documentation
(Remove {{UnfinishedDocu}})
(Removed Preferences paragraph.)
 
(51 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:1-->
{{Docnav
{{Docnav
|[[Draft_PolarArray|PolarArray]]
|[[Draft_Draft2Sketch|Draft to Sketch]]
|[[Draft_PathArray|PathArray]]
|[[Draft_LinkArray|Link Array]]
|[[Draft_Module|Draft]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Draft2Sketch.svg
|IconL=Draft_PolarArray.svg
|IconR=Draft_PathArray.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
|IconR=Draft_LinkArray.svg
}}
}}


<!--T:2-->
{{GuiCommand
{{GuiCommand
|Name=Draft CircularArray
|Name=Draft CircularArray
|MenuLocation=Draft → Circular array
|MenuLocation=Modification → Array tools → Circular array
|Workbenches=[[Draft Module|Draft]]
|Workbenches=[[Draft_Workbench|Draft]], [[Arch_Workbench|Arch]]
|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_PointLinkArray|Draft PointLinkArray]]
}}
}}


==Description==
==Description== <!--T:3-->


<!--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 [[Image:Draft_CircularArray.svg|24px]] '''Draft CircularArray''' command creates an array from a selected object by placing copies along concentric circumferences. The command can optionally create a [[App_Link|Link]] array, which is more efficient than a regular array.


<!--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]].
The command can be used on 2D objects created with the [[Draft_Workbench|Draft Workbench]] or [[Sketcher_Workbench|Sketcher Workbench]], but also on many 3D objects such as those created with the [[Part_Workbench|Part Workbench]], [[PartDesign_Workbench|PartDesign Workbench]] or [[Arch_Workbench|Arch Workbench]].

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]].


</translate>
</translate>
[[Image:Draft_CircularArray_example.png|400px]]
[[Image:Draft_CircularArray_example.png|400px]]
<translate>
<translate>
<!--T:7-->
{{Caption|Draft CircularArray}}


== Usage == <!--T:8-->
{{Caption|A circular array of an object.}}


<!--T:28-->
== How to use ==
See also: [[Draft_Snap|Draft Snap]].


<!--T:9-->
# Select an object from which you wish to make the circular array.
# Optionally select one object.
# 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.
# There are several ways to invoke the command:
# Choose the radial distance, which determines the distance from the center of the array to the next circular layer, and between subsequent circular layers.
#* Press the {{Button|[[Image:Draft_CircularArray.svg|16px]] [[Draft_CircularArray|Circular array]]}} button.
# 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.
#* Select the {{MenuCommand|Modification → Array tools → [[Image:Draft_CircularArray.svg|16px]] Circular array}} option from the menu.
# Choose the number of circular layers. The original object is considered one layer by itself. Minimum of 2, maximum of 99.
# The {{MenuCommand|Circular array}} task panel opens. See [[#Options|Options]] for more information.
# Choose the symmetry number, which determines how the objects will be distributed in the array. Choose a number between 1 and 10.
# If you have not yet selected an object: select one object.
# 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.
# Enter the required parameters in the task panel.
# Optionally, check the fuse or link options.
# To finish the command do one of the following:
# Press {{Button|OK}} to complete the command.
#* Pick a point in the [[3D_view|3D view]] for the {{MenuCommand|Center of rotation}}.
#* Press {{KEY|Enter}}.
#* Press the {{Button|OK}} button.


== Options == <!--T:11-->
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.
* 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.


<!--T:12-->
== Options ==
* Enter the {{MenuCommand|Radial distance}} to specify the distance between the circular layers, and between the center and the first circular layer.
* Enter the {{MenuCommand|Tangential distance}} to specify the distance between the elements on the same circular layer. Must be larger than zero.
* Enter the {{MenuCommand|Number of circular layers}}. The element at the center counts as one layer. Must be at least {{Value|2}}. The maximum that can be entered in the task panel is {{Value|99}}, but higher values are possible by changing the {{PropertyData|Number Circles}} property of the array.
* Enter the {{MenuCommand|Symmetry}} value. This number determines how the elements are distributed. A value of {{Value|3}}, for example, results in a pattern with three equal 120° pie segments. Larger values for the {{MenuCommand|Symmetry}} and the {{MenuCommand|Tangential distance}} result in fewer or even no elements on the inner layers.
* Pick a point in the [[3D_view|3D view]], note that this will also finish the command, or type coordinates for the {{MenuCommand|Center of rotation}}. The rotation axis of the array will pass through this point. It is advisable to move the pointer out of the [[3D_view|3D view]] before entering coordinates.
* Press the {{MenuCommand|Reset point}} button to reset the {{MenuCommand|Center of rotation}} to the origin.
* If the {{MenuCommand|Fuse}} checkbox is checked overlapping elements in the array are fused. This does not work for Link arrays.
* If the {{MenuCommand|Link array}} checkbox is checked a Link array instead of a regular array is created. A Link array is more efficient because its elements are [[App_Link|App Link]] objects.
* Press {{KEY|Esc}} or the {{Button|Cancel}} button to abort the command.


==Notes== <!--T:29-->
* Press {{Button|Reset point}} to set the center of the circular patterns to the origin {{Value|(0, 0, 0)}}.
* 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.
* 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.
* Press {{KEY|Esc}} or the {{Button|Cancel}} button to abort the current command.


<!--T:10-->
== Properties ==
* The default rotation axis for the array is the positive Z axis. This can be changed by editing its {{PropertyData|Axis}} property.
* A Draft CircularArray can be turned into a [[Draft_OrthoArray|Draft OrthoArray]] or a [[Draft_PolarArray|Draft PolarArray]] by changing its {{PropertyData|Array Type}} property.
* A Link array cannot be turned into a regular array or vice versa. The type of array must be decided at creation time.


== Properties == <!--T:13-->
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.


<!--T:15-->
See the [[Draft_Array|Array]] tool for the complete information.
See [[Draft_OrthoArray#Properties|Draft OrthoArray]].


== Scripting ==
== Scripting == <!--T:16-->


<!--T:17-->
{{Emphasis|See also:}} [[Draft API|Draft API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].


<!--T:18-->
The Array tool can be used in [[macros|macros]] and from the [[Python_console|Python console]] by using the following function.
To create a circular array use the {{incode|make_array}} method ({{Version|0.19}}) of the Draft module. This method replaces the deprecated {{incode|makeArray}} method. The {{incode|make_array}} method can create [[Draft_OrthoArray|Draft OrthoArrays]], [[Draft_PolarArray|Draft PolarArrays]] and Draft CircularArrays. For each array type one or more wrappers are available.

<!--T:33-->
The main method:


</translate>
</translate>
{{Code|code=
{{Code|code=
array = make_array(base_object, arg1, arg2, arg3, arg4=None, arg5=None, arg6=None, use_link=True)
array_list = make_circular_array(obj, r_distance, tan_distance,
axis, center, number, symmetry,
use_link)
}}
}}
<translate>
<translate>


<!--T:34-->
* Creates an array from the objects contained in {{incode|obj}}, which can be a single object or a list of objects.
The wrapper for circular arrays is:
* 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. 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.
* {{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}}.


</translate>
{{Code|code=
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)
}}
<translate>

<!--T:19-->
* {{incode|base_object}} is the object to be arrayed. It can also be the {{incode|Label}} (string) of an object in the current document.
* {{incode|r_distance}} and {{incode|tan_distance}} are the radial and tangential distances between the elements.
* {{incode|number}} is the number of circular layers in the pattern, the original object counts as the first layer.
* {{incode|symmetry}} is an integer used in some calculations that affect the way the elements are distributed around the circumferences. Usual values are from 1 to 6. Higher values are not recommended and will make the elements in the inner layers disappear.
* {{incode|axis}} and {{incode|center}} are vectors that describe the direction of the axis of rotation, and a point through which that axis passes.
* If {{incode|use_link}} is {{incode|True}} the created elements are [[App_Link|App Links]] instead of regular copies.
* {{incode|array}} is returned with the created array object.

<!--T:20-->
Example:
Example:

</translate>
</translate>
{{Code|code=
{{Code|code=
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>



{{Draft Tools navi}}
<!--T:21-->
{{Userdocnavi}}
{{Docnav
|[[Draft_PolarArray|PolarArray]]
|[[Draft_PathArray|PathArray]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_PolarArray.svg
|IconR=Draft_PathArray.svg
|IconC=Workbench_Draft.svg
}}

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

Latest revision as of 19:49, 7 December 2023

Draft CircularArray

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

Description

The Draft CircularArray command creates an array from a selected object by placing copies along concentric circumferences. The command can optionally create a Link array, which is more efficient than a regular array.

The command can be used on 2D objects created with the Draft Workbench or Sketcher Workbench, but also on many 3D objects such as those created with the Part Workbench, PartDesign Workbench or Arch Workbench.

Draft CircularArray

Usage

See also: Draft Snap.

  1. Optionally select one object.
  2. There are several ways to invoke the command:
    • Press the Circular array button.
    • Select the Modification → Array tools → Circular array option from the menu.
  3. The Circular array task panel opens. See Options for more information.
  4. If you have not yet selected an object: select one object.
  5. Enter the required parameters in the task panel.
  6. To finish the command do one of the following:
    • Pick a point in the 3D view for the Center of rotation.
    • Press Enter.
    • Press the OK button.

Options

  • Enter the Radial distance to specify the distance between the circular layers, and between the center and the first circular layer.
  • Enter the Tangential distance to specify the distance between the elements on the same circular layer. Must be larger than zero.
  • Enter the Number of circular layers. The element at the center counts as one layer. Must be at least 2. The maximum that can be entered in the task panel is 99, but higher values are possible by changing the DataNumber Circles property of the array.
  • Enter the Symmetry value. This number determines how the elements are distributed. A value of 3, for example, results in a pattern with three equal 120° pie segments. Larger values for the Symmetry and the Tangential distance result in fewer or even no elements on the inner layers.
  • Pick a point in the 3D view, note that this will also finish the command, or type coordinates for the Center of rotation. The rotation axis of the array will pass through this point. It is advisable to move the pointer out of the 3D view before entering coordinates.
  • Press the Reset point button to reset the Center of rotation to the origin.
  • If the Fuse checkbox is checked overlapping elements in the array are fused. This does not work for Link arrays.
  • If the Link array checkbox is checked a Link array instead of a regular array is created. A Link array is more efficient because its elements are App Link objects.
  • Press Esc or the Cancel button to abort the command.

Notes

  • The default rotation axis for the array is the positive Z axis. This can be changed by editing its DataAxis property.
  • A Draft CircularArray can be turned into a Draft OrthoArray or a Draft PolarArray by changing its DataArray Type property.
  • A Link array cannot be turned into a regular array or vice versa. The type of array must be decided at creation time.

Properties

See Draft OrthoArray.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To create a circular 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 wrapper for circular arrays is:

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)
  • base_object is the object to be arrayed. It can also be the Label (string) of an object in the current document.
  • r_distance and tan_distance are the radial and tangential distances between the elements.
  • number is the number of circular layers in the pattern, the original object counts as the first layer.
  • symmetry is an integer used in some calculations that affect the way the elements are distributed around the circumferences. Usual values are from 1 to 6. Higher values are not recommended and will make the elements in the inner layers disappear.
  • axis and center are vectors that describe the direction of the axis of rotation, and a point through which that axis passes.
  • 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()

tri = Draft.make_polygon(3, 600)

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