예제 #1
0
 def test_IsNew(self):
     myfile_new = MATL.MakeRoot(self.temppath,"new")
     open(myfile_new,'w+').close()
     self.assertFalse(MATL.IsNew(self.myfile_old,myfile_new))
     self.assertTrue(MATL.IsNew(myfile_new,self.myfile_old))
예제 #2
0
    # tiffile_unscaled = os.path.join(BaseFolder,'0kPa.tif')
    # tiffile = os.path.join(BaseFolder,'0kPa_scaled.tif')
    tiffile = os.path.join(BaseFolder, '0kPa.tif')
    plyFile_Orig = os.path.join(BaseFolder, '0kPa_scaled.ply')
    plyFile_Smooth = os.path.join(BaseFolder, '0kPa_scaled_smooth.ply')
    matlabdata = r'C:\Users\Wenbin\Desktop\FIDVC-master\Matlab Code\dm2\resultsFIDVC.mat'
    vtuout = os.path.join(BaseFolder, '0kPa_scaled_smooth.vtu')

    # Scale Tif height map to fix spherical distorsion
    #    if Force or MATL.IsNew(tiffile_unscaled,tiffile):
    #        print("Scaling Tif file...")
    #        scalefactor = 1.335 #(nPBS/nH20)
    #        MAIP.ScaleTif(tiffile_unscaled,tiffile,scalefactor)

    # Make ply from height map if heightmap is newer
    if Force or MATL.IsNew(tiffile, plyFile_Orig):
        print("Making 3D Surface...")
        MA3D.Make3DSurfaceFromHeightMapTiff(tiffile,
                                            OFile=plyFile_Orig,
                                            NoZeros=True)

    # Smooth ply file if input ply is new
    if True or MATL.IsNew(plyFile_Orig, plyFile_Smooth):
        print("Smoothing and reducing Surface...")
        MACA.SmoothPly(plyFile_Orig,
                       plyFile_Smooth,
                       ScriptFileName=None,
                       Verbose=True,
                       MeshLabPath='C:\\Program Files\\VCG\\MeshLab')

    test = AddDeformation(plyFile_Smooth)