Skip to content

Commit

Permalink
Started looking into the use of IfcFastener for welds and bolts.
Browse files Browse the repository at this point in the history
Will try to implement this on the SimpleStru Example and add a fasteners list on Part
  • Loading branch information
Krande committed Jun 14, 2021
1 parent f4a710c commit d2aa241
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions src/ada/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5164,6 +5164,64 @@ def __repr__(self):
return 'Joint Name: "{}", center: "{}"'.format(self._name, self._center)


class Bolts(Backend):
"""
TODO: Create a bolt class based on the IfcMechanicalFastener concept.
https://standards.buildingsmart.org/IFC/RELEASE/IFC4_1/FINAL/HTML/schema/ifcsharedcomponentelements/lexical/ifcmechanicalfastener.htm
Which in turn should likely be inside another element components class
https://standards.buildingsmart.org/IFC/RELEASE/IFC4_1/FINAL/HTML/schema/ifcsharedcomponentelements/lexical/ifcelementcomponent.htm
"""

def __init__(self, name, p1, p2, normal, members, parent=None):
super(Bolts, self).__init__(name, parent=parent)


class Weld(Backend):
"""
TODO: Create a weld class based on the IfcFastener concept.
https://standards.buildingsmart.org/IFC/RELEASE/IFC4_1/FINAL/HTML/schema/ifcsharedcomponentelements/lexical/ifcfastener.htm
"""

def __init__(self, name, p1, p2, normal, members, parent=None):
super(Weld, self).__init__(name, parent=parent)
self._p1 = p1
self._p2 = p2
self._normal = normal
self._members = members
self._ifc_elem = None

def _generate_ifc_elem(self):
"""
:return:
"""
if self.parent is None:
raise ValueError("Parent cannot be None for IFC export")

# a = self.parent.get_assembly()
# f = a.ifc_file

# context = f.by_type("IfcGeometricRepresentationContext")[0]
# owner_history = f.by_type("IfcOwnerHistory")[0]
# parent = self.parent.ifc_elem

# ifc_fastener = f.createIfcFastener()

def ifc_elem(self):
if self._ifc_elem is None:
self._ifc_elem = self._generate_ifc_elem()

return self._ifc_elem


class CurveRevolve:
def __init__(
self,
Expand Down

0 comments on commit d2aa241

Please sign in to comment.