Arc1 (class)¶
Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Geometry/Arc1
-
class
Arc1
(begin=0, end=0, radius=0, is_trigo_direction=True, label='', init_dict=None, init_str=None)[source]¶ Bases:
pyleecan.Classes.Arc.Arc
An arc between two points (defined by a radius)
-
VERSION
= 1¶
-
check
()¶ assert that the arc is correct (begin != end; radius !=0)
- Parameters
self (Arc1) – An Arc1 object
- Returns
- Return type
None
- Raises
PointArc1Error – The beginning point and the ending point of an Arc1 can’t be the same
RadiusArc1Error – An Arc1 can’t have a null radius
-
comp_length
()¶ Compute the length of the arc
- Parameters
self (Arc1) – An Arc1 object
- Returns
length – length of the arc
- Return type
float
-
comp_radius
()¶ Compute the Radius of the Arc1 (for unification with other arc objects)
- Parameters
self (Arc1) – An Arc1 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 (Arc1) – The Arc1 object to discretize
nb_point – 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
NbPointArc1DError – nb_point must be an integer >=0
-
get_angle
(is_deg=False)¶ Return the angle of the arc
- Parameters
self (Arc1) – An Arc1 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 (Arc1) – An Arc1 object
- Returns
begin – Complex coordinates of the begin point of the Arc1
- Return type
complex
-
get_center
()¶ Return the center of the arc
- Parameters
self (Arc1) – An Arc1 object
- Returns
Zc – Complex coordinates of the center of the Arc1
- Return type
complex
-
get_end
()¶ Return the end point of the arc
- Parameters
self (Arc1) – An Arc1 object
- Returns
end – Complex coordinates of the end point of the Arc1
- Return type
complex
-
get_middle
()¶ Return the point at the middle of the arc
- Parameters
self (Arc1) – An Arc1 object
- Returns
Zmid – Complex coordinates of the middle of the Arc1
- Return type
complex
-
rotate
(angle)¶ Rotation of the Arc1 of <angle> rad with 0 as the center
- Parameters
self (Arc1) – An Arc1 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 (Arc1) – An Arc1 object
is_begin (bool) – True to keep the part begin=>middle, False for the part middle=>end
-
translate
(Zt)¶ Translate the Arc1 object
- Parameters
self (Arc1) – An Arc1 object
Zt (complex) – Complex value for translation
- Returns
- Return type
None
-
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
-
property
begin
¶ begin point of the arc
- Type
complex
-
property
end
¶ end point of the arc
- Type
complex
-
property
radius
¶ Radius of the arc (can be + or -)
- Type
float
-
property
is_trigo_direction
¶ Rotation direction of the arc
- Type
bool
-