Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added start position args #200

11 changes: 10 additions & 1 deletion paramak/parametric_components/toroidal_field_coil_coat_hanger.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def __init__(
number_of_coils: int,
with_inner_leg: bool = True,
color: Tuple[float, float, float, Optional[float]] = (0.0, 0.0, 1.0),
azimuth_start_angle: float = 0,
**kwargs
) -> None:

Expand All @@ -54,6 +55,7 @@ def __init__(
self.distance = distance
self.number_of_coils = number_of_coils
self.with_inner_leg = with_inner_leg
self.azimuth_start_angle = azimuth_start_angle

@property
def azimuth_placement_angle(self):
Expand Down Expand Up @@ -205,7 +207,14 @@ def find_azimuth_placement_angle(self):
"""Calculates the azimuth placement angles based on the number of
toroidal field coils"""

angles = list(np.linspace(0, 360, self.number_of_coils, endpoint=False))
angles = list(
np.linspace(
self.azimuth_start_angle,
360 + self.azimuth_start_angle,
self.number_of_coils,
endpoint=False
)
)

self.azimuth_placement_angle = angles

Expand Down
11 changes: 10 additions & 1 deletion paramak/parametric_components/toroidal_field_coil_princeton_d.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(
vertical_displacement: float = 0.0,
with_inner_leg: bool = True,
color: Tuple[float, float, float, Optional[float]] = (0.0, 0.0, 1.0),
azimuth_start_angle: float = 0,
**kwargs
) -> None:

Expand All @@ -45,6 +46,7 @@ def __init__(
self.number_of_coils = number_of_coils
self.vertical_displacement = vertical_displacement
self.with_inner_leg = with_inner_leg
self.azimuth_start_angle = azimuth_start_angle

@property
def inner_points(self):
Expand Down Expand Up @@ -180,6 +182,13 @@ def find_azimuth_placement_angle(self):
"""Calculates the azimuth placement angles based on the number of tf
coils"""

angles = list(np.linspace(0, 360, self.number_of_coils, endpoint=False))
angles = list(
np.linspace(
self.azimuth_start_angle,
360 + self.azimuth_start_angle,
self.number_of_coils,
endpoint=False
)
)

self.azimuth_placement_angle = angles
11 changes: 10 additions & 1 deletion paramak/parametric_components/toroidal_field_coil_rectangle.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def __init__(
number_of_coils: int,
with_inner_leg: bool = True,
color: Tuple[float, float, float, Optional[float]] = (0.0, 0.0, 1.0),
azimuth_start_angle: float = 0,
**kwargs
) -> None:

Expand All @@ -45,6 +46,7 @@ def __init__(
self.distance = distance
self.number_of_coils = number_of_coils
self.with_inner_leg = with_inner_leg
self.azimuth_start_angle = azimuth_start_angle

@property
def azimuth_placement_angle(self):
Expand Down Expand Up @@ -112,7 +114,14 @@ def find_azimuth_placement_angle(self):
"""Calculates the azimuth placement angles based on the number of tf
coils"""

angles = list(np.linspace(0, 360, self.number_of_coils, endpoint=False))
angles = list(
np.linspace(
self.azimuth_start_angle,
360 + self.azimuth_start_angle,
self.number_of_coils,
endpoint=False
)
)

self.azimuth_placement_angle = angles

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __init__(
distance: float,
number_of_coils: int = 1,
with_inner_leg: Optional[bool] = False,
azimuth_start_angle: float = 0,
**kwargs
) -> None:

Expand All @@ -56,6 +57,7 @@ def __init__(
self._height = 0
self._inner_curve_radius = 0
self._outter_curve_radius = 0
self.azimuth_start_angle = azimuth_start_angle

if len(lower_inner_coordinates) != 2 or len(mid_point_coordinates) != 2:
msg = (
Expand Down Expand Up @@ -329,7 +331,15 @@ def find_azimuth_placement_angle(self):
"""Finds the placement angles from the number of coils
given in a 360 degree"""

angles = list(np.linspace(0, 360, self._number_of_coils, endpoint=False))
angles = list(
np.linspace(
self.azimuth_start_angle,
360 + self.azimuth_start_angle,
self.number_of_coils,
endpoint=False
)
)

shimwell marked this conversation as resolved.
Show resolved Hide resolved
self.azimuth_placement_angle = angles

def create_solid(self):
Expand Down
11 changes: 10 additions & 1 deletion paramak/parametric_components/toroidal_field_coil_triple_arc.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def __init__(
vertical_displacement: float = 0.0,
with_inner_leg: bool = True,
color: Tuple[float, float, float, Optional[float]] = (0.0, 0.0, 1.0),
azimuth_start_angle: float = 0,
**kwargs
) -> None:

Expand All @@ -48,6 +49,7 @@ def __init__(
self.number_of_coils = number_of_coils
self.vertical_displacement = vertical_displacement
self.with_inner_leg = with_inner_leg
self.azimuth_start_angle = azimuth_start_angle

@property
def azimuth_placement_angle(self):
Expand Down Expand Up @@ -164,6 +166,13 @@ def find_azimuth_placement_angle(self):
"""Calculates the azimuth placement angles based on the number of tf
coils"""

angles = list(np.linspace(0, 360, self.number_of_coils, endpoint=False))
angles = list(
np.linspace(
self.azimuth_start_angle,
360 + self.azimuth_start_angle,
self.number_of_coils,
endpoint=False
)
)

self.azimuth_placement_angle = angles