Surface (class)

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

class Surface(point_ref=0, label='', init_dict=None, init_str=None)[source]

Bases: pyleecan.Classes._frozen.FrozenClass

SurfLine define by list of lines that delimit it, label and point reference.

VERSION = 1
comp_mesh_dict(element_size, label='surface')

Returns the number of mesh elements on each line of the surface to match the element_size.

Parameters
  • self (Surface) – a Surface object

  • element_size (float) – The size of each element on the mesh [m]

  • label (str) – Label prefix for line without label

Returns

mesh_dict – Dictionary containing the number of element of each line of the surface

Return type

dict

draw_FEMM(femm, nodeprop=None, maxseg=None, propname=None, FEMM_dict=None, hide=False)

draw the Surface in FEMM

Parameters
  • femm (FEMMHandler) – client to send command to a FEMM instance

  • nodeprop

    Nodal property

    (Default value = None)

  • maxseg

    Meshed with elements that span at most maxsegdeg degrees per element

    (Default value = None)

  • propname

    Boundary property ’propname’

    (Default value = None)

  • FEMM_dict (dict) – Dictionnary containing the main parameters of FEMM

  • hide – 0 = not hidden in post-processor, 1 == hidden in post processor (Default value = False)

Returns

Return type

None

plot(fig=None, color='w', edgecolor='k', is_edge_only=False, linestyle=None, is_disp_point_ref=False, is_show_fig=True)

Plot the Surface patch in a matplotlib fig

Parameters
  • self (Surface) – A Surface object

  • fig – if None, open a new fig and plot, else add to the current one (Default value = None)

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

  • edgecolor – the edge color of the patch (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), …}

  • is_disp_point_ref (bool) – True to add the point_ref

  • is_show_fig (bool) – To call show at the end of the methods

Returns

Return type

None

split_line(Z1, Z2, is_top=True, is_join=False, label_join='')

Cut the Surface according to a line defined by two complex

Parameters
  • self (Surface) – An Surface object

  • Z1 (complex) – First point of the cutting Line

  • Z2 (complex) – Second point of the cutting Line

  • is_top (bool) – True to keep the part above the cutting line. “Above” is in the coordinate system with Z1 in 0 and Z2 on the X>0 axis

  • is_join (bool) – True to join the split_list with Segment on the cutting line

  • label_join (str) – Label of the join line

Returns

split_surf – The selected part of the Surface

Return type

SurfLine

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 point_ref

Center of symmetry

Type

complex

property label

Label of the surface

Type

str