diff --git a/city_model_structure/attributes/polyhedron.py b/city_model_structure/attributes/polyhedron.py index b792eee5..9a9a3306 100644 --- a/city_model_structure/attributes/polyhedron.py +++ b/city_model_structure/attributes/polyhedron.py @@ -30,7 +30,8 @@ class Polyhedron: self._min_z = None self._min_y = None self._min_x = None - self._geometry = GeometryHelper(delta=0.5, area_delta=0.001) + self._geometry = GeometryHelper(delta=5.0, area_delta=0.01) + print(f'[{self._geometry._area_delta} {self._geometry._delta}]') def _position_of(self, point, face): vertices = self.vertices @@ -53,7 +54,7 @@ class Polyhedron: found = False for vertex_2 in self._vertices: found = False - if self._geometry.almost_equal(vertex_1, vertex_2, True): + if self._geometry.almost_equal(vertex_1, vertex_2): found = True break if not found: @@ -139,8 +140,6 @@ class Polyhedron: else: point_index = point_index + 3 if point_index >= len(points_list): - # print('wroooong', complementary_surface.type) - # print(complementary_surface.points) return triangles if len(points_list) == 9: # the rest point's are already a triangle diff --git a/tests/test_geometry_factory.py b/tests/test_geometry_factory.py index 4d36871f..80e46ec2 100644 --- a/tests/test_geometry_factory.py +++ b/tests/test_geometry_factory.py @@ -79,11 +79,16 @@ class TestGeometryFactory(TestCase): city = City.load(self._kelowna_pickle_file) helper = GeometryHelper(delta=0.0, area_delta=0.5) errors = 0 + ok = 0 for building in city.buildings: building._polyhedron._geometry = helper if str(building.volume) == 'inf': - building.obj_export(self._output_path) + building.stl_export(self._output_path) errors += 1 + elif ok == 0: + building.stl_export(self._output_path) + print(f'ok {building.name} {building.volume}') + ok = 1 print(f'{errors} buildings aren\'t closed volumes') def test_citygml_buildings(self):