Draft PointArray: Difference between revisions

From FreeCAD Documentation
m (Changed section to 'Usage')
m (cleanup changed page name)
(2 intermediate revisions by 2 users not shown)
Line 24: Line 24:


<!--T:3-->
<!--T:3-->
The PointArray tool places copies of a selected shape along various selected points.
The {{Button|[[Image:Draft_PointArray.svg|16px]] [[Draft PointArray|Draft PointArray]]}} tool places copies of a selected shape along various selected points.


<!--T:15-->
<!--T:15-->
Line 63: Line 63:
* {{PropertyData|PointList}}: specifies a compound object with point objects that indicate where the copies of the {{PropertyData|Base}} object will appear.
* {{PropertyData|PointList}}: specifies a compound object with point objects that indicate where the copies of the {{PropertyData|Base}} object will appear.
The compound object needs to have a {{PropertyData|Links}}, {{PropertyData|Componets}}, or {{PropertyData|Geometry}} attribute. Each of the objects inside the compound should be [[Draft Point|Draft Points]] that have {{PropertyData|X}}, {{PropertyData|Y}}, and {{PropertyData|Z}} attributes.
The compound object needs to have a {{PropertyData|Links}}, {{PropertyData|Componets}}, or {{PropertyData|Geometry}} attribute. Each of the objects inside the compound should be [[Draft Point|Draft Points]] that have {{PropertyData|X}}, {{PropertyData|Y}}, and {{PropertyData|Z}} attributes.
The compounds could be created with [[Part MakeCompound|Part MakeCompound]] ({{PropertyData|Links}} attribute) or with [[Draft Upgrade|Draft Upgrade]] ({{PropertyData|Componets}} attribute).
The compounds could be created with [[Part Compound|Part Compound]] ({{PropertyData|Links}} attribute) or with [[Draft Upgrade|Draft Upgrade]] ({{PropertyData|Componets}} attribute).


==Scripting== <!--T:10-->
==Scripting== <!--T:10-->
Line 112: Line 112:
}}
}}


<!--T:22-->
{{Draft Tools navi}}

<!--T:23-->
{{Userdocnavi}}
</translate>
</translate>
{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}
{{clear}}
{{clear}}

Revision as of 11:45, 25 February 2020

Draft PointArray

Menu location
Draft → PointArray
Workbenches
Draft, Arch
Default shortcut
None
Introduced in version
0.18
See also
Draft Array, Draft PathArray

Description

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

The PointArray tool can be used on 2D shapes created with the Draft Workbench, but can also be used on many types of 3D objects such as those created with the Part, PartDesign, or Arch Workbenches.

To position copies in an orthogonal array use Draft Array; to position copies along a path use Draft PathArray; to create copies or clones, and manually place them use Draft Move, Draft Rotate, and Draft Clone.

Object arranged at specific points

Usage

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

To create a point compound select various Draft Points and then press the Draft Upgrade 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.

Options

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

Properties

  • DataBase: the object to duplicate.
  • DataCount: (read-only) specifies the number of copies of the base object. This number will depend on the number of Draft Points in the compound.
  • DataPointList: specifies a compound object with point objects that indicate where the copies of the DataBase object will appear.

The compound object needs to have a DataLinks, DataComponets, or DataGeometry attribute. Each of the objects inside the compound should be Draft Points that have DataX, DataY, and DataZ attributes. The compounds could be created with Part Compound (DataLinks attribute) or with Draft Upgrade (DataComponets attribute).

Scripting

See also: Draft API and FreeCAD Scripting Basics.

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

PointArray = makePointArray(base, ptlst)
  • Creates a PointArray object from the base object, by placing the copies along ptlst.
  • ptlst is an object with Geometry, Links, or Components attributes that define the position of the copies.

Example:

import FreeCAD, Draft

Polygon = Draft.makePolygon(3, radius=500.0)

p1 = Draft.makePoint(FreeCAD.Vector(1500, 0, 0))
p2 = Draft.makePoint(FreeCAD.Vector(2500, 0, 0))
p3 = Draft.makePoint(FreeCAD.Vector(2000, 1000, 0))

# Create a compound of points
addList, deleteList = Draft.upgrade([p1, p2, p3])

# Extract the compound from the list
compound = addList[0]

PointArray = Draft.makePointArray(Polygon, compound)