Circle (class)

Warning : this file has been generated, you shouldn’t edit it

class Circle(radius=1, center=0, point_ref=0, label='', init_dict=None)[source]

Bases: pyleecan.Classes.Surface.Surface

Circle define by the center of circle(point_ref), the label and the radius

VERSION = 1
check()

assert the Circle is correct (the radius > 0)

Parameters:self (Circle) – A Circle object
Returns:
Return type:None
Raises:RadiusCircleError – The radius of a circle must be >= 0
comp_length()

Compute the length of the circle

Parameters:self (Circle) – A Circle object
Returns:length – the length of the circle [m]
Return type:float
comp_surface()

Compute the circle surface

Parameters:self (Circle) – A Circle object
Returns:surf – The circle surface [m**2]
Return type:float
discretize()

Return the discretize version of the Circle.

Parameters:
  • self (Circle) – A Circle Object
  • nb_point (int) – Number of point on the circle
Returns:

point_list – List of complex coordinate of the points

Return type:

list

get_lines()

Get the lines needed to draw the surface (2 Arc3)

Parameters:self (Circle) – A circle Object
Returns:line_list – Two arcs to draw the circle
Return type:list
get_patch(color='w', edgecolor='K')

Returns the Circle Patch to be display in matplotlib

Parameters:
  • self (Circle) – a Circle object
  • color – the color of the Patch (Default value = PATCH_COLOR)
  • edgecolor – edgecolor of the Patch (Default value = PATCH_EDGE)
Returns:

patch – The patch corresponding to the surface

Return type:

matplotlib.patches.Circle

rotate(angle)

Rotation of the Circle of angle

Parameters:
  • self (Circle) – An Circle Object
  • angle (float) – the angle of rotation [rad]
Returns:

Return type:

None

Raises:

AngleRotationCircleError – The angle must be a float or int

translate(Zt)

Translate the Circle object

Parameters:
  • self (Circle) – An Circle object
  • Zt (complex) – Complex value for translation
Returns:

Return type:

None

Raises:

PointTranslateCircleError – The point must be a complex number or int or float

as_dict()[source]

Convert this objet in a json seriable dict (can be use in __init__)

radius

Radius of the circle

center

center of the Circle