#display the organel, the box, and prepare the hierachy... doc = helper.getCurrentScene() sel = doc.GetSelection() c4dorganlle = sel[0] helper.triangulate(c4dorganlle) faces,vertices,vnormals = helper.DecomposeMesh(c4dorganlle,edit=True,copy=True,tri=True) o1 = Organelle(vertices, faces, vnormals) h1.addOrganelle(o1) o1.setSurfaceRecipe(rSurf1) #o1.setInnerRecipe(rCyto) #define the viewer type dejavu,c4d,blender ViewerType='c4d' afviewer = AFViewer(ViewerType=ViewerType) #make some option here afviewer.doPoints = False afviewer.doSpheres = False afviewer.quality = 1 #lowest quality for sphere and cylinder h1.setMinMaxProteinSize() print 'Cyto', rCyto.getMinMaxProteinSize() print 'Surf', rSurf1.getMinMaxProteinSize() print 'Matrix', rMatrix1.getMinMaxProteinSize() #print 'o1', o1.getMinMaxProteinSize() print 'smallest', h1.smallestProteinSize print 'largest', h1.largestProteinSize pad = 100.
#display the organel, the box, and prepare the hierachy... doc = helper.getCurrentScene() sel = doc.GetSelection() c4dorganlle = sel[0] helper.triangulate(c4dorganlle) faces,vertices,vnormals = helper.DecomposeMesh(c4dorganlle,edit=True,copy=True,tri=True) o1 = Organelle(vertices, faces, vnormals) h1.addOrganelle(o1) o1.setSurfaceRecipe(rSurf1) #o1.setInnerRecipe(rCyto) #define the viewer type dejavu,c4d,blender ViewerType='c4d' afviewer = AFViewer(ViewerType=ViewerType) #make some option here afviewer.doPoints = False afviewer.doSpheres = False afviewer.quality = 1 #lowest quality for sphere and cylinder h1.setMinMaxProteinSize() print('Cyto', rCyto.getMinMaxProteinSize()) print('Surf', rSurf1.getMinMaxProteinSize()) print('Matrix', rMatrix1.getMinMaxProteinSize()) #print 'o1', o1.getMinMaxProteinSize() print('smallest', h1.smallestProteinSize) print('largest', h1.largestProteinSize) pad = 100.
helper =helperClass() else : import upy helperClass = upy.getHelperClass() helper =helperClass(vi="nogui") AutoFill.helper = helper filename = "/Users/ludo/DEV/autofill_svn/trunk/AutoFillClean/autoFillRecipeScripts/2DsphereFill/Test_Spheres2D1.0.xml" fileName, fileExtension = os.path.splitext(filename) n=os.path.basename(fileName) h = Environment(name=n) recipe=n h.load_XML(filename) afviewer=None if not NOGUI : setattr(h,"helper",helper) afviewer = AFViewer(ViewerType=h.helper.host,helper=h.helper) afviewer.SetHistoVol(h,20.0,display=False) h.host=h.helper.host afviewer.displayPreFill() h.saveResult = True ingr=h.exteriorRecipe.ingredients[0] resultfilename = h.resultfile = wrkDir+os.sep+"autoFillRecipeScripts/2DsphereFill/results/Test.afr" h.buildGrid(boundingBox=h.boundingBox,gridFileIn=None,rebuild=True , gridFileOut=None,previousFill=False) pack_multi(h,ncpus=1) if not NOGUI : afviewer.displayFill() #load ? #result,orgaresult,freePoint=h.load(resultfilename=resultfilename,restore_grid=False)#load text ?#this will restore the grid #ingredients = h.restore(result,orgaresult,freePoint)
helper = helperClass() else: import upy helperClass = upy.getHelperClass() helper = helperClass(vi="nogui") AutoFill.helper = helper filename = "/Users/ludo/DEV/autofill_svn/trunk/AutoFillClean/autoFillRecipeScripts/2DsphereFill/Test_Spheres2D1.0.xml" fileName, fileExtension = os.path.splitext(filename) n = os.path.basename(fileName) h = Environment(name=n) recipe = n h.load_XML(filename) afviewer = None if not NOGUI: setattr(h, "helper", helper) afviewer = AFViewer(ViewerType=h.helper.host, helper=h.helper) afviewer.SetHistoVol(h, 20.0, display=False) h.host = h.helper.host afviewer.displayPreFill() h.saveResult = True ingr = h.exteriorRecipe.ingredients[0] resultfilename = h.resultfile = wrkDir + os.sep + "autoFillRecipeScripts/2DsphereFill/results/Test.afr" h.buildGrid(boundingBox=h.boundingBox, gridFileIn=None, rebuild=True, gridFileOut=None, previousFill=False) pack_multi(h, ncpus=1) if not NOGUI: afviewer.displayFill()