|Drafting → Polygon|
|Introduced in version|
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
- There are several ways to invoke the command:
- Adjust the desired number of Sides in the options dialog.
- Click the first point in the 3D view, or type coordinates and press the button.
- Click another point in the 3D view, or type a Radius value to define the polygon radius.
- To enter coordinates manually, simply enter the numbers, then press between each X, Y and Z component. You can press the button when you have the desired values to insert the point.
- Press 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 DataMake Face
true); if not, the polygon will not make a face (DataMake Face
or click the checkbox to toggle filled mode. If filled mode is on, the polygon will create a filled face (
- Hold snapping your point to the nearest snap location, independently of the distance. while drawing to force
- Hold constrain your second point horizontally or vertically in relation to the first one. while drawing to
- Press or the button to abort the current command.
- A Draft Polygon can be edited with the Draft Edit command.
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:
- DataArea (
Area): (read-only) specifies the area of the face of the polygon. The value will be
0.0if DataMake Face if
- DataChamfer Size (
Length): specifies the length of the chamfers at the corners of the polygon.
- DataDraw Mode (
Enumeration): specifies if the polygon is
inscribedin a circle or
circumscribedaround 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 is
truea 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.
- ViewPattern (
Enumeration): specifies the Draft Pattern with which to fill the face of the polygon. This property only works if DataMake Face is
trueand if ViewDisplay Mode is
- ViewPattern Size (
Float): specifies the size of the Draft Pattern.
To create a Draft Polygon use the
make_polygon method (introduced in version 0.19) of the Draft module. This method replaces the deprecated
polygon = make_polygon(nfaces, radius=1, inscribed=True, placement=None, face=None, support=None)
- Creates a
polygonobject with the given number of faces (
nfaces), and based on a circle of
True, the polygon is inscribed in the circle, otherwise it will be circumscribed.
Nonethe shape is created at the origin and one of its vertices will lie on the X axis.
True, the shape will make a face, that is, it will appear filled.
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()