Trapeze (class)

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

class Trapeze(height=1, W2=1, W1=1, point_ref=0, label='', init_dict=None, init_str=None)[source]

Bases: pyleecan.Classes.Surface.Surface

Trapeze defined by the center of symmetry(point_ref), the label, the polar angle, the height and the big and small weight

VERSION = 1
check()

Check if the Trapeze object is correct

Parameters

self (Trapeze) – a Trapeze Object

Returns

Return type

None

Raises
  • TrapezeError – the W1 base of Trapeze must be greater than 0

  • TrapezeError – the W2 base of Trapeze must be greater than 0

comp_length()

Returns the length of the Trapeze

Parameters

self (Trapeze) – a Trapeze object

Returns

length – Length of the surface [m]

Return type

float

comp_surface()

Compute the Trapeze surface

Parameters

self (Trapeze) – A Trapeze object

Returns

surf – The Trapeze surface [m**2]

Return type

float

discretize()

It returns the discretize version of the Trapeze

Parameters

self (Trapeze) – a Trapeze object

Returns

point_list – list of complex coordinate of the points

Return type

list

get_lines()

Returns the Lines that delimit the Trapeze

Parameters

self (Trapeze) – a Trapeze object

Returns

line_list – list of 4 segments

Return type

list

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

Returns the Trapeze Patch to be display in matplotlib

Parameters
  • self (Trapeze) – a Trapeze object

  • color – the color of the patch (Default value = PATCH_COLOR)

  • edgecolor – the color of the patch’s edges (Default value = PATCH_EDGE)

  • is_edge_only (bool) – To set the transparancy of the face color to 0 and 1 for the edge color

  • linestyle (str) – Line style of the edge {‘-‘, ‘–’, ‘-.’, ‘:’, ‘’, (offset, on-off-seq), …}

Returns

patch_list – List of patches corresponding to the surface

Return type

list of matplotlib.patches.Polygon

rotate(angle)

Rotate the surface

Parameters
  • self (Trapeze) – a Trapeze Object

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

Returns

Return type

None

translate(Zt)

Translate the Trapeze

Parameters
  • self (Trapeze) – a Trapeze object

  • Zt (complex) – Complex value for translation

Returns

Return type

None

comp_point_ref(is_set=False)

Compute the point ref of the Surface

Parameters
  • self (Trapeze) – A Trapeze 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)

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

copy()

Return a copy of the class

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

as_dict()[source]

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

property height

the height of the Trapeze

Type

float

Min

0

property W2

the big base of Trapeze

Type

float

Min

0

property W1

the small base of the Trapeze

Type

float

Min

0