Draft PointArray: Difference between revisions
m (cleanup changed page name) |
(→Point compound: Repeat the previous method but instead of a compound use Draft_Upgrade to create a "Block".) |
||
(5 intermediate revisions by the same user not shown) | |||
Line 27: | Line 27: | ||
<!--T:15--> |
<!--T:15--> |
||
The PointArray tool can be used on 2D shapes created with the [[ |
The PointArray 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 the [[Part_Workbench|Part]], [[PartDesign_Workbench|PartDesign]], or the [[Arch_Workbench|Arch Workbenches]]. |
||
<!--T:16--> |
<!--T:16--> |
||
* To create orthogonal, polar or circular arrays, use the corresponding {{Button|[[File:Draft_OrthoArray.svg|16px]] [[Draft_OrthoArray|OrthoArray]]}}, {{Button|[[File:Draft_PolarArray.svg|16px]] [[Draft_PolarArray|PolarArray]]}}, or {{Button|[[File:Draft_CircularArray.svg|16px]] [[Draft_CircularArray|CircularArray]]}} tools. |
|||
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]]. |
|||
* To position copies along a path use {{Button|[[File:Draft_PathArray.svg|16px]] [[Draft_PathArray|PathArray]]}}. |
|||
* 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 44: | ||
<!--T:5--> |
<!--T:5--> |
||
# Select |
# Select the object that you wish to distribute. |
||
# Select a point compound. |
# Select a point compound. |
||
# Press the {{Button|[[Image:Draft_PointArray.svg|16px]] [[Draft PointArray|Draft PointArray]]}} button. |
# Press the {{Button|[[Image:Draft_PointArray.svg|16px]] [[Draft PointArray|Draft PointArray]]}} button. |
||
⚫ | |||
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--> |
<!--T:19--> |
||
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. |
||
=== Point compound === |
|||
⚫ | |||
The point compound object can be created in different ways. |
|||
* Create various {{Button|[[File:Draft_Point.svg|16px]] [[Draft_Point|Draft Points]]}} or {{Button|[[File:Part_Point.svg|16px]] [[Part_Point|Part Vertices]]}}, and then press {{Button|[[File:Part_Compound.svg|16px]] [[Part_Compound|Part Compound]]}} to create the compound. |
|||
* Repeat the previous method but instead of a compound use {{Button|[[Image:Draft_Upgrade.svg|16px]] [[Draft_Upgrade|Draft Upgrade]]}} to create a "Block". |
|||
* Create a {{Button|[[File:Sketcher_NewSketch.svg|16px]] [[Sketch|Sketch]]}}, and inside add various {{Button|[[File:Sketcher_CreatePoint.svg|16px]] [[Sketcher_CreatePoint|Points]]}}. |
|||
In essence, the object to be used as the compound must have one of three properties, {{PropertyData|Components}}, {{PropertyData|Links}}, or {{PropertyData|Geometry}}, and inside that compound, there must be at least one point with {{PropertyData|X}}, {{PropertyData|Y}}, and {{PropertyData|Z}} properties defining its position. |
|||
==Options== <!--T:6--> |
==Options== <!--T:6--> |
||
Line 58: | Line 68: | ||
==Properties== <!--T:8--> |
==Properties== <!--T:8--> |
||
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]]. |
|||
{{TitleProperty|Objects}} |
|||
<!--T:9--> |
<!--T:9--> |
||
* {{PropertyData|Base}}: the object to duplicate. |
* {{PropertyData|Base|Link}}: the object to duplicate; it must have a [[Part_TopoShape|Part TopoShape]]. |
||
* {{PropertyData|Count}}: (read-only) specifies the number of copies |
* {{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|Extra Placement|Placement}}: specifies an additional [[Placement|placement]], translation and rotation, that will be applied to each copy in the array. Each copy normally appears with the same rotation as the {{PropertyData|Base}} 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. {{Version|0.19}} |
|||
* {{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 |
* {{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. |
||
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 70: | Line 82: | ||
<!--T:11--> |
<!--T:11--> |
||
The PointArray tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following function: |
The PointArray tool can be used in [[macros|macros]] and from the [[Python|Python]] console by using the following function: |
||
Older call |
|||
</translate> |
|||
{{Code|code= |
|||
point_array = makePointArray(base_object, point_object) |
|||
}} |
|||
<translate> |
|||
New call |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
point_array = make_point_array(base_object, point_object, extra=None): |
|||
PointArray = makePointArray(base, ptlst) |
|||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T:12--> |
<!--T:12--> |
||
* Creates a {{incode|PointArray}} object from the {{incode| |
* Creates a {{incode|"PointArray"}} object from the {{incode|base_object}}, by placing the copies in the points contained within {{incode|point_object}}. |
||
* {{incode| |
** {{incode|point_object}} should have one of {{incode|Geometry}}, {{incode|Links}}, or {{incode|Components}} attributes containing points. |
||
** Instead of a reference to an object, {{incode|base_object}} and {{incode|point_object}} can also be {{incode|Labels}} (strings) of objects existing in the current document. |
|||
** {{incode|extra}} can be a full {{incode|App.Placement}}, or just an {{incode|App.Vector}} or {{incode|App.Rotation}}. |
|||
<!--T:13--> |
<!--T:13--> |
||
Line 84: | Line 107: | ||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
import FreeCAD |
import FreeCAD as App |
||
import Draft |
|||
doc = App.newDocument() |
|||
Polygon = Draft.makePolygon(3, radius=500.0) |
|||
polygon = Draft.make_polygon(3, radius=500.0) |
|||
⚫ | |||
⚫ | |||
⚫ | |||
# Create a compound of points |
|||
p2 = Draft.make_point(App.Vector(2500, 0, 0)) |
|||
⚫ | |||
compound = doc.addObject("Part::Compound", "Compound") |
|||
# Extract the compound from the list |
|||
compound = |
compound.Links = [p1, p2, p3] |
||
point_array = Draft.make_point_array(polygon, compound) |
|||
doc.recompute() |
|||
}} |
}} |
||
<translate> |
<translate> |
Revision as of 07:49, 4 June 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 any object that has a Part TopoShape, meaning 2D shapes created with the Draft Workbench, but also 3D solids created with the Part, PartDesign, or the Arch Workbenches.
- To create orthogonal, polar or circular arrays, use the corresponding OrthoArray, PolarArray, or CircularArray tools.
- To position copies along a path use PathArray.
- To create copies and manually place them use Move or Rotate.
- To create exact copies and manually place or scale them, use Clone or Std LinkMake.
Object arranged at specific points
Usage
- Select the object that you wish to distribute.
- Select a point compound.
- Press the Draft 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.
- Create various Draft Points or Part Vertices, and then press Part Compound to create the compound.
- Repeat the previous method but instead of a compound use Draft Upgrade to create a "Block".
- Create a Sketch, and inside add various Points.
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 defining its position.
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: Draft API 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 thebase_object
, by placing the copies in the points contained withinpoint_object
.point_object
should have one ofGeometry
,Links
, orComponents
attributes containing points.- Instead of a reference to an object,
base_object
andpoint_object
can also beLabels
(strings) of objects existing in the current document. extra
can be a fullApp.Placement
, or just anApp.Vector
orApp.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()
- 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