Draft PointArray: Difference between revisions

From FreeCAD Documentation
No edit summary
(Added 'In progress')
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{Page_in_progress}}
<languages/>
<languages/>
<translate>
<translate>

<!--T:21-->
<!--T:21-->
{{Docnav
{{Docnav
|[[Draft_PathLinkArray|PathLinkArray]]
|[[Draft_PathArray|Path Array]]
|[[Draft_PointLinkArray|PointLinkArray]]
|[[Draft_Clone|Clone]]
|[[Draft_Module|Draft]]
|[[Draft_Module|Draft]]
|IconL=Draft_PathArray.svg
|IconL=Draft_PathLinkArray.svg
|IconR=Draft_Clone.svg
|IconR=Draft_PointLinkArray.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
Line 14: Line 16:
{{GuiCommand
{{GuiCommand
|Name=Draft PointArray
|Name=Draft PointArray
|MenuLocation=Modification → Array tools → Point Array
|MenuLocation=Modification → Array tools → Point array
|Workbenches=[[Draft_Module|Draft]], [[Arch_Module|Arch]]
|Workbenches=[[Draft_Module|Draft]], [[Arch_Module|Arch]]
|Version=0.18
|Version=0.18
Line 78: Line 80:
A [[Draft_PointArray|PointArray]] is derived from a [[Part_Feature|Part Feature]] ({{incode|Part::Feature}} class), therefore it shares all the latter's properties. In addition to the properties described in [[Part_Feature|Part Feature]], the PointArray has the following properties in the [[property editor|property editor]].
A [[Draft_PointArray|PointArray]] is derived from a [[Part_Feature|Part Feature]] ({{incode|Part::Feature}} class), therefore it shares all the latter's properties. In addition to the properties described in [[Part_Feature|Part Feature]], the PointArray has the following properties in the [[property editor|property editor]].


<!--T:9-->
{{TitleProperty|Objects}}
{{TitleProperty|Objects}}

<!--T:9-->
* {{PropertyData|Base|Link}}: the object to duplicate; it must have a [[Part_TopoShape|Part TopoShape]].
* {{PropertyData|Base|Link}}: the object to duplicate; it must have a [[Part_TopoShape|Part TopoShape]].
* {{PropertyData|Count|Integer}}: (read-only) specifies the number of copies in the array. This property is read-only because the number of copies is determined by the number of points inside of {{PropertyData|Point Object}}.
* {{PropertyData|Count|Integer}}: (read-only) specifies the number of copies in the array. This property is read-only because the number of copies is determined by the number of points inside of {{PropertyData|Point Object}}.
Line 85: Line 88:
* {{PropertyData|Point Object|Link}}: specifies a compound object with points that indicate where the copies of the {{PropertyData|Base}} object will appear. The compound object needs to have one of {{PropertyData|Links}}, {{PropertyData|Components}}, or {{PropertyData|Geometry}} properties, and contain at least one element with {{PropertyData|X}}, {{PropertyData|Y}}, and {{PropertyData|Z}} attributes.
* {{PropertyData|Point Object|Link}}: specifies a compound object with points that indicate where the copies of the {{PropertyData|Base}} object will appear. The compound object needs to have one of {{PropertyData|Links}}, {{PropertyData|Components}}, or {{PropertyData|Geometry}} properties, and contain at least one element with {{PropertyData|X}}, {{PropertyData|Y}}, and {{PropertyData|Z}} attributes.


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

{{Emphasis|See also:}} [[Draft API|Draft API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].
<!--T:10-->
See also: [https://www.freecadweb.org/api Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].


<!--T:11-->
<!--T:11-->
Line 92: Line 97:


<!--T:29-->
<!--T:29-->
Older call
Older call:

</translate>
</translate>
{{Code|code=
{{Code|code=
Line 100: Line 106:


<!--T:30-->
<!--T:30-->
New call
New call:

</translate>
</translate>
{{Code|code=
{{Code|code=
Line 114: Line 121:


<!--T:13-->
<!--T:13-->
Example:
Example:

</translate>
</translate>
{{Code|code=
{{Code|code=
Line 135: Line 143:
}}
}}
<translate>
<translate>



<!--T:20-->
<!--T:20-->
{{Docnav
{{Docnav
|[[Draft_PathLinkArray|PathLinkArray]]
|[[Draft_PathArray|Path Array]]
|[[Draft_PointLinkArray|PointLinkArray]]
|[[Draft_Clone|Clone]]
|[[Draft_Module|Draft]]
|[[Draft_Module|Draft]]
|IconL=Draft_PathArray.svg
|IconL=Draft_PathLinkArray.svg
|IconR=Draft_Clone.svg
|IconR=Draft_PointLinkArray.svg
|IconC=Workbench_Draft.svg
|IconC=Workbench_Draft.svg
}}
}}
Line 149: Line 158:
{{Draft Tools navi{{#translation:}}}}
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}

Revision as of 19:40, 25 March 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 PointArray

Menu location
Modification → Array tools → Point array
Workbenches
Draft, Arch
Default shortcut
None
Introduced in version
0.18
See also
Draft OrthoArray, Draft PolarArray, Draft CircularArray, Draft PathArray, Draft PathLinkArray, Draft PointLinkArray, Draft Clone

Description

The Draft PointArray tool places copies of a selected shape along various selected points.

The PointArray 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 at specific points

Usage

  1. Select the object that you wish to distribute.
  2. Select a point compound.
  3. Press the PointArray button.

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.

Point compound

The point compound object can be created in different ways.

In essence, the object to be used as the compound must have one of three properties, DataComponents, DataLinks, or DataGeometry, and inside that compound, there must be at least one point with DataX, DataY, and DataZ properties.

Note: in the case of Draft Point and Part Point the array will try to position the copies using the DataPlacement of the point. In the case of a Sketcher Point, the position will be taken from its internal X, Y, and Z attributes.

Note 2: for Draft Point its DataPlacement always follows the values of DataX, DataY, DataZ, so modifying these values is enough to produce the desired displacement. However, for Part Point, the net displacement is given by the sum of DataPlacement with the vector with components DataX, DataY, and DataZ.

Options

There are no options for this tool. Either it works with the selected objects or not.

Properties

A PointArray 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 PointArray has the following properties in the property editor.

Objects

  • DataBase (Link): the object to duplicate; it must have a Part TopoShape.
  • DataCount (Integer): (read-only) specifies the number of copies in the array. This property is read-only because the number of copies is determined by the number of points inside of DataPoint Object.
  • DataExtra Placement (Placement): specifies an additional placement, translation and rotation, that will be applied to each copy in the array. Each copy normally appears with the same rotation as the DataBase object; with this property it is possible to provide additional rotation, or counter the original rotation, and make small adjustments to the position of the copies. introduced in version 0.19
  • DataPoint Object (Link): specifies a compound object with points that indicate where the copies of the DataBase object will appear. The compound object needs to have one of DataLinks, DataComponents, or DataGeometry properties, and contain at least one element with DataX, DataY, and DataZ attributes.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

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

Older call:

point_array = makePointArray(base_object, point_object)

New call:

point_array = make_point_array(base_object, point_object, extra=None):
  • Creates a "PointArray" object from the base_object, by placing the copies in the points contained within point_object.
    • point_object should have one of Geometry, Links, or Components attributes containing points.
    • Instead of a reference to an object, base_object and point_object can also be Labels (strings) of objects existing in the current document.
    • extra can be a full App.Placement, or just an App.Vector or App.Rotation.

Example:

import FreeCAD as App
import Draft

doc = App.newDocument()

polygon = Draft.make_polygon(3, radius=500.0)

p1 = Draft.make_point(App.Vector(1500, 0, 0))
p2 = Draft.make_point(App.Vector(2500, 0, 0))
p3 = Draft.make_point(App.Vector(2000, 1000, 0))

compound = doc.addObject("Part::Compound", "Compound")
compound.Links = [p1, p2, p3]

point_array = Draft.make_point_array(polygon, compound)
doc.recompute()