class TestMeshFromText(unittest.TestCase): def setUp(self): self.tags = ClassifiedTags.from_text(MESH) self.mesh = Mesh(self.tags, DWG) def test_mesh_properties(self): mesh = self.mesh self.assertEqual('MESH', mesh.dxftype()) self.assertEqual(256, mesh.dxf.color) self.assertEqual('0', mesh.dxf.layer) self.assertEqual('BYLAYER', mesh.dxf.linetype) self.assertFalse(mesh.dxf.paperspace) def test_mesh_dxf_attribs(self): self.assertEqual(2, self.mesh.dxf.version) self.assertEqual(0, self.mesh.dxf.blend_crease) self.assertEqual(3, self.mesh.dxf.subdivision_levels) def test_mesh_geometric_data(self): with self.mesh.edit_data() as mesh_data: self.assertEqual(56, len(mesh_data.vertices)) self.assertEqual(54, len(mesh_data.faces)) self.assertEqual(108, len(mesh_data.edges)) self.assertEqual(108, len(mesh_data.edge_crease_values))
def mesh(dwg): tags = ExtendedTags.from_text(MESH) return Mesh(tags, dwg)
def setUp(self): self.tags = ClassifiedTags.from_text(MESH) self.mesh = Mesh(self.tags, DWG)
def mesh(dwg): tags = tag_processor(ExtendedTags.from_text(MESH)) return Mesh(tags, dwg)