Part Circle: Difference between revisions

From FreeCAD Documentation
No edit summary
No edit summary
Line 81: Line 81:




Creating an arc of circle, defined by the circle myCircle, a startAngle and an endAngle.
The angles are defined in radiant. The direction of the arc of circle is counterclockwise:


</translate>
{{Code|code=
import Part, math
...
startAngle = 0
endAngle = math.pi/2
myArcOfCircle = Part.ArcOfCircle(myCircle,startAngle,endAngle)
}}

<translate>

Attributes and functions of a Part.ArcOfCircle object:

* myArcOfCircle.Center ... Center as App.Vector
* myArcOfCircle.Axis ... Axis vector as App.Vector
* myArcOfCircle.Radius ... Radius as Float
* myArcOfCircle.Circle ... The circle defining the arc of circle as 'Part::GeomCircle'
* myArcOfCircle.TypeID ... 'Part::GeomArcOfCircle'
* myArcOfCircle.StartPoint ... Startpoint as App.Vector
* myArcOfCircle.EndPoint ... Endpoint as App.Vector
* myArcOfCircle.FirstParameter ... Startangle in radiant as Float
* myArcOfCircle.LastParameter ... Endangle in radiant as Float
* myArcOfCircle.discretize(n) ... List of the vertexes as App.Vector of a polygon inscribed in the arc of circle having n vertexes
* myArcOfCircle.tangent(i) ... Tangent as App.Vector at startpoint if i==1 or endpoint if i==2
* myArcOfCircle.normal(i) ... Normal as App.Vector at startpoint if i==1 or endpoint if i==2


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

Revision as of 15:15, 19 September 2021

Part Circle

Menu location
Part → Create primitives → Circle
Workbenches
Part
Default shortcut
None
Introduced in version
-
See also
None

Description

This command will create a circular curved edge. With the default values, the circular curved edge will be closed and therefore will be a circle. If the properties Angle 0 or Angle 1 are changed from their default values (0 and 360) the edge will be an open curve, an arc.

Alternatively a Part Circle can be initially defined from three points. Once created the circle will only contain the standard Part Circle properties and will no longer contain a reference to the creation points.

Usage

A Circle geometric primitive is available from the Create Primitives dialogue in the Part workbench.

  1. Switch to the Part
  2. There are several ways to access the Create Primitives dialogue:

Properties

  • Radius: the radius of the curved edge (arc or circle)
  • Angle 0: start of the curved edge, (degrees anti-clockwise), the default value is 0
  • Angle 1: end of the curved edge, (degrees anti-clockwise), the default value is 360

Scripting

Creating a circle, defined by center point, axis vector and radius.

import Part 
center = App.Vector(1,2,3)
axis = App.Vector(1,1,1)
radius = 10
myCircle = Part.Circle(center,axis,radius)


Creating a circle, defined by three points.

import Part 
p1 = App.Vector(10,0,0)
p2 = App.Vector(0,10,0)
p3 = App.Vector(0,0,10)
myCircle = Part.Circle(p1,p2,p3)


Attributes and functions of a Part.Circle object:

  • myCircle.Center ... Center as App.Vector
  • myCircle.Axis ... Axis vector as App.Vector
  • myCircle.Radius ... Radius as Float
  • myCircle.TypeID ... 'Part::GeomCircle'
  • myCircle.discretize(n) ... List of the vertexes as App.Vector of a polygon inscribed in the circle having n vertexes


Creating an arc of circle, defined by the circle myCircle, a startAngle and an endAngle. The angles are defined in radiant. The direction of the arc of circle is counterclockwise:

import Part, math
...
startAngle = 0
endAngle = math.pi/2
myArcOfCircle = Part.ArcOfCircle(myCircle,startAngle,endAngle)


Attributes and functions of a Part.ArcOfCircle object:

  • myArcOfCircle.Center ... Center as App.Vector
  • myArcOfCircle.Axis ... Axis vector as App.Vector
  • myArcOfCircle.Radius ... Radius as Float
  • myArcOfCircle.Circle ... The circle defining the arc of circle as 'Part::GeomCircle'
  • myArcOfCircle.TypeID ... 'Part::GeomArcOfCircle'
  • myArcOfCircle.StartPoint ... Startpoint as App.Vector
  • myArcOfCircle.EndPoint ... Endpoint as App.Vector
  • myArcOfCircle.FirstParameter ... Startangle in radiant as Float
  • myArcOfCircle.LastParameter ... Endangle in radiant as Float
  • myArcOfCircle.discretize(n) ... List of the vertexes as App.Vector of a polygon inscribed in the arc of circle having n vertexes
  • myArcOfCircle.tangent(i) ... Tangent as App.Vector at startpoint if i==1 or endpoint if i==2
  • myArcOfCircle.normal(i) ... Normal as App.Vector at startpoint if i==1 or endpoint if i==2