Surface (class)

File generated according to Generator/ClassesRef/Geometry/Surface.csv WARNING! All changes made in this file will be lost!

class Surface(point_ref=0, label='', init_dict=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(nodeprop=None, maxseg=None, propname=None, FEMM_dict=None, hide=False)

draw the Surface in FEMM

Parameters:
  • 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)

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
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='')

Save the object to the save_path

Parameters:
  • self – A pyleecan object
  • save_path (str) – path to the folder to save the object
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 objet in a json seriable dict (can be use in __init__)

point_ref

Center of symmetry

label

Label of the surface