Arc2 (class)

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

class Arc2(begin=0, center=0, angle=1.57079633, label='', init_dict=None)[source]

Bases: pyleecan.Classes.Arc.Arc

An arc between two points (defined by the begin point and a center and angle)

VERSION = 1
check()

assert that the arc is correct (begin != center)

Parameters:

self (Arc2) – An Arc2 object

Returns:

Return type:

None

Raises:
  • PointArc2Error – The beginning point and the ending point of an Arc2 can’t be the same
  • AngleArc2Error – An Arc2 can’t have a null opening angle
comp_length()

Compute the length of the arc

Parameters:self (Arc2) – An Arc2 object
Returns:length – length of the arc
Return type:float
comp_radius()

Compute the radius of the arc

Parameters:self (Arc2) – An Arc2 object
Returns:radius – radius of the arc
Return type:float
discretize(nb_point=99)

Return the discretize version of the Arc. Begin and end are always returned

Parameters:
  • self (Arc2) – An Arc2 object
  • nb_point (int) – Number of points to add to discretize the arc (Default value = ARC_NPOINT_D)
Returns:

list_point – list of complex coordinate of the points

Return type:

list

Raises:

NbPointArc2DError – nb_point must be an integer >=0

get_angle(is_deg=False)

Return the angle of the arc

Parameters:
  • self (Arc2) – An Arc2 object
  • is_deg (bool) – True to convert to degree
Returns:

angle – Angle of the arc

Return type:

float

get_begin()

Return the begin point of the arc

Parameters:self (Arc2) – An Arc2 object
Returns:begin – begin point of the Arc2
Return type:complex
get_center()

Return the center point of the arc

Parameters:self (Arc2) – An Arc2 object
Returns:center – center point of the Arc2
Return type:complex
get_end()

Return the end of the arc

Parameters:self (Arc2) – An Arc2 object
Returns:end – Complex coordinates of the end of the Arc2
Return type:complex
get_middle()

Return the point at the middle of the arc

Parameters:self (Arc2) – An Arc2 object
Returns:Zmid – Complex coordinates of the middle of the Arc2
Return type:complex
reverse()

Reverse the begin and end point of the Line

Parameters:self (Arc2) – An Arc2 object
rotate(angle)

Rotation of the Arc2 of angle

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

Return type:

None

split_half(is_begin=True)

Cut the line in half (modify the object)

Parameters:
  • self (Arc2) – An Arc2 object
  • is_begin (bool) – True to keep the part begin=>middle, False for the part middle=>end
translate(Zt)

Translate the Arc2 object with

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

Return type:

None

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__)

begin

begin point of the arc

center

center of the arc

angle

opening angle of the arc