Draft PointArray: Difference between revisions
(Please do not add translate units manually. They are added automatically once the page is marked for translation. Limitations section removed: no need to mention the tool is not available before v0.18, that's what the Version is for in GuiCommand.) |
m (cleanup changed page name) |
||
(27 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
<languages/> |
<languages/> |
||
<translate> |
<translate> |
||
<!--T:21--> |
|||
{{Docnav |
|||
|[[Draft_PathArray|Path Array]] |
|||
|[[Draft_Clone|Clone]] |
|||
|[[Draft_Module|Draft]] |
|||
|IconL=Draft_PathArray.svg |
|||
|IconC=Workbench_Draft.svg |
|||
|IconR=Draft_Clone.svg |
|||
}} |
|||
<!--T:1--> |
|||
{{GuiCommand |
{{GuiCommand |
||
|Name=Draft PointArray |
|Name=Draft PointArray |
||
Line 7: | Line 18: | ||
|MenuLocation=Draft → PointArray |
|MenuLocation=Draft → PointArray |
||
|Version=0.18 |
|Version=0.18 |
||
|SeeAlso=[[Draft Array|Draft Array]], [[Draft PathArray]] |
|SeeAlso=[[Draft Array|Draft Array]], [[Draft PathArray|Draft PathArray]] |
||
}} |
}} |
||
==Description== |
==Description== <!--T:2--> |
||
<!--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--> |
|||
The PointArray 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]], [[PartDesign Workbench|PartDesign]], or [[Arch Workbench|Arch Workbench]]es. |
|||
<!--T:16--> |
|||
To position copies in an orthogonal array use [[Draft Array|Draft Array]]; to position copies along a path use [[Draft PathArray|Draft PathArray]]; to create copies or clones, and manually place them use [[Draft Move|Draft Move]], [[Draft Rotate|Draft Rotate]], and [[Draft Clone|Draft Clone]]. |
|||
⚫ | |||
[[Image:Draft_PointArray_Example.png|400px]] |
[[Image:Draft_PointArray_Example.png|400px]] |
||
<translate> |
<translate> |
||
<!--T:17--> |
|||
{{Caption|Object arranged at specific points}} |
|||
==Usage== <!--T:4--> |
|||
==How to use== |
|||
<!--T:5--> |
|||
# Create a shape object you wish to distribute. You will get the best results if your object is '''centred around the origin''', that is, if its {{PropertyData|position}} is [0, 0, 0]. |
|||
# Select an object that you wish to distribute. |
|||
# Place points using [[Draft Point]]. |
|||
# Select |
# Select a point compound. |
||
# |
# Press the {{Button|[[Image:Draft_PointArray.svg|16px]] [[Draft PointArray|Draft PointArray]]}} button. |
||
<!--T:18--> |
|||
⚫ | |||
To create a point compound select various [[Draft Point|Draft Point]]s and then press the {{Button|[[Image:Draft Upgrade.svg|16px]] [[Draft Upgrade|Draft Upgrade]]}} button. |
|||
<!--T:19--> |
|||
* The array starts with shape copies which are not aligned to the path, nor translated to a new position by default. You can then change the alignment and/or translation vector in the properties. |
|||
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. |
|||
⚫ | |||
⚫ | |||
<!--T:7--> |
|||
⚫ | |||
There are no options for this tool. Either it works with the selected objects or not. |
|||
* {{PropertyData|Count}}: The number of times to copy the shape (read only) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
<!--T:9--> |
|||
⚫ | |||
⚫ | |||
* {{PropertyData|Count}}: (read-only) specifies the number of copies of the base object. This number will depend on the number of [[Draft Point|Draft Point]]s in the compound. |
|||
* {{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 compounds could be created with [[Part Compound|Part Compound]] ({{PropertyData|Links}} attribute) or with [[Draft Upgrade|Draft Upgrade]] ({{PropertyData|Componets}} attribute). |
|||
⚫ | |||
{{Emphasis|See also:}} [[Draft API|Draft API]] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]]. |
|||
<!--T:11--> |
|||
⚫ | |||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
makePointArray(base, ptlst) |
PointArray = makePointArray(base, ptlst) |
||
}} |
}} |
||
<translate> |
<translate> |
||
⚫ | |||
<!--T:12--> |
|||
* Creates a {{incode|PointArray}} object from the {{incode|base}} object, by placing the copies along {{incode|ptlst}}. |
|||
⚫ | |||
<!--T:13--> |
|||
Example: |
Example: |
||
</translate> |
</translate> |
||
Line 51: | Line 86: | ||
import FreeCAD, Draft |
import FreeCAD, Draft |
||
Polygon = Draft.makePolygon(3, radius=500.0) |
|||
p1 = Draft.makePoint(FreeCAD.Vector(1500, 0, 0)) |
p1 = Draft.makePoint(FreeCAD.Vector(1500, 0, 0)) |
||
p2 = Draft.makePoint(FreeCAD.Vector(2500, 0, 0)) |
p2 = Draft.makePoint(FreeCAD.Vector(2500, 0, 0)) |
||
p3 = Draft.makePoint(FreeCAD.Vector(2000, 1000, 0)) |
p3 = Draft.makePoint(FreeCAD.Vector(2000, 1000, 0)) |
||
⚫ | |||
addList, deleteList = Draft.upgrade([p1, p2, p3]) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
compound = addList[0] |
|||
⚫ | |||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T:20--> |
|||
==Usage Notes== |
|||
{{Docnav |
|||
* {{emphasis|in progress}} |
|||
|[[Draft_PathArray|Path Array]] |
|||
|[[Draft_Clone|Clone]] |
|||
|[[Draft_Module|Draft]] |
|||
|IconL=Draft_PathArray.svg |
|||
|IconC=Workbench_Draft.svg |
|||
|IconR=Draft_Clone.svg |
|||
}} |
|||
</translate> |
</translate> |
||
{{Draft Tools navi{{#translation:}}}} |
|||
{{Userdocnavi{{#translation:}}}} |
|||
{{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
- Select an object that you wish to distribute.
- Select a point compound.
- 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 thebase
object, by placing the copies alongptlst
. ptlst
is an object withGeometry
,Links
, orComponents
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)
- Drafting: Line, Polyline, Fillet, Arc, Arc by 3 points, Circle, Ellipse, Rectangle, Polygon, B-spline, Cubic Bézier curve, Bézier curve, Point, Facebinder, ShapeString, Hatch
- Annotation: Text, Dimension, Label, Annotation styles, Annotation scale
- Modification: Move, Rotate, Scale, Mirror, Offset, Trimex, Stretch, Clone, Array, Polar array, Circular array, Path array, Path link array, Point array, Point link array, Edit, Subelement highlight, Join, Split, Upgrade, Downgrade, Wire to B-spline, Draft to sketch, Set slope, Flip dimension, Shape 2D view
- Draft Tray: Select plane, Set style, Toggle construction mode, AutoGroup
- Snapping: Snap lock, Snap endpoint, Snap midpoint, Snap center, Snap angle, Snap intersection, Snap perpendicular, Snap extension, Snap parallel, Snap special, Snap near, Snap ortho, Snap grid, Snap working plane, Snap dimensions, Toggle grid
- Miscellaneous: Apply current style, Layer, Manage layers, Add a new named group, Move to group, Select group, Add to construction group, Toggle normal/wireframe display, Create working plane proxy, Heal, Show snap toolbar
- Additional: Constraining, Pattern, Preferences, Import Export Preferences, DXF/DWG, SVG, OCA, DAT
- Context menu:
- Layer container: Merge layer duplicates, Add new layer
- Layer: Activate this layer, Select layer contents
- Text: Open hyperlinks
- Wire: Flatten
- Working plane proxy: Write camera position, Write objects state
- Getting started
- Installation: Download, Windows, Linux, Mac, Additional components, Docker, AppImage, Ubuntu Snap
- Basics: About FreeCAD, Interface, Mouse navigation, Selection methods, Object name, Preferences, Workbenches, Document structure, Properties, Help FreeCAD, Donate
- Help: Tutorials, Video tutorials
- Workbenches: Std Base, Arch, Assembly, CAM, Draft, FEM, Inspection, Mesh, OpenSCAD, Part, PartDesign, Points, Reverse Engineering, Robot, Sketcher, Spreadsheet, Start, Surface, TechDraw, Test Framework, Web
- Hubs: User hub, Power users hub, Developer hub