Exemplo n.º 1
0
def makeProjectedFiles(idList, layerList, fileSuffix):
    fmask = 'C:\\amigos\\dump\\%s-%s.3dm'
    outMask = 'C:\\amigos\\dump\\%s-'+fileSuffix+'.3dm'
    types = ['site', 'terrain']
    outLayers = [s+'-projected' for s in layerList]
    for siteId in idList:
        FileUtils.deleteAll()
        fpaths = [(fmask % (siteId, t)) for t in types]
        FileUtils.importFiles(fpaths)
        for i, layer in enumerate(layerList):
            lyrAtt = LayerUtils.layerAttributes(outLayers[i]) # make the layer
            # determine geometry type
            sampleGeom = LayerUtils.getLayerGeometry(layer)
            if len(sampleGeom) > 0:
                if type(sampleGeom[0]) == Point:
                    resultPairs = IntersectionTools.smartPointLayerProject(layer, 'groundsurface', lyrAtt)
                    # bake results
                    for pair in resultPairs:
                        scriptcontext.doc.Objects.AddPoint(pair[0], pair[1])
                else:
                    resultPairs = IntersectionTools.smartCurveLayerProject(layer, 'groundsurface', lyrAtt)
                    # bake results
                    for pair in resultPairs:
                        scriptcontext.doc.Objects.AddCurve(pair[0], pair[1])
        outPath = outMask % siteId
        FileUtils.exportLayers(outLayers, outPath)
Exemplo n.º 2
0
def makeProjectedFiles(idList, layerList, fileSuffix):
    fmask = 'C:\\amigos\\dump\\%s-%s.3dm'
    outMask = 'C:\\amigos\\dump\\%s-' + fileSuffix + '.3dm'
    types = ['site', 'terrain']
    outLayers = [s + '-projected' for s in layerList]
    for siteId in idList:
        FileUtils.deleteAll()
        fpaths = [(fmask % (siteId, t)) for t in types]
        FileUtils.importFiles(fpaths)
        for i, layer in enumerate(layerList):
            lyrAtt = LayerUtils.layerAttributes(outLayers[i])  # make the layer
            # determine geometry type
            sampleGeom = LayerUtils.getLayerGeometry(layer)
            if len(sampleGeom) > 0:
                if type(sampleGeom[0]) == Point:
                    resultPairs = IntersectionTools.smartPointLayerProject(
                        layer, 'groundsurface', lyrAtt)
                    # bake results
                    for pair in resultPairs:
                        scriptcontext.doc.Objects.AddPoint(pair[0], pair[1])
                else:
                    resultPairs = IntersectionTools.smartCurveLayerProject(
                        layer, 'groundsurface', lyrAtt)
                    # bake results
                    for pair in resultPairs:
                        scriptcontext.doc.Objects.AddCurve(pair[0], pair[1])
        outPath = outMask % siteId
        FileUtils.exportLayers(outLayers, outPath)
Exemplo n.º 3
0
def makeTerrains(idList):
    fmask = 'C:\\amigos\\dump\\%s-site.3dm'
    for id in idList:
        FileUtils.deleteAll()
        fpaths = [fmask % id]
        FileUtils.importFiles(fpaths)
        makeTerrainSurfaces()
        makeTerrainFile(id)
Exemplo n.º 4
0
def makeTerrains(idList):
    fmask = 'C:\\amigos\\dump\\%s-site.3dm'
    for id in idList:
        FileUtils.deleteAll()
        fpaths = [fmask % id]
        FileUtils.importFiles(fpaths)
        makeTerrainSurfaces()
        makeTerrainFile(id)
Exemplo n.º 5
0
def makeBillboardFiles(idList):
    fmask = 'C:\\amigos\\dump\\%s-%s.3dm'
    outMask = 'C:\\amigos\\dump\\%s-billboards.3dm'
    types = ['billboardpoints',
            'terrain',
            'roads',
            ]
    outLayers = ['billboards']
    for siteId in idList:
        FileUtils.deleteAll()
        fpaths = [(fmask % (siteId, t)) for t in types]
        FileUtils.importFiles(fpaths)
        addBillboards()
        outPath = outMask % siteId
        FileUtils.exportLayers(outLayers, outPath)
Exemplo n.º 6
0
def makeBillboardFiles(idList):
    fmask = 'C:\\amigos\\dump\\%s-%s.3dm'
    outMask = 'C:\\amigos\\dump\\%s-billboards.3dm'
    types = [
        'billboardpoints',
        'terrain',
        'roads',
    ]
    outLayers = ['billboards']
    for siteId in idList:
        FileUtils.deleteAll()
        fpaths = [(fmask % (siteId, t)) for t in types]
        FileUtils.importFiles(fpaths)
        addBillboards()
        outPath = outMask % siteId
        FileUtils.exportLayers(outLayers, outPath)
Exemplo n.º 7
0
def makeDrainFiles(idList):
    fmask = 'C:\\amigos\\dump\\%s-%s.3dm'
    outMask = 'C:\\amigos\\dump\\%s-drains.3dm'
    types = ['site', 'terrain']
    outLayers = ['openchannels-projected',
              'gravitymains-projected',
              'lateraldrains-projected',
              'catchbasins-projected',
              ]
    for id in idList:
        FileUtils.deleteAll()
        fpaths = [(fmask % (id, t)) for t in types]
        FileUtils.importFiles(fpaths)
        makeDrains()
        outPath = outMask % id
        FileUtils.exportLayers(outLayers, outPath)
Exemplo n.º 8
0
def makeDrainFiles(idList):
    fmask = 'C:\\amigos\\dump\\%s-%s.3dm'
    outMask = 'C:\\amigos\\dump\\%s-drains.3dm'
    types = ['site', 'terrain']
    outLayers = [
        'openchannels-projected',
        'gravitymains-projected',
        'lateraldrains-projected',
        'catchbasins-projected',
    ]
    for id in idList:
        FileUtils.deleteAll()
        fpaths = [(fmask % (id, t)) for t in types]
        FileUtils.importFiles(fpaths)
        makeDrains()
        outPath = outMask % id
        FileUtils.exportLayers(outLayers, outPath)
Exemplo n.º 9
0
def importSiteFiles(siteId, types):
    fmask = 'C:\\amigos\\dump\\%s-%s.3dm'
    fpaths = [(fmask % (siteId, t)) for t in types]
    FileUtils.deleteAll()
    FileUtils.importFiles(fpaths)
Exemplo n.º 10
0
def importSiteFiles(siteId, types):
    fmask = 'C:\\amigos\\dump\\%s-%s.3dm'
    fpaths = [(fmask % (siteId, t)) for t in types]
    FileUtils.deleteAll()
    FileUtils.importFiles(fpaths)