コード例 #1
0
ファイル: common_test.py プロジェクト: mjirik/larVolumeToObj
    def make_all_by_steps_test(self):
        # from larcc import VIEW, EXPLODE, MKPOLS
        from larVolumeToObj.computation.pklzToSmoothObj import convert, \
            makeCleaningAndSmoothing
        from larVolumeToObj.computation.fileio import readFile
        # from visualize import visualize

        from larVolumeToObj.computation.step_triangularmesh \
            import triangulate_quads
        import shutil

        outputdir = 'tests/tmptestmakeall'
        if os.path.exists(outputdir):
            shutil.rmtree(outputdir)

        inputfile = 'tests/nrn4.pklz'
        bordersize = [4, 2, 3]
        outputdir = outputdir
        outputfile = 'test_nrn4'
        borderdir = outputdir + '/border'

        convert(inputfile, bordersize, outputdir, borderdir=borderdir)
        V, F = readFile(os.path.join(outputdir, 'stl/model-2.obj'))
        F3 = triangulate_quads(F)
        # visualize(V, F3)
        # VIEW(EXPLODE(1.2, 1.2, 1.2)(MKPOLS((V, F3))))
        V, F = makeCleaningAndSmoothing(V, F,
                                        os.path.join(outputdir, outputfile))

        F3 = triangulate_quads(F)
        self.assertTrue(check_references(V, F3))
コード例 #2
0
ファイル: common_test.py プロジェクト: mjirik/larVolumeToObj
 def test_real_pklz_data_visual(self):
     import larVolumeToObj.computation.pklzToSmoothObj as startConversion
     import shutil
     from larVolumeToObj.computation.step_triangularmesh \
         import triangulate_quads
     from larVolumeToObj.computation.visualization \
         import visualize, check_references
     # from larcc import VIEW, EXPLODE, MKPOLS
     outputdir = 'tests/tmptestpklz'
     if os.path.exists(outputdir):
         shutil.rmtree(outputdir)
     V, F = startConversion.makeSmooth(
         # inputfile='tests/nrn4.pklz',
         inputfile='biodur_055.pklz',
         # inputfile='/home/mjirik/Stažené/nrn4.pklz',
         bordersize=[4, 2, 3],
         outputdir=outputdir,
         outputfile='test_nrn4',
         visualization=False,
         borderdir=outputdir + '/border'
         # borderdir='tmp/border'
     )
     F3 = triangulate_quads(F)
     visualize(V, F3, explode=True)
     self.assertTrue(check_references(V, F))
コード例 #3
0
ファイル: common_test.py プロジェクト: mjirik/larVolumeToObj
 def test_real_pklz_data(self):
     import larVolumeToObj.computation.pklzToSmoothObj as sc
     import shutil
     from larVolumeToObj.computation.step_triangularmesh \
         import triangulate_quads
     from larVolumeToObj.computation.visualization import check_references
     # from larcc import VIEW, EXPLODE, MKPOLS
     outputdir = 'tests/tmptestpklz'
     if os.path.exists(outputdir):
         shutil.rmtree(outputdir)
     V, F = sc.makeSmooth(inputfile='tests/nrn4.pklz',
                          bordersize=[4, 2, 3],
                          outputdir=outputdir,
                          outputfile='test_nrn4',
                          visualization=False,
                          borderdir=outputdir + '/border',
                          label=2
                          # borderdir='tmp/border'
                          )
     F3 = triangulate_quads(F)
     self.assertTrue(check_references(V, F))
     self.assertTrue(check_references(V, F3))
コード例 #4
0
ファイル: brodo3_test.py プロジェクト: mjirik/larVolumeToObj
    def test_make_oriented_boundary_real_data(self):
        print '1'
        from larVolumeToObj.computation.pklzToSmoothObj import convert
        print '2'
        from larVolumeToObj.computation.fileio import readFile
        print '3'
        from larVolumeToObj.computation.visualization import check_references
        print '4'
        # from larVolumeToObj.computation.step_triangularmesh import \
        # triangulate_quads
        inputfile = 'tests/nrn4.pklz'
        bordersize = [4, 2, 3]
        outputdir = 'tests/tmptestpklz'
        borderdir = 'tests/tmptestpklz/border'

        convert(inputfile, bordersize, outputdir, borderdir=borderdir)
        V, F = readFile(os.path.join(outputdir, 'stl/model-2.obj'))
        self.assertTrue(check_references(V, F))
コード例 #5
0
ファイル: common_test.py プロジェクト: mjirik/larVolumeToObj
 def test_real_data(self):
     V, F = fileio.readFile(os.path.join(path_to_script, "smallbb2.obj"))
     V, F = sc.makeCleaningAndSmoothing(V, F)
     self.assertTrue(check_references(V, F))