Skip to content

Commit

Permalink
added major and minor radius
Browse files Browse the repository at this point in the history
  • Loading branch information
shimwell committed Dec 15, 2024
1 parent 4873af2 commit 4085e54
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/paramak/assemblies/assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,13 @@
class Assembly(cq.Assembly):
"""Nested assembly of Workplane and Shape objects defining their relative positions."""

def __init__(self, elongation=None, triangularity=None, major_radius=None, minor_radius=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.elongation = elongation
self.triangularity = triangularity
self.major_radius = major_radius
self.minor_radius = minor_radius
elongation=None
triangularity=None
major_radius=None
minor_radius=None

def remove(self, name: str):
new_assembly = Assembly(
elongation=self.elongation,
triangularity=self.triangularity,
major_radius=self.major_radius,
minor_radius=self.minor_radius
)
new_assembly = Assembly()
part_found = False
for part in self:
if part[1].endswith(f'/{name}'):
Expand All @@ -32,6 +25,11 @@ def remove(self, name: str):
new_assembly.add(part[0], name=part[1], color=part[3], loc=part[2])
if not part_found:
warnings.warn(f'Part with name {name} not found')
# if hasattr(self, 'elongation'):
new_assembly.elongation = self.elongation
new_assembly.triangularity = self.triangularity
new_assembly.major_radius = self.major_radius
new_assembly.minor_radius = self.minor_radius
return new_assembly

def names(self):
Expand Down

0 comments on commit 4085e54

Please sign in to comment.