Beispiel #1
0
 def test_material_by_face(self):
     """Test _material_by_face test method"""
     material_by_face = self._material_by_face()
     for point, mat in zip([(1.2, 1.2), (1.7, 1.7), (2.2, 2.2)],
                           self.materials):
         fh, _ = self.mesh.locate_point(mesh.to_cgal_point(point))
         self.assertEqual(material_by_face[fh].id, mat)
Beispiel #2
0
 def _find_vertex_at(self, p):
     # Point comparison is NOT ROBUST : do no use in production
     p = mesh.to_cgal_point(p)
     for v in self.mesher.cdt.finite_vertices():
         if v.point() == p: # Not robust in real cases
             return v
     else:
         return None
Beispiel #3
0
    def test_vertices_by_feature(self):
        coords = rect(9, 9, 10, 10)
        self.building = InfrastructureLandtake(coords,
                                               parent_site=self.mainsite,
                                               id="{some building}")
        cleaner = builder.recursively_merge_all_subsites(self.mainsite)
        msite = cleaner.merged_site()
        mbuilder = builder.MeshBuilder(msite)
        alti = mbuilder._build_altimetric_base()
        bmesh = mbuilder._build_triangulation(alti)
        mbuilder._compute_informations(bmesh)

        vertices = mbuilder.vertices_for_feature[self.building.id]

        for i, v in enumerate(vertices):
            self.assertEquals(v.point(),
                              mesh.to_cgal_point(coords[i % len(coords)]))
Beispiel #4
0
 def test_insert_point(self):
     points = [mesh.to_cgal_point((1, 1))]
     self.mesher.insert_polyline(points)
     self.assert_basic_counts(vertices=1, faces=0)