def build(mods, consume=False, io=None): if io is None: io = di.fetch_info()['exporter'] elif type(io) is type(''): io = iotypes[io] if not type(mods) is type([]): mods = [mods] for mdx in range(len(mods)): m = mods[mdx] if issubclass(m.__class__, dm.model): mods[mdx] = dsg.node(models=[m]) if consume: consumenode = dsg.node(children=mods, consumption=True) mods = [consumenode] sgr = dsg.sgraph(nodes=mods) #sgr.graph(iotypes[io]) sgr.graph(io)
def build(mods,consume = False,io = None): if io is None:io = di.fetch_info()['exporter'] elif type(io) is type(''):io = iotypes[io] if not type(mods) is type([]):mods = [mods] for mdx in range(len(mods)): m = mods[mdx] if issubclass(m.__class__,dm.model): mods[mdx] = dsg.node(models = [m]) if consume: consumenode = dsg.node(children = mods,consumption = True) mods = [consumenode] sgr = dsg.sgraph(nodes = mods) #sgr.graph(iotypes[io]) sgr.graph(io)
def test(): user_info = di.fetch_info() osmdata = user_info['osmdata'] oworld = read_xml(osmdata) ax = dtl.plot_axes() ax = oworld.plot_boundary(ax) ax = oworld.plot_all_routes(ax) #ax = oworld.plot_way_by_name('I 95',ax) #ax = oworld.plot_way_by_name('I 64',ax) #ax = oworld.plot_way_by_name('360',ax) plt.show() pdb.set_trace()
def write_world_script(io = None,world_dir = None,**kws): if world_dir is None:world_dir = os.getcwd() if io is None:io = di.fetch_info()['exporter'] io = iotypes[io] if hasattr(io,'write_world_script'): io.write_world_script(world_dir)
def realize(context,years = 0,io = None,**kws): if io is None:io = di.fetch_info()['exporter'] elif type(io) is type(''):io = iotypes[io] context.generate(worn = years) context.graph(io,**kws)
def build2(mod,io = None): if io is None:io = di.fetch_info()['exporter'] elif type(io) is type(''):io = iotypes[io] io.build_model2(mod)
import dilap.core.base as db import dilap.core.uinfo as di #import dilap.core.material as dma import dilap.modeling.material as dma #import cStringIO as sio from io import StringIO as sio import os, shutil, pdb user_info = di.fetch_info() #world_dir = user_info['contentdir'] ######################################################################### ### materials ######################################################################### # initialize the materials script def write_materials(world_dir): matfile = os.path.join(world_dir, 'materials.mtl') matstring = sio() matstring.write('\n') write_default_materials_mtl(matstring) matstring.write('\n') with open(matfile, 'w') as h: h.write(matstring.getvalue()) for dm in def_mats: shutil.copy(db.resource_path(dm.dtexture), world_dir) print('new materials file', matfile)
def build2(mod, io=None): if io is None: io = di.fetch_info()['exporter'] elif type(io) is type(''): io = iotypes[io] io.build_model2(mod)
import dilap.core.base as db import dilap.core.uinfo as di #import dilap.core.material as dma import dilap.modeling.material as dma #import cStringIO as sio from io import StringIO as sio import os,shutil,pdb user_info = di.fetch_info() #world_dir = user_info['contentdir'] ######################################################################### ### materials ######################################################################### # initialize the materials script def write_materials(world_dir): matfile = os.path.join(world_dir,'materials.mtl') matstring = sio() matstring.write('\n') write_default_materials_mtl(matstring) matstring.write('\n') with open(matfile,'w') as h: h.write(matstring.getvalue()) for dm in def_mats: shutil.copy(db.resource_path(dm.dtexture),world_dir) print('new materials file',matfile) def_mats = [] def write_default_materials_mtl(msio):
def write_world_script(io=None, world_dir=None, **kws): if world_dir is None: world_dir = os.getcwd() if io is None: io = di.fetch_info()['exporter'] io = iotypes[io] if hasattr(io, 'write_world_script'): io.write_world_script(world_dir)
def realize(context, years=0, io=None, **kws): if io is None: io = di.fetch_info()['exporter'] elif type(io) is type(''): io = iotypes[io] context.generate(worn=years) context.graph(io, **kws)