Exemple #1
0
    def testParse2(self):
        v = STLParser()
        test_filename = os.path.join(file_path, 'data/ship.zip')
        self.assertTrue(v.canParse(test_filename))
        v.parse(test_filename)

        self.assertEqual(828, len(v.getElements()))
Exemple #2
0
    def testParse3(self):
        v = STLParser()
        test_filename = os.path.join(file_path, 'data/pelvis.stl')
        self.assertTrue(v.canParse(test_filename))
        v.parse(test_filename)

        self.assertEqual(52272, len(v.getElements()))
 def _loadMaleMesh(self, resources_path):
     mp = STLParser()
     mp.parse(os.path.join(resources_path, 'data', 'pelvis_male_236mm.stl'))
     nodes_start = mp.getPoints(pared=True)
     elements = mp.getElements(zero_based=False, pared=True)
     mp.parse(os.path.join(resources_path, 'data', 'pelvis_male_324mm.stl'))
     nodes_end = mp.getPoints(pared=True)
     createMeshTime(self._male_coordinate_field, nodes_start, 236, nodes_end, 324, elements)
Exemple #4
0
    def testConvert(self):
        v = STLParser()
        v.parse('data/pelvis_minimal.stl')
        nodes = v.getPoints(pared=True)
        self.assertEqual(13, len(nodes))
        elements = v.getElements(zero_based=False, pared=True)
        self.assertEquals([1, 4, 2], elements[1])
        mesh = {'nodes': nodes, 'elements': elements}

        convert(mesh, define_faces=True)
Exemple #5
0
    def testConvert(self):
        v = STLParser()
        v.parse('data/pelvis_minimal.stl')
        nodes = v.getPoints(pared=True)
        self.assertEqual(13, len(nodes))
        elements = v.getElements(zero_based=False, pared=True)
        self.assertEquals([1, 4, 2], elements[1])
        mesh = {'nodes': nodes, 'elements': elements}

        convert(mesh, define_faces=True)
Exemple #6
0
 def testPared(self):
     v = STLParser()
     v.parse(os.path.join(file_path, 'data/pelvis_minimal.stl'))
     self.assertEqual(13, len(v.getPoints(pared=True)))
     elements = v.getElements(pared=True)
     self.assertEquals([0, 3, 1], elements[1])
Exemple #7
0
    def testParse4(self):
        v = STLParser()
        v.parse(os.path.join(file_path, 'data/pelvis.zip'))

        self.assertEqual(52272, len(v.getElements()))
Exemple #8
0
    def testParse1(self):
        v = STLParser()
        v.parse(os.path.join(file_path, 'data/ship.stl'))

        self.assertEqual(828, len(v.getElements()))
Exemple #9
0
 def testZeroBased(self):
     v = STLParser()
     v.parse('data/pelvis_minimal.stl')
     self.assertEqual(33, len(v.getPoints()))
     elements = v.getElements(zero_based=False)
     self.assertEquals([4, 5, 6], elements[1])
    def testParse4(self):
        v = STLParser()
        v.parse('data/pelvis.zip')        

        self.assertEqual(52272, len(v.getElements())) 
Exemple #11
0
    def testParse2(self):
        v = STLParser()
        v.parse('data/ship.zip')

        self.assertEqual(828, len(v.getElements()))
 def testParedZeroBased(self):
     v = STLParser()
     v.parse('data/pelvis_minimal.stl')
     self.assertEqual(33, len(v.getPoints()))
     elements = v.getElements(zero_based=False, pared=True)
     self.assertEquals([1, 4, 2], elements[1])
 def testPared(self):
     v = STLParser()
     v.parse('data/pelvis_minimal.stl')
     self.assertEqual(13, len(v.getPoints(pared=True)))
     elements = v.getElements(pared=True)
     self.assertEquals([0, 3, 1], elements[1])
Exemple #14
0
 def testParedZeroBased(self):
     v = STLParser()
     v.parse(os.path.join(file_path, 'data/pelvis_minimal.stl'))
     self.assertEqual(33, len(v.getPoints()))
     elements = v.getElements(zero_based=False, pared=True)
     self.assertEquals([1, 4, 2], elements[1])
Exemple #15
0
    def testParse4(self):
        v = STLParser()
        v.parse('data/pelvis.zip')

        self.assertEqual(52272, len(v.getElements()))
Exemple #16
0
 def testFailingModelInVersion000400(self):
     v = STLParser()
     v.parse(os.path.join(file_path, 'data/amazing_alveoli_minimal.stl'))
     self.assertEqual(310188, len(v.getPoints()))
     elements = v.getElements(zero_based=False, pared=True)
     self.assertEquals([4, 1, 3], elements[1])
    def testParse2(self):
        v = STLParser()
        v.parse('data/ship.zip')        

        self.assertEqual(828, len(v.getElements()))