Draft Polygon: Difference between revisions
No edit summary |
(→Data) |
||
(15 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Page_in_progress}} |
|||
<languages/> |
<languages/> |
||
<translate> |
<translate> |
||
<!--T:18--> |
<!--T:18--> |
||
{{Docnav |
{{Docnav |
||
|[[Draft_Ellipse|Ellipse]] |
|||
|[[Draft_Rectangle|Rectangle]] |
|[[Draft_Rectangle|Rectangle]] |
||
|[[Draft_BSpline|BSpline]] |
|||
|[[Draft_Module|Draft]] |
|[[Draft_Module|Draft]] |
||
|IconL= |
|IconL=Draft_Rectangle.svg |
||
|IconR= |
|IconR=Draft_BSpline.svg |
||
|IconC=Workbench_Draft.svg |
|IconC=Workbench_Draft.svg |
||
}} |
}} |
||
Line 14: | Line 16: | ||
{{GuiCommand |
{{GuiCommand |
||
|Name=Draft Polygon |
|Name=Draft Polygon |
||
|MenuLocation= |
|MenuLocation=Drafting → Polygon |
||
|Workbenches=[[Draft_Module|Draft]], [[Arch_Module|Arch]] |
|Workbenches=[[Draft_Module|Draft]], [[Arch_Module|Arch]] |
||
|Shortcut={{KEY|P}} {{KEY|G}} |
|Shortcut={{KEY|P}} {{KEY|G}} |
||
|Version=0.7 |
|Version=0.7 |
||
|SeeAlso=[[Draft_Circle|Draft Circle]], [[Draft_Pattern|Draft Pattern]] |
|||
}} |
}} |
||
Line 24: | Line 25: | ||
<!--T:2--> |
<!--T:2--> |
||
The Polygon |
The [[Image:Draft_Polygon.svg|24px]] [[Draft_Polygon|Draft Polygon]] command creates a regular polygon inscribed in a circle. It uses the [[Draft_Linestyle|Draft Linestyle]] set on the [[Draft_Tray|Draft Tray]]. |
||
⚫ | |||
A Draft Polygon can be switched from inscribed to circumscribed by changing its {{PropertyData|Draw Mode}} property. |
|||
</translate> |
</translate> |
||
Line 35: | Line 39: | ||
<!--T:4--> |
<!--T:4--> |
||
# There are several ways to invoke the command: |
|||
# Press the {{Button|[[Image:Draft_Polygon.svg|16px]] [[Draft Polygon]]}} button |
#* Press the {{Button|[[Image:Draft_Polygon.svg|16px]] [[Draft_Polygon|Draft Polygon]]}} button. |
||
⚫ | |||
#* Select the {{MenuCommand|Drafting → [[Image:Draft_Polygon.svg|16px]] Polygon}} option from the menu. |
|||
⚫ | |||
#* Use the keyboard shortcut: {{KEY|P}} then {{KEY|G}}. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
The polygon can be edited by double clicking on the element in the tree view, or by pressing the {{Button|[[Image:Draft Edit.svg|16px]] [[Draft Edit]]}} button. Then you can move the center and radius points to a new position. |
|||
<!--T: |
<!--T:5--> |
||
⚫ | |||
The polygon is created inscribed in a circle of the specified radius; it can be switched to circumscribed after creation by changing its draw mode property. |
|||
⚫ | |||
⚫ | |||
The number of sides of the polygon can also be changed after creation by changing its faces number property. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
* Press {{KEY|L}} or click the checkbox to toggle ''filled'' mode. If filled mode is on, the polygon will create a filled face ({{PropertyData|Make Face}} {{TRUE}}); if not, the polygon will not make a face ({{PropertyData|Make Face}} {{FALSE}}). |
* Press {{KEY|L}} or click the checkbox to toggle ''filled'' mode. If filled mode is on, the polygon will create a filled face ({{PropertyData|Make Face}} {{TRUE}}); if not, the polygon will not make a face ({{PropertyData|Make Face}} {{FALSE}}). |
||
* Hold {{KEY|Ctrl}} while drawing to force [[Draft_Snap|snapping]] your point to the nearest snap location, independently of the distance. |
* Hold {{KEY|Ctrl}} while drawing to force [[Draft_Snap|snapping]] your point to the nearest snap location, independently of the distance. |
||
* Hold {{KEY|Shift}} while drawing to [[Draft_Constrain|constrain]] your second point horizontally or vertically in relation to the first one. |
* Hold {{KEY|Shift}} while drawing to [[Draft_Constrain|constrain]] your second point horizontally or vertically in relation to the first one. |
||
* Press {{KEY|Esc}} or the {{Button|Close}} button to abort the current command. |
* Press {{KEY|Esc}} or the {{Button|Close}} button to abort the current command. |
||
==Notes== |
|||
⚫ | |||
* A Draft Polygon can be edited with the [[Draft_Edit|Draft Edit]] command. |
|||
==Properties== <!--T:6--> |
==Properties== <!--T:6--> |
||
See also: [[property_editor|Property editor]]. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
A Draft Polygon object is derived from a [[Part_Part2DObject|Part Part2DObject]] and inherits all its properties. It also has the following additional properties: |
|||
⚫ | |||
⚫ | |||
⚫ | |||
===Data=== |
|||
⚫ | |||
{{Emphasis|See also:}} [[Draft API]] and [[FreeCAD Scripting Basics]]. |
|||
{{TitleProperty|Draft}} |
|||
⚫ | |||
* {{PropertyData|Area|Area}}: (read-only) specifies the area of the face of the polygon. The value will be {{value|0.0}} if {{PropertyData|Make Face}} if {{FALSE}}. |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
===View=== |
|||
{{TitleProperty|Draft}} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
<!--T:7--> |
|||
See also: [https://www.freecadweb.org/api Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]]. |
|||
<!--T:16--> |
<!--T:16--> |
||
To create a Draft Polygon use the {{incode|make_polygon}} method ({{Version|0.19}}) of the Draft module. This method replaces the deprecated {{incode|makePolygon}} method. |
|||
The Polygon tool can be used in [[macros]] and from the [[Python]] console by using the following function: |
|||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
polygon = make_polygon(nfaces, radius=1, inscribed=True, placement=None, face=None, support=None) |
|||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T:8--> |
<!--T:8--> |
||
* Creates a {{incode| |
* Creates a {{incode|polygon}} object with the given number of faces ({{incode|nfaces}}), and based on a circle of {{incode|radius}} in millimeters. |
||
* If {{incode|inscribed}} is {{incode|True}}, the polygon is inscribed in the circle, otherwise it will be circumscribed. |
* If {{incode|inscribed}} is {{incode|True}}, the polygon is inscribed in the circle, otherwise it will be circumscribed. |
||
* If {{incode|placement}} is {{incode|None}} the shape is created at the origin and one of its vertices will lie on the X axis. |
|||
* If a {{incode|placement}} is given, it is used; otherwise the shape is created at the origin. |
|||
* If {{incode|face}} is {{incode|True}}, the shape will make a face, that is, it will appear filled. |
* If {{incode|face}} is {{incode|True}}, the shape will make a face, that is, it will appear filled. |
||
Line 93: | Line 112: | ||
</translate> |
</translate> |
||
{{Code|code= |
{{Code|code= |
||
import FreeCAD |
import FreeCAD as App |
||
import Draft |
|||
doc = App.newDocument() |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
doc.recompute() |
|||
}} |
}} |
||
<translate> |
<translate> |
||
<!--T:17--> |
<!--T:17--> |
||
{{Docnav |
{{Docnav |
||
|[[Draft_Ellipse|Ellipse]] |
|||
|[[Draft_Rectangle|Rectangle]] |
|[[Draft_Rectangle|Rectangle]] |
||
|[[Draft_BSpline|BSpline]] |
|||
|[[Draft_Module|Draft]] |
|[[Draft_Module|Draft]] |
||
|IconL= |
|IconL=Draft_Rectangle.svg |
||
|IconR= |
|IconR=Draft_BSpline.svg |
||
|IconC=Workbench_Draft.svg |
|IconC=Workbench_Draft.svg |
||
}} |
}} |
||
Line 119: | Line 144: | ||
{{Draft Tools navi{{#translation:}}}} |
{{Draft Tools navi{{#translation:}}}} |
||
{{Userdocnavi{{#translation:}}}} |
{{Userdocnavi{{#translation:}}}} |
||
{{clear}} |
Revision as of 09:21, 30 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 Polygon |
Menu location |
---|
Drafting → Polygon |
Workbenches |
Draft, Arch |
Default shortcut |
P G |
Introduced in version |
0.7 |
See also |
None |
Description
The Draft Polygon command creates a regular polygon inscribed in a circle. It uses the Draft Linestyle set on the Draft Tray.
A Draft Polygon can be switched from inscribed to circumscribed by changing its DataDraw Mode property.
Regular polygon defined by the center point and the radius
Usage
- There are several ways to invoke the command:
- Press the Draft Polygon button.
- Select the Drafting → Polygon option from the menu.
- Use the keyboard shortcut: P then G.
- Adjust the desired number of Sides in the options dialog.
- Click the first point in the 3D view, or type coordinates and press the Enter point button.
- Click another point in the 3D view, or type a Radius value to define the polygon radius.
Options
- To enter coordinates manually, simply enter the numbers, then press Enter between each X, Y and Z component. You can press the Enter point button when you have the desired values to insert the point.
- Press T or click the checkbox to toggle continue mode. If continue mode is on, the Polygon command will restart after you finish it, allowing you to draw another one without pressing the command button again.
- Press L or click the checkbox to toggle filled mode. If filled mode is on, the polygon will create a filled face (DataMake Face
true
); if not, the polygon will not make a face (DataMake Facefalse
). - Hold Ctrl while drawing to force snapping your point to the nearest snap location, independently of the distance.
- Hold Shift while drawing to constrain your second point horizontally or vertically in relation to the first one.
- Press Esc or the Close button to abort the current command.
Notes
- A Draft Polygon can be edited with the Draft Edit command.
Properties
See also: Property editor.
A Draft Polygon object is derived from a Part Part2DObject and inherits all its properties. It also has the following additional properties:
Data
Draft
- DataArea (
Area
): (read-only) specifies the area of the face of the polygon. The value will be0.0
if DataMake Face iffalse
. - DataChamfer Size (
Length
): specifies the length of the chamfers at the corners of the polygon. - DataDraw Mode (
Enumeration
): specifies if the polygon isinscribed
in a circle orcircumscribed
around a circle. - DataFaces Number (
Integer
): specifies the number of sides of the polygon. - DataFillet Radius (
Length
): specifies the radius of the fillets at the corners of the polygon. - DataMake Face (
Bool
): specifies if the polygon makes a face or not. If it istrue
a face is created, otherwise only the perimeter is considered part of the object. - DataRadius (
Length
): specifies the radius of the circle that defines the polygon.
View
Draft
- ViewPattern (
Enumeration
): specifies the Draft Pattern with which to fill the face of the polygon. This property only works if DataMake Face istrue
and if ViewDisplay Mode isFlat Lines
. - ViewPattern Size (
Float
): specifies the size of the Draft Pattern.
Scripting
See also: Autogenerated API documentation and FreeCAD Scripting Basics.
To create a Draft Polygon use the make_polygon
method (introduced in version 0.19) of the Draft module. This method replaces the deprecated makePolygon
method.
polygon = make_polygon(nfaces, radius=1, inscribed=True, placement=None, face=None, support=None)
- Creates a
polygon
object with the given number of faces (nfaces
), and based on a circle ofradius
in millimeters. - If
inscribed
isTrue
, the polygon is inscribed in the circle, otherwise it will be circumscribed. - If
placement
isNone
the shape is created at the origin and one of its vertices will lie on the X axis. - If
face
isTrue
, the shape will make a face, that is, it will appear filled.
Example:
import FreeCAD as App
import Draft
doc = App.newDocument()
polygon1 = Draft.make_polygon(4, radius=500)
polygon2 = Draft.make_polygon(5, radius=750)
zaxis = App.Vector(0, 0, 1)
p3 = App.Vector(1000, 1000, 0)
place3 = App.Placement(p3, App.Rotation(zaxis, 90))
Polygon3 = Draft.make_polygon(6, radius=1450, placement=place3)
doc.recompute()
Draft
- 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
User documentation
- 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