MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / parse_representation

Method parse_representation

src/ifc2ca/ifc2ca.py:271–287  ·  view source on GitHub ↗
(self, representation: ios.entity_instance)

Source from the content-addressed store, hash-verified

269 return origin, orientation
270
271 def parse_representation(self, representation: ios.entity_instance):
272 repr_item = representation.Items[0]
273 if representation.RepresentationType == "Vertex":
274 geometry = repr_item.VertexGeometry.Coordinates
275
276 elif representation.RepresentationType == "Edge":
277 geometry = [
278 repr_item.EdgeStart.VertexGeometry.Coordinates,
279 repr_item.EdgeEnd.VertexGeometry.Coordinates,
280 ]
281
282 elif representation.RepresentationType == "Face":
283 geometry = [x.EdgeStart.VertexGeometry.Coordinates for x in repr_item.Bounds[0].Bound.EdgeList]
284
285 else:
286 print(representation)
287 return geometry
288
289 def parse_material(self, material: ios.entity_instance):
290 data = {k: v for k, v in material.get_info().items() if k in self.material_keys}

Callers 2

parse_elementMethod · 0.95
parse_connectionMethod · 0.95

Calls 1

printFunction · 0.85

Tested by

no test coverage detected