```# -*- coding: utf-8 -*-
from numpy import pi, exp

from ....Classes.Arc1 import Arc1
from ....Classes.Arc3 import Arc3

[docs]def build_radius_lines(self, is_bore, sym=1, is_reversed=False, prop_dict=None):
"""Create the lines need to draw the selected radius of the Lamination

Parameters
----------
self : Lamination
a Lamination object
is_bore : bool
True generate lines of bore, else yoke
is_reversed : bool
True to return the lines in clockwise oder (reverse begin and end), False trigo
sym : int
Symmetry factor (1= full machine, 2= half of the machine...)
prop_dict : dict
Property dictionary to apply on the radius lines (not on slot/notch)

Returns
-------
list of bore/yoke lines
"""
is_notch = self.has_notch(is_bore=is_bore)
is_slot = self.has_slot(is_bore=is_bore)
if is_bore:
R = self.get_Rbo()
is_shape = self.bore is not None
shape_obj = self.bore
else:
R = self.get_Ryoke()
is_shape = self.yoke is not None
shape_obj = self.yoke

if not is_shape:  # Arc or Slot/Notch only
# Cut lines for sym
if sym != 1:
# Cut first desc (if needed)
lines = list()
top_split_list, _ = line.split_line(0, 1)
lines.extend(top_split_list)
# Cut last desc (if needed)
if radius_desc_list[-1]["end_angle"] > 2 * pi / sym:
lines = list()
_, bot_split_list = line.split_line(0, exp(1j * 2 * pi / sym))
lines.extend(bot_split_list)
radius_desc_list[-1]["end_angle"] = 2 * pi / sym
# Extract the line list
# Apply prop_dict on Radius only
if prop_dict is not None and desc_dict["label"] == "Radius":
for line in desc_dict["lines"]:
if line.prop_dict is None:
line.prop_dict = dict()
line.prop_dict.update(prop_dict)

elif is_shape and not is_notch and not is_slot:
# Bore/Yoke shape only
if sym > 1:  # Ox cut
lines = list()
top_split_list, _ = line.split_line(0, 1)
lines.extend(top_split_list)
if sym > 2:
lines = list()
_, bot_split_list = line.split_line(0, exp(1j * 2 * pi / sym))
lines.extend(bot_split_list)
# Only radius lines => prop_dict on all lines
if prop_dict is not None:
if line.prop_dict is None:
line.prop_dict = dict()
line.prop_dict.update(prop_dict)
else:  # Bore/Yoke shape to merge with slot/notch