Skip to content

Commit

Permalink
update demos
Browse files Browse the repository at this point in the history
  • Loading branch information
harrymatthews50 committed Dec 22, 2022
1 parent 80d2503 commit 1630f84
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 26 deletions.
17 changes: 8 additions & 9 deletions demos/demo_BatchMeshEditor.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,34 @@
##
import pyvista as pv
import sys
# add path to MeshEditor.py
sys.path.append('/usr/local/micapollo01/MIC/DATA/STAFF/hmatth5/tmp/MeshEditor/MeshEditor')
from MeshEditor import BatchMeshEditor
from MeshEditor.MeshEditor import BatchMeshEditor
import os
# get path to the current file
WD,_ = os.path.split(__file__)
print(WD)
##
# where are the meshes you want to proces
srcPath = '/usr/local/micapollo01/MIC/DATA/STAFF/hmatth5/tmp/MeshEditor/MeshEditor/demos/DemoData/DemoMeshSource'
srcPath = os.path.join(WD,'DemoData','DemoMeshSource')
# landmarking demo
dstPath = '/usr/local/micapollo01/MIC/DATA/STAFF/hmatth5/tmp/MeshEditor/MeshEditor/demos/DemoData/DemoLandmarkDestination'
dstPath = os.path.join(WD,'DemoData','DemoLandmarkDestination')
BME = BatchMeshEditor()
BME.SourcePath = srcPath
BME.DestinationPath = dstPath
BME.InputFileTypes = '.obj'
BME.Mode = 'landmark'
BME.Overwrite = True # if false will only process meshes without an output already in the destination
BME.PreLoadObjs = False # optionally all files will be loaded prior to landmarking or cleaning during the call to prepare files
BME.ShowSelectionPreview = True; # controls the showSelectionPreview argument that will be passed to the MeshEditor constructor
BME.PreserveSubFolders = False
BME.prepareFiles() # find files to process
BME.processFiles()

# batch clean files
dstPath = '/usr/local/micapollo01/MIC/DATA/STAFF/hmatth5/tmp/MeshEditor/MeshEditor/demos/DemoData/DemoMeshDestination'
dstPath = dstPath = os.path.join(WD,'DemoData','DemoMeshDestination')
BME = BatchMeshEditor()
BME.SourcePath = srcPath
BME.DestinationPath = dstPath
BME.InputFileTypes = '.obj'
BME.Mode = 'edit'
BME.Overwrite = True # if false will only process meshes without an output already in the destination
BME.PreLoadObjs = False # optionally all files will be loaded prior to landmarking or cleaning during the call to prepare files
BME.ShowSelectionPreview = True; # controls the showSelectionPreview argument that will be passed to the MeshEditor constructor
BME.prepareFiles() # find files to process
BME.processFiles()
17 changes: 8 additions & 9 deletions demos/demo_MeshEditorEditMode.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
##

import pyvista as pv
import sys

# add path to MeshEditor.py
sys.path.append('/usr/local/micapollo01/MIC/DATA/STAFF/hmatth5/tmp/MeshEditor/MeshEditor')
from MeshEditor import MeshEditor

from MeshEditor.MeshEditor import MeshEditor
import os
# get path to the current file
WD,_ = os.path.split(__file__)
print(WD)

# load a mesh
obj = pv.read('/usr/local/micapollo01/MIC/DATA/STAFF/hmatth5/tmp/MeshEditor/MeshEditor/demos/DemoData/DemoMeshSource/demoFace1.obj')
obj = pv.read(os.path.join(WD,'DemoData','DemoMeshSource','demoFace1.obj'))
obj.clean(inplace=True)
# create and set up Mesh Editor object
saveFileName ='/usr/local/micapollo01/MIC/DATA/STAFF/hmatth5/tmp/MeshEditor/MeshEditor/demos/DemoData/DemoMeshDestination/demoFace1.obj' # what and where to save the output file
ME = MeshEditor(obj,'edit',showSelectionPreview=True,saveFileName=saveFileName)
saveFileName =os.path.join(WD,'DemoData','DemoMeshDestination','demoFace1.obj') # what and where to save the output file
ME = MeshEditor(obj,'edit',saveFileName=saveFileName)


15 changes: 7 additions & 8 deletions demos/demo_MeshEditorLandmarkMode.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
##
# Mesh Editor Demo, designed to be used using 'cell mode' plug in in PyCharm'
import pyvista as pv
import sys

# add path to MeshEditor.py
sys.path.append('/usr/local/micapollo01/MIC/DATA/STAFF/hmatth5/tmp/MeshEditor/MeshEditor')
from MeshEditor import MeshEditor
from MeshEditor.MeshEditor import MeshEditor
import os
# get path to the current file
WD,_ = os.path.split(__file__)
print(WD)

# load a mesh
obj = pv.read('/usr/local/micapollo01/MIC/DATA/STAFF/hmatth5/tmp/MeshEditor/MeshEditor/demos/DemoData/DemoMeshSource/demoFace1.obj')
obj = pv.read(os.path.join(WD,'DemoData','DemoMeshSource','demoFace1.obj'))
obj.clean(inplace=True)
# create and set up Mesh Editor object
saveFileName ='/usr/local/micapollo01/MIC/DATA/STAFF/hmatth5/tmp/MeshEditor/demos/DemoData/DemoLandmarkDestination/demoFace1.txt' # what and where to save the output file
saveFileName =os.path.join(WD,'DemoData','DemoMeshDestination','demoFace1.obj') # what and where to save the output file
ME = MeshEditor(obj,'landmark',saveFileName=saveFileName)


0 comments on commit 1630f84

Please sign in to comment.