diff --git a/tests/test_geometry_factory.py b/tests/test_geometry_factory.py index 58d15ee5..081aa3d4 100644 --- a/tests/test_geometry_factory.py +++ b/tests/test_geometry_factory.py @@ -10,6 +10,8 @@ from unittest import TestCase from city_model_structure.city import City from factories.geometry_factory import GeometryFactory from helpers.geometry_helper import GeometryHelper +import math +import numpy as np class TestGeometryFactory(TestCase): @@ -86,6 +88,19 @@ class TestGeometryFactory(TestCase): errors += 1 print(f'{errors} buildings aren\'t closed volumes') + def test_volume(self): + """ + + :return: + """ + building = 'bld100087.gml' + file_path = (self._example_path / building).resolve() + city = GeometryFactory('citygml', file_path).city + for building in city.buildings: + print('volume', building.volume) + #print('volume om', building.volume_om) + building.stl_export(self._output_path) + def test_citygml_buildings(self): """ Test city objects in the city @@ -222,3 +237,13 @@ class TestGeometryFactory(TestCase): 'thermal_opening front_side_solar_transmittance_at_normal_incidence was initialized') self.assertIsNone(thermal_opening.thickness, 'thermal_opening thickness_m was initialized') self.assertRaises(Exception, lambda: thermal_opening.u_value, 'thermal_opening u_value was initialized') + + def test_is_planar(self): + building = 'bld100087.gml' + file_path = (self._example_path / building).resolve() + city = GeometryFactory('citygml', file_path).city + for building in city.buildings: + for surface in building.surfaces: + print(surface.type, surface.area) + print('volume', building.volume) +