# create and add oganelles from DejaVu.IndexedPolygons import IndexedPolygonsFromFile geomS = IndexedPolygonsFromFile(wrkDir+'/organelles/vesicle_r20nm', 'vesicle') faces = geomS.getFaces() vertices = geomS.getVertices() vnormals = geomS.getVNormals() o1 = Organelle(vertices, faces, vnormals) h1.addOrganelle(o1) # set recipe o1.setSurfaceRecipe(rSurf1) o1.setInnerRecipe(rCyto1) h1.setMinMaxProteinSize() print('Surf', rSurf1.getMinMaxProteinSize()) print('Cyto', rCyto1.getMinMaxProteinSize()) print('o1', o1.getMinMaxProteinSize()) print('smallest', h1.smallestProteinSize) print('largest', h1.largestProteinSize) print('Bounding box', h1.boundingBox) pad = 100. afviewer.SetHistoVol(h1,pad,display=False) afviewer.displayPreFill() (x,y,z), maxi = h1.boundingBox bb = [[0, y, z], maxi] h1.buildGrid(boundingBox=bb)#, gridFileOut='1vesicle_new.grid' ) afviewer.displayFillBox(bb)
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. afviewer.SetHistoVol(h1,pad,display=False) afviewer.displayPreFill() def FILL(h): doc =helper.getCurrentScene() box = doc.GetSelection()[0] bb=helper.getCornerPointCube(box)
# create and add oganelles geomS = IndexedPolygonsFromFile(wrkDir+'/organelles/vesicle_r20nm', 'vesicle') faces = geomS.getFaces() vertices = geomS.getVertices() vnormals = geomS.getVNormals() o1 = Organelle(vertices, faces, vnormals) h1.addOrganelle(o1) # set recipes h1.setExteriorRecipe(rCyto) o1.setSurfaceRecipe(rSurf1) #o1.setInnerRecipe(rMatrix1) 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 print 'Bounding box', h1.boundingBox # add padding bb = h1.boundingBox pad = 200. x,y,z = bb[0] bb[0] = [x-pad, y-pad, z-pad] x,y,z = bb[1] bb[1] = [x+pad, y+pad, z+pad] print 'Bounding box with padding', h1.boundingBox
# create and add oganelles from DejaVu.IndexedPolygons import IndexedPolygonsFromFile geomS = IndexedPolygonsFromFile(wrkDir+'/organelles/vesicle_r20nm', 'vesicle') faces = geomS.getFaces() vertices = geomS.getVertices() vnormals = geomS.getVNormals() o1 = Organelle(vertices, faces, vnormals) h1.addOrganelle(o1) # set recipe o1.setSurfaceRecipe(rSurf1) o1.setInnerRecipe(rCyto1) h1.setMinMaxProteinSize() print('Surf', rSurf1.getMinMaxProteinSize()) print('Cyto', rCyto1.getMinMaxProteinSize()) print('o1', o1.getMinMaxProteinSize()) print('smallest', h1.smallestProteinSize) print('largest', h1.largestProteinSize) print('Bounding box', h1.boundingBox) pad = 100. afviewer.SetHistoVol(h1,pad,display=False) afviewer.displayPreFill() (x,y,z), maxi = h1.boundingBox bb = [[0, y, z], maxi] h1.buildGrid(boundingBox=bb)#, gridFileOut='1vesicle_new.grid' ) afviewer.displayFillBox(bb)