Draft PointArray: Difference between revisions

From FreeCAD Documentation
(Position [0,0,0])
(V0.22 -> V1.0)
 
(93 intermediate revisions by 8 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:21-->
{{Docnav
|[[Draft_PathLinkArray|PathLinkArray]]
|[[Draft_PointLinkArray|PointLinkArray]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_PathLinkArray.svg
|IconR=Draft_PointLinkArray.svg
|IconC=Workbench_Draft.svg
}}

<!--T:1-->
<!--T:1-->
{{GuiCommand
{{GuiCommand|Name=Draft PointArray|Workbenches=[[Draft Module|Draft]], [[Arch Module|Arch]]|MenuLocation=Draft → PointArray|SeeAlso=[[Draft Array|Draft Array]], [[Draft PathArray]]|Icon=Draft_PointArray.svg|Version=0.18}}
|Name=Draft PointArray
|MenuLocation=Modification → Array tools → Point array
|Workbenches=[[Draft_Workbench|Draft]], [[Arch_Workbench|Arch]]
|Version=0.18
|SeeAlso=[[Draft_OrthoArray|Draft OrthoArray]], [[Draft_PolarArray|Draft PolarArray]], [[Draft_CircularArray|Draft CircularArray]], [[Draft_PathArray|Draft PathArray]], [[Draft_PathLinkArray|Draft PathLinkArray]], [[Draft_PointLinkArray|Draft PointLinkArray]]
}}


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


<!--T:3-->
<!--T:3-->
The [[Image:Draft_PointArray.svg|24px]] '''Draft PointArray''' command creates a regular array from a selected base object by placing copies at the points from a point object. Use the [[Draft_PointLinkArray|Draft PointLinkArray]] command to create a more efficient [[App_Link|Link]] array instead. Except for the type of array that is created, Link array or regular array, the [[Draft_PointLinkArray|Draft PointLinkArray]] command is identical to this command.
The PointArray tool places copies of a selected shape along various selected points.
</translate>


<!--T:15-->
The base object can be a 2D object created with the [[Draft_Workbench|Draft Workbench]] or [[Sketcher_Workbench|Sketcher Workbench]], but also a 3D object such as those created with the [[Part_Workbench|Part Workbench]], [[PartDesign_Workbench|PartDesign Workbench]] or [[Arch_Workbench|Arch Workbench]].

<!--T:53-->
The point object can be any object with a shape and vertices (including a [[Std_Part|Std Part]] containing one or more of such objects), as well as a [[Mesh_Workbench|mesh]] and a [[Points_Workbench|point cloud]]. Duplicate points in the point object are filtered out. {{Version|0.21}}

<!--T:54-->
In {{VersionMinus|0.20}} only three point object types are supported see [[#Point_object_version_0.20_and_below|Point object version 0.20 and below]].

</translate>
[[Image:Draft_PointArray_Example.png|400px]]
[[Image:Draft_PointArray_Example.png|400px]]
<translate>
<translate>
<!--T:17-->
{{Caption|Draft PointArray}}


==How to use== <!--T:4-->
==Usage== <!--T:4-->


<!--T:5-->
<!--T:5-->
# Select the object you wish to array.
# 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].
# Add the point object to the selection.
# Place points using [[Draft Point]].
# There are several ways to invoke the command:
# Select the points and create a compound of them using [[Draft Upgrade]].
# First select your shape, then the new point compound, and then press the {{KEY|[[Image:Draft_PointArray.svg|16px]] [[Draft PointArray]]}} button.
#* Press the {{Button|[[Image:Draft_PointArray.svg|16px]] [[Draft_PointArray|Point array]]}} button.
#* Select the {{MenuCommand|Modification → Array tools → [[Image:Draft_PointArray.svg|16px]] Point array}} option from the menu.
# The array is created.
# Optionally change the [[#Properties|properties]] of the array in the [[property_editor|Property editor]].


==Options== <!--T:6-->
== Point object version 0.20 and below == <!--T:55-->


<!--T:7-->
<!--T:18-->
These are the supported point objects in {{VersionMinus|0.20}} and how they can be created:
* 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.
* [[Part_Compound|Part Compound]]: Create one or more [[Draft_Point|Draft Points]] or [[Part_Point|Part Points]], select them and invoke the [[Part_Compound|Part Compound]] command.
* Draft Block: Create one or more [[Draft_Point|Draft Points]] or [[Part_Point|Part Points]], select them and invoke the [[Draft_Upgrade|Draft Upgrade]] command.
* [[Sketcher_NewSketch|Sketcher Sketch]]: Create a [[Sketcher_NewSketch|Sketch]] and add one or more [[Sketcher_CreatePoint|Sketcher Points]] to the sketch.


==Properties== <!--T:8-->
==Properties== <!--T:8-->

<!--T:34-->
See also: [[property_editor|Property editor]].

<!--T:28-->
A Draft PointArray object is derived from a [[Part_Feature|Part Feature]] object and inherits all its properties (with the exception of some View properties that are not inherited by Link arrays). The following properties are additional unless otherwise stated:

===Data=== <!--T:35-->

<!--T:36-->
{{TitleProperty|Link}}

<!--T:37-->
The properties in this group are only available for Link arrays. See [[Std_LinkMake#Properties|Std LinkMake]] for more information.

<!--T:38-->
* {{PropertyData|Scale|Float}}
* {{PropertyData|Scale Vector|Vector|Hidden}}
* {{PropertyData|Scale List|VectorList}}
* {{PropertyData|Visibility List|BoolList|Hidden}}
* {{PropertyData|Placement List|PlacementList|Hidden}}
* {{PropertyData|Element List|LinkList|Hidden}}
* {{PropertyData|_ Link Touched|Bool|Hidden}}
* {{PropertyData|_ Child Cache|LinkList|Hidden}}
* {{PropertyData|Colored Elements|LinkSubHidden|Hidden}}
* {{PropertyData|Link Transform|Bool}}

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


<!--T:9-->
<!--T:9-->
* {{PropertyData|Base}}: The shape object
* {{PropertyData|Base|Link}}: specifies the object to duplicate in the array.
* {{PropertyData|Count}}: The number of times to copy the shape (read only)
* {{PropertyData|Count|Integer}}: (read-only) specifies the number of elements in the array. This number is determined by the number of points in the {{PropertyData|Point Object}}.
* {{PropertyData|Expand Array|Bool}}: specifies whether to expand the array in the [[Tree_view|Tree view]] to enable the selection of its individual elements. Only available for Link arrays.
* {{PropertyData|PointList}}: a compound of points
* {{PropertyData|Extra Placement|Placement}}: : specifies an additional [[Placement|placement]], translation and rotation, for each element in the array.
* {{PropertyData|Fuse|Bool}}: specifies if overlapping elements in the array are fused or not. Not used for Link arrays. {{Version|1.0}}
* {{PropertyData|Point Object|Link}}: specifies the object whose points are used to position the elements in the array.


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

<!--T:40-->
{{TitleProperty|Link}}

<!--T:41-->
The properties in this group, with the exception of the inherited property, are only available for Link arrays. See [[Std_LinkMake#Properties|Std LinkMake]] for more information.

<!--T:42-->
* {{PropertyView|Draw Style|Enumeration}}
* {{PropertyView|Line Width|FloatConstraint}}
* {{PropertyView|Override Material|Bool}}
* {{PropertyView|Point Size|FloatConstraint}}
* {{PropertyView|Selectable|Bool}}: this is an inherited property that appears in the Selection group for other arrays
* {{PropertyView|Shape Material|Material}}

<!--T:43-->
{{TitleProperty|Base}}

<!--T:44-->
The properties in this group, with the exception of the inherited property, are only available for Link arrays. See [[Std_LinkMake#Properties|Std LinkMake]] for more information.

<!--T:45-->
* {{PropertyView|Child View Provider|PersistentObject|Hidden}}
* {{PropertyView|Material List|MaterialList|Hidden}}
* {{PropertyView|Override Color List|ColorList|Hidden}}
* {{PropertyView|Override Material List|BoolList|Hidden}}
* {{PropertyView|Proxy|PythonObject|Hidden}}: this is an inherited property.

<!--T:46-->
{{TitleProperty|Display Options}}

<!--T:47-->
The properties in this group are inherited properties. See [[Part_Feature#Properties|Part Feature]] for more information.

<!--T:48-->
* {{PropertyView|Bounding Box|Bool}}: this property is not inherited by Link arrays.
* {{PropertyView|Display Mode|Enumeration}}: for Link arrays it can be {{value|Link}} or {{value|ChildView}}. For other arrays it can be: {{value|Flat Lines}}, {{value|Shaded}}, {{value|Wireframe}} or {{value|Points}}
* {{PropertyView|Show In Tree|Bool}}
* {{PropertyView|Visibility|Bool}}

<!--T:49-->
{{TitleProperty|Draft}}

<!--T:50-->
* {{PropertyView|Pattern|Enumeration}}: not used.
* {{PropertyView|Pattern Size|Float}}: not used.

<!--T:51-->
{{TitleProperty|Object style}}

<!--T:52-->
The properties in this group are not inherited by Link arrays.

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

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


<!--T:11-->
<!--T:11-->
To create a point array use the {{incode|make_point_array}} method ({{Version|0.19}}) of the Draft module. This method replaces the deprecated {{incode|makePointArray}} method.
The PointArray tool can be used in [[macros]] and from the [[Python]] console by using the following function:


</translate>
</translate>
{{Code|code=
{{Code|code=
point_array = make_point_array(base_object, point_object, extra=None, use_link=True)
makePointArray(base, ptlst)
}}
}}
<translate>
<translate>

<!--T:12-->
<!--T:12-->
* {{incode|base}} is the shape to copy, and {{incode|ptlst}} is an object with Geometry, Links, or Components that define the position of the copies.
* {{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|point_object}} is the object containing the points. It can also be the {{incode|Label}} (string) of an object in the current document. It should have a {{incode|Geometry}}, {{incode|Links}}, or {{incode|Components}} property containing points.
* {{incode|extra}} is an {{incode|App.Placement}}, an {{incode|App.Vector}} or an {{incode|App.Rotation}} that displaces each element.
* If {{incode|use_link}} is {{incode|True}} the created elements are [[App_Link|App Links]] instead of regular copies.


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

</translate>
</translate>
{{Code|code=
{{Code|code=
import FreeCAD, Draft
import FreeCAD as App
import Draft


doc = App.newDocument()
poly = 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))


upg = Draft.upgrade([p1, p2, p3], delete=True)
polygon = Draft.make_polygon(3, radius=500.0)
compound = upg[0][0] # Extract the compound from the list


array = Draft.makePointArray(poly, compound)
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()
}}
}}
<translate>
<translate>


==Usage Notes== <!--T:15-->
* {{emphasis|in progress}}


==Limitations== <!--T:14-->
<!--T:20-->
{{Docnav
* This tool is not available before version 0.18
|[[Draft_PathLinkArray|PathLinkArray]]
|[[Draft_PointLinkArray|PointLinkArray]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_PathLinkArray.svg
|IconR=Draft_PointLinkArray.svg
|IconC=Workbench_Draft.svg
}}


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

Latest revision as of 10:14, 21 April 2024

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

Description

The Draft PointArray command creates a regular array from a selected base object by placing copies at the points from a point object. Use the Draft PointLinkArray command to create a more efficient Link array instead. Except for the type of array that is created, Link array or regular array, the Draft PointLinkArray command is identical to this command.

The base object can be a 2D object created with the Draft Workbench or Sketcher Workbench, but also a 3D object such as those created with the Part Workbench, PartDesign Workbench or Arch Workbench.

The point object can be any object with a shape and vertices (including a Std Part containing one or more of such objects), as well as a mesh and a point cloud. Duplicate points in the point object are filtered out. introduced in version 0.21

In version 0.20 and below only three point object types are supported see Point object version 0.20 and below.

Draft PointArray

Usage

  1. Select the object you wish to array.
  2. Add the point object to the selection.
  3. There are several ways to invoke the command:
    • Press the Point array button.
    • Select the Modification → Array tools → Point array option from the menu.
  4. The array is created.
  5. Optionally change the properties of the array in the Property editor.

Point object version 0.20 and below

These are the supported point objects in version 0.20 and below and how they can be created:

Properties

See also: Property editor.

A Draft PointArray object is derived from a Part Feature object and inherits all its properties (with the exception of some View properties that are not inherited by Link arrays). The following properties are additional unless otherwise stated:

Data

Link

The properties in this group are only available for Link arrays. See Std LinkMake for more information.

  • DataScale (Float)
  • Data (Hidden)Scale Vector (Vector)
  • DataScale List (VectorList)
  • Data (Hidden)Visibility List (BoolList)
  • Data (Hidden)Placement List (PlacementList)
  • Data (Hidden)Element List (LinkList)
  • Data (Hidden)_ Link Touched (Bool)
  • Data (Hidden)_ Child Cache (LinkList)
  • Data (Hidden)Colored Elements (LinkSubHidden)
  • DataLink Transform (Bool)

Objects

  • DataBase (Link): specifies the object to duplicate in the array.
  • DataCount (Integer): (read-only) specifies the number of elements in the array. This number is determined by the number of points in the DataPoint Object.
  • DataExpand Array (Bool): specifies whether to expand the array in the Tree view to enable the selection of its individual elements. Only available for Link arrays.
  • DataExtra Placement (Placement): : specifies an additional placement, translation and rotation, for each element in the array.
  • DataFuse (Bool): specifies if overlapping elements in the array are fused or not. Not used for Link arrays. introduced in version 1.0
  • DataPoint Object (Link): specifies the object whose points are used to position the elements in the array.

View

Link

The properties in this group, with the exception of the inherited property, are only available for Link arrays. See Std LinkMake for more information.

  • ViewDraw Style (Enumeration)
  • ViewLine Width (FloatConstraint)
  • ViewOverride Material (Bool)
  • ViewPoint Size (FloatConstraint)
  • ViewSelectable (Bool): this is an inherited property that appears in the Selection group for other arrays
  • ViewShape Material (Material)

Base

The properties in this group, with the exception of the inherited property, are only available for Link arrays. See Std LinkMake for more information.

  • View (Hidden)Child View Provider (PersistentObject)
  • View (Hidden)Material List (MaterialList)
  • View (Hidden)Override Color List (ColorList)
  • View (Hidden)Override Material List (BoolList)
  • View (Hidden)Proxy (PythonObject): this is an inherited property.

Display Options

The properties in this group are inherited properties. See Part Feature for more information.

  • ViewBounding Box (Bool): this property is not inherited by Link arrays.
  • ViewDisplay Mode (Enumeration): for Link arrays it can be Link or ChildView. For other arrays it can be: Flat Lines, Shaded, Wireframe or Points
  • ViewShow In Tree (Bool)
  • ViewVisibility (Bool)

Draft

  • ViewPattern (Enumeration): not used.
  • ViewPattern Size (Float): not used.

Object style

The properties in this group are not inherited by Link arrays.

Scripting

See also: Autogenerated API documentation and FreeCAD Scripting Basics.

To create a point array use the make_point_array method (introduced in version 0.19) of the Draft module. This method replaces the deprecated makePointArray method.

point_array = make_point_array(base_object, point_object, extra=None, 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.
  • point_object is the object containing the points. It can also be the Label (string) of an object in the current document. It should have a Geometry, Links, or Components property containing points.
  • extra is an App.Placement, an App.Vector or an App.Rotation that displaces each element.
  • If use_link is True the created elements are App Links instead of regular copies.

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()