pyleecan.Classes.PolarArc module

Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Geometry/PolarArc

class PolarArc(angle=1, height=1, point_ref=0, label='', init_dict=None, init_str=None)[source]

Bases: Surface

PolarArc defined by the center of object(point_ref), the label, the angle and the height

VERSION = 1
get_lines()

return the list of lines that delimits the PolarArc

Parameters:

self (PolarArc) – a PolarArc object

Returns:

line_list – List of line need to draw the slot (2 Segment + 2 Arc1)

Return type:

list

rotate(angle)

Do the rotation of the PolarArc

Parameters:
  • self (PolarArc) – a PolarArc

  • angle (float) – the angle for rotation [rad]

Return type:

None

translate(Zt)

Do the translation of the PolarArc

Parameters:
  • self (PolarArc) – a PolarArc object

  • Zt (complex) – Complex value for translation

Return type:

None

check()

check if the PolarArc object is correct

Parameters:

self (PolarArc) – a PolarArc Object

Return type:

None

Raises:

AnglePolarArcError – The angle of a polar arc must be different to 0

comp_length()

Returns the length of the PolarArc

Parameters:

self (PolarArc) – a PolarArc object

Returns:

length – length of the PolarArc [m]

Return type:

float

discretize(nb_point)

Returns the discretize version of the PolarArc

Parameters:

nb_point (int) – number of points wanted per line

Returns:

point_list – List of complex coordinate of the points

Return type:

list

get_patches(color='w', edgecolor='k', is_edge_only=False, linestyle=None)

Returns the PolarArc Patch to be display in matplotlib :param self: a PolarArc object :type self: PolarArc :param color: The color of the patch (Default value = PATCH_COLOR) :param edgecolor: The color of the edgecolor (Default value = PATCH_EDGE) :param is_edge_only: To set the transparancy of the face color to 0 and 1 for the edge color :type is_edge_only: bool :param linestyle: Line style of the edge {‘-’, ‘–’, ‘-.’, ‘:’, ‘’, (offset, on-off-seq), …} :type linestyle: str

Returns:

patch_list – List of patches corresponding to the surface

Return type:

list of matplotlib.patches.Polygon

comp_surface()

Compute the PolarArc surface

Parameters:

self (PolarArc) – A PolarArc object

Returns:

surf – The PolarArc surface [m**2]

Return type:

float

comp_point_ref(is_set=False)

Compute the point ref of the Surface

Parameters:
  • self (PolarArc) – A PolarArc object

  • is_set (bool) – True to update the point_ref property

Returns:

point_ref – the reference point of the surface

Return type:

complex

save(save_path='', is_folder=False, type_handle_old=2, type_compression=0)

Save the object to the save_path

Parameters:
  • self – A pyleecan object

  • save_path (str) – path to the folder to save the object

  • is_folder (bool) – to split the object in different files: separate simulation machine and materials (json only)

  • type_handle_old (int) – How to handle old file in folder mode (0:Nothing, 1:Delete, 2:Move to “Backup” folder)

  • type_compression (int) – Available only for json, 0: no compression, 1: gzip

get_logger()

Get the object logger or its parent’s one

Parameters:

obj – A pyleecan object

Returns:

logger – Pyleecan object dedicated logger

Return type:

logging.Logger

compare(other, name='self', ignore_list=None, is_add_value=False)[source]

Compare two objects and return list of differences

as_dict(type_handle_ndarray=0, keep_function=False, **kwargs)[source]

Convert this object in a json serializable dict (can be use in __init__). type_handle_ndarray: int

How to handle ndarray (0: tolist, 1: copy, 2: nothing)

keep_functionbool

True to keep the function object, else return str

Optional keyword input parameter is for internal use only and may prevent json serializability.

copy()[source]

Creates a deepcopy of the object

property angle

Polar angle

Type:

float

Min:

0

property height

The Heigth of the PolarAngle

Type:

float

Min:

0