Skip to content

Commit

Permalink
Added repr on primitives and penetrations
Browse files Browse the repository at this point in the history
  • Loading branch information
Krande committed Apr 7, 2021
1 parent b5c8d5d commit c066c49
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/ada/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3742,6 +3742,9 @@ def units(self, value):
self._geom = make_sphere(self.pnt, self.radius)
self._units = value

def __repr__(self):
return f"PrimSphere({self.name})"


class PrimBox(Shape):
def __init__(self, name, p1, p2, colour=None, opacity=1.0, metadata=None, units="m"):
Expand Down Expand Up @@ -3773,6 +3776,9 @@ def units(self, value):
self._geom = make_box_by_points(self.p1, self.p2)
self._units = value

def __repr__(self):
return f"PrimBox({self.name})"


class PrimCyl(Shape):
def __init__(self, name, p1, p2, r, colour=None, opacity=1.0, metadata=None, units="m"):
Expand All @@ -3798,6 +3804,9 @@ def units(self, value):
self.r = self.r * scale_factor
self._geom = make_cylinder_from_points(self.p1, self.p2, self.r)

def __repr__(self):
return f"PrimCyl({self.name})"


class PrimExtrude(Shape):
def __init__(
Expand Down Expand Up @@ -3860,6 +3869,9 @@ def poly(self):
def extrude_depth(self):
return self._extrude_depth

def __repr__(self):
return f"PrimExtrude({self.name})"


class PrimRevolve(Shape):
"""
Expand Down Expand Up @@ -3932,6 +3944,9 @@ def revolve_axis(self):
def revolve_angle(self):
return self._revolve_angle

def __repr__(self):
return f"PrimRevolve({self.name})"


class PrimSweep(Shape):
def __init__(
Expand Down Expand Up @@ -4000,6 +4015,9 @@ def profile_curve_outer(self):
def profile_curve_inner(self):
return self._profile_curve_inner

def __repr__(self):
return f"PrimSweep({self.name})"


class Penetration(BackendGeom):
_name_gen = Counter(1, "Pen")
Expand Down Expand Up @@ -4094,7 +4112,8 @@ def ifc_opening(self):
return self._ifc_opening

def __repr__(self):
return f'Pen(type={type(self.primitive)})'
return f"Pen(type={self.primitive})"


class Section(Backend):
"""
Expand Down Expand Up @@ -4886,8 +4905,10 @@ def __repr__(self):

class Connection(Part):
"""
A basic Connection class
TODO: Build something with this class
A basic Connection class
"""

def __init__(self, name, incoming_beams, wp=None):
Expand Down

0 comments on commit c066c49

Please sign in to comment.