Draft Polygon/ru: Difference between revisions

From FreeCAD Documentation
(Updating to match new version of source page)
(Updating to match new version of source page)
 
(20 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<languages/>

{{Docnav
|[[Draft_Rectangle|Rectangle]]
|[[Draft_BSpline|BSpline]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Rectangle.svg
|IconR=Draft_BSpline.svg
|IconC=Workbench_Draft.svg
}}

<div class="mw-translate-fuzzy">
<div class="mw-translate-fuzzy">
{{GuiCommand/ru
{{GuiCommand/ru
|Name=Draft Polygon
|Name=Draft Polygon
|Name/ru=Draft Polygon
|Name/ru=Draft Polygon
|Workbenches=[[Draft Module/ru|Draft]], [[Arch Module/ru|Arch]]
|MenuLocation=Черчение -> Многоугольник
|MenuLocation=Черчение -> Многоугольник
|Workbenches=[[Draft_Workbench/ru|Draft]], [[Arch_Workbench/ru|Arch]]
|Shortcut=P G
|Shortcut={{KEY|P}} {{KEY|G}}
}}
}}
</div>
</div>


==Description==
==Description==

The polygon tool creates a regular polygon by picking two points, the center and a second point defining a radius. It takes the [[Draft Linestyle|linewidth and color]] previously set on the Tasks tab.
The [[Image:Draft_Polygon.svg|24px]] '''Draft Polygon''' command creates a regular polygon on the current [[Draft_SelectPlane|working plane]] from a center and a radius. The radius can be defined by picking a point.

A Draft Polygon can be switched from inscribed to circumscribed by changing its {{PropertyData|Draw Mode}} property. The corners of a Draft Polygon can be filleted (rounded) or chamfered by changing its {{PropertyData|Fillet Radius}} or {{PropertyData|Chamfer Size}} respectively.


[[Image:Draft_polygon_example.jpg|400px]]
[[Image:Draft_polygon_example.jpg|400px]]
{{Caption|Regular polygon defined by two points, center and radius}}


==How to use==
==Usage==

# Press the {{KEY|[[Image:Draft Polygon.png|16px]] [[Draft Polygon]]}} button, or press {{KEY|P}} then {{KEY|G}} keys
See also: [[Draft_Tray|Draft Tray]], [[Draft_Snap|Draft Snap]] and [[Draft_Constrain|Draft Constrain]].
# Click a first point on the 3D view, or type a [[Draft_Coordinates|coordinate]] to indicate the center

# Adjust the desired number of sides in the options dialog,
# There are several ways to invoke the command:
# Click another point on the 3D view, or type a radius value to define the polygon radius. The polygon will also be a face, even if it appears as wireframe.
#* Press the {{Button|[[Image:Draft_Polygon.svg|16px]] [[Draft_Polygon|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 {{MenuCommand|Polygon}} task panel opens. See [[#Options|Options]] for more information.
# Adjust the desired number of {{MenuCommand|Sides}}.
# Pick the first point, the center of the polygon, in the [[3D_view|3D view]], or type coordinates and press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button.
# Pick the second point in the [[3D_view|3D view]], or enter a {{MenuCommand|Radius}}.


==Options==
==Options==

* To enter coordinates manually, simply enter the numbers, then press {{KEY|ENTER}} between each X, Y and Z component.
The single character keyboard shortcuts available in the task panel can be changed. See [[Draft_Preferences|Draft Preferences]]. The shortcuts mentioned here are the default shortcuts (for version 0.22).
* Press {{KEY|T}} or click the checkbox to check/uncheck the {{KEY|'''Continue'''}} button. If continue mode is on, the Polygon tool will restart after you finish or close it, allowing you to draw another one without pressing the Polygon button again.

* Press {{KEY|CTRL}} while drawing to force [[Draft_Snap|snapping]] your point to the nearest snap location, independently of the distance.
* To manually enter the coordinates for the center enter the X, Y and Z component, and press {{KEY|Enter}} after each. Or you can press the {{Button|[[Image:Draft_AddPoint.svg|16px]] Enter point}} button when you have the desired values. It is advisable to move the pointer out of the [[3D_view|3D view]] before entering coordinates.
* Press {{KEY|SHIFT}} while drawing to [[Draft_Constrain|constrain]] your next point horizontally or vertically in relation to the last one.
* Press {{KEY|G}} or click the {{MenuCommand|Global}} checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the [[Draft_SelectPlane|working plane]] coordinate system. {{Version|0.20}}
* Press {{KEY|I}} or the {{KEY|'''Filled'''}} button to have the polygon filled with a face after it has been closed
* Press {{KEY|F}} or click the {{MenuCommand|Filled}} checkbox to toggle filled mode. If filled mode is on, the created polygon will have {{PropertyData|Make Face}} set to {{TRUE}} and will have a filled face.
* Press {{KEY|ESC}} or the {{KEY|'''Cancel'''}} button to abort the current command.
* Press {{KEY|N}} or click the {{MenuCommand|Continue}} checkbox to toggle continue mode. If continue mode is on, the command will restart after finishing, allowing you to continue creating polygons.
* Polygons, when in "Flat Lines" display mode, can display a hatch pattern, by setting their "Pattern" property below.
* Press {{KEY|S}} to switch [[Draft_Snap|Draft snapping]] on or off.
* Press {{KEY|Esc}} or the {{Button|Close}} button to abort the command.

==Notes==

* A Draft Polygon can be edited with the [[Draft_Edit|Draft Edit]] command.

==Preferences==

See also: [[Preferences_Editor|Preferences Editor]] and [[Draft_Preferences|Draft Preferences]].

* If the {{MenuCommand|Edit → Preferences... → Draft → General → Create Part primitives if possible}} option is checked, the command will create a [[Part_RegularPolygon|Part RegularPolygon]] instead of a Draft Polygon.


==Properties==
==Properties==
* {{PropertyData|Radius}}: The radius of the defining circle
* {{PropertyData|Draw Mode}}: Specifies if the polygon is inscribed or circumscribed around the defining circle
* {{PropertyData|Faces Number}}: The number of sides of the polygon
* {{PropertyData|Chamfer Size}}: Specifies the size of chamfered corners
* {{PropertyData|Fillet Radius}}: Specifies a curvature radius to give to the corners of the rectangle
* {{PropertyData|Make Face}}: Fills the polygon with a face
* {{PropertyView|Pattern}}: Specifies a hatch pattern to fill the wire with
* {{PropertyView|Pattern Size}}: Specifies the size of the hatch pattern


See also [[Draft Pattern|Draft Pattern]] page.
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===

{{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}}.
* {{PropertyData|Chamfer Size|Length}}: specifies the length of the chamfers at the corners of the polygon.
* {{PropertyData|Draw Mode|Enumeration}}: specifies if the polygon is {{value|inscribed}} in a circle or {{value|circumscribed}} around a circle.
* {{PropertyData|Faces Number|Integer}}: specifies the number of sides of the polygon.
* {{PropertyData|Fillet Radius|Length}}: specifies the radius of the fillets at the corners of the polygon.
* {{PropertyData|Make Face|Bool}}: specifies if the polygon makes a face or not. If it is {{TRUE}} a face is created, otherwise only the perimeter is considered part of the object.
* {{PropertyData|Radius|Length}}: specifies the radius of the circle that defines the polygon.

===View===

{{TitleProperty|Draft}}

* {{PropertyView|Pattern|Enumeration}}: specifies the [[Draft_Pattern|Draft Pattern]] with which to fill the face of the polygon. This property only works if {{PropertyData|Make Face}} is {{TRUE}} and if {{PropertyView|Display Mode}} is {{value|Flat Lines}}.
* {{PropertyView|Pattern Size|Float}}: specifies the size of the [[Draft_Pattern|Draft Pattern]].


==Scripting==
==Scripting==

The Polygon tool can by used in [[macros]] and from the python console by using the following function:
See also: [https://freecad.github.io/SourceDoc/ Autogenerated API documentation] and [[FreeCAD Scripting Basics|FreeCAD Scripting Basics]].

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.


{{Code|code=
{{Code|code=
makePolygon(nfaces,[radius],[inscribed],[placement],[face])
polygon = make_polygon(nfaces, radius=1, inscribed=True, placement=None, face=None, support=None)
}}
}}
* Creates a polygon object with the given number of faces and the radius.
* Creates a {{incode|polygon}} object with the given number of faces ({{incode|nfaces}}), and based on a circle of {{incode|radius}} in millimeters.
* If inscribed is False, the polygon is circumscribed around a circle with the given radius, otherwise it is inscribed.
* 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 polygon is created at the origin and one of its vertices will lie on the X axis.
* If face is True, the resulting shape is displayed as a face, otherwise as a wireframe.
* If {{incode|face}} is {{incode|True}}, the polygon will make a face, that is, it will appear filled.
* Returns the newly created object.


Example:
Example:
{{Code|code=
{{Code|code=
import FreeCAD as App
import Draft
import Draft

Draft.makePolygon(5,radius=3)
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()
}}
}}

{{clear}}

<languages/>
{{Docnav
|[[Draft_Rectangle|Rectangle]]
|[[Draft_BSpline|BSpline]]
|[[Draft_Workbench|Draft]]
|IconL=Draft_Rectangle.svg
|IconR=Draft_BSpline.svg
|IconC=Workbench_Draft.svg
}}

{{Draft Tools navi{{#translation:}}}}
{{Userdocnavi{{#translation:}}}}

Latest revision as of 10:07, 30 January 2024

Draft Polygon

Системное название
Draft Polygon
Расположение в меню
Черчение -> Многоугольник
Верстаки
Draft, Arch
Быстрые клавиши
P G
Представлено в версии
-
См. также
Нет

Description

The Draft Polygon command creates a regular polygon on the current working plane from a center and a radius. The radius can be defined by picking a point.

A Draft Polygon can be switched from inscribed to circumscribed by changing its ДанныеDraw Mode property. The corners of a Draft Polygon can be filleted (rounded) or chamfered by changing its ДанныеFillet Radius or ДанныеChamfer Size respectively.

Regular polygon defined by two points, center and radius

Usage

See also: Draft Tray, Draft Snap and Draft Constrain.

  1. There are several ways to invoke the command:
    • Press the Polygon button.
    • Select the Drafting → Polygon option from the menu.
    • Use the keyboard shortcut: P then G.
  2. The Polygon task panel opens. See Options for more information.
  3. Adjust the desired number of Sides.
  4. Pick the first point, the center of the polygon, in the 3D view, or type coordinates and press the Enter point button.
  5. Pick the second point in the 3D view, or enter a Radius.

Options

The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts (for version 0.22).

  • To manually enter the coordinates for the center enter the X, Y and Z component, and press Enter after each. Or you can press the Enter point button when you have the desired values. It is advisable to move the pointer out of the 3D view before entering coordinates.
  • Press G or click the Global checkbox to toggle global mode. If global mode is on, coordinates are relative to the global coordinate system, else they are relative to the working plane coordinate system. introduced in version 0.20
  • Press F or click the Filled checkbox to toggle filled mode. If filled mode is on, the created polygon will have ДанныеMake Face set to true and will have a filled face.
  • Press N or click the Continue checkbox to toggle continue mode. If continue mode is on, the command will restart after finishing, allowing you to continue creating polygons.
  • Press S to switch Draft snapping on or off.
  • Press Esc or the Close button to abort the command.

Notes

  • A Draft Polygon can be edited with the Draft Edit command.

Preferences

See also: Preferences Editor and Draft Preferences.

  • If the Edit → Preferences... → Draft → General → Create Part primitives if possible option is checked, the command will create a Part RegularPolygon instead of a Draft Polygon.

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

  • ДанныеArea (Area): (read-only) specifies the area of the face of the polygon. The value will be 0.0 if ДанныеMake Face if false.
  • ДанныеChamfer Size (Length): specifies the length of the chamfers at the corners of the polygon.
  • ДанныеDraw Mode (Enumeration): specifies if the polygon is inscribed in a circle or circumscribed around a circle.
  • ДанныеFaces Number (Integer): specifies the number of sides of the polygon.
  • ДанныеFillet Radius (Length): specifies the radius of the fillets at the corners of the polygon.
  • ДанныеMake Face (Bool): specifies if the polygon makes a face or not. If it is true a face is created, otherwise only the perimeter is considered part of the object.
  • ДанныеRadius (Length): specifies the radius of the circle that defines the polygon.

View

Draft

  • ВидPattern (Enumeration): specifies the Draft Pattern with which to fill the face of the polygon. This property only works if ДанныеMake Face is true and if ВидDisplay Mode is Flat Lines.
  • ВидPattern 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 of radius in millimeters.
  • If inscribed is True, the polygon is inscribed in the circle, otherwise it will be circumscribed.
  • If placement is None the polygon is created at the origin and one of its vertices will lie on the X axis.
  • If face is True, the polygon 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()