From 58a730a22679cbcfdb92bf4df34272d77766139d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bal=C3=A1zs=20Dukai?= Date: Wed, 1 May 2019 13:25:49 +0200 Subject: [PATCH] Update OBB calculation; Remove transform from tileset --- cjio/cjio.py | 2 +- cjio/tiling.py | 15 ++++----------- docker/run.sh | 2 +- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/cjio/cjio.py b/cjio/cjio.py index ff8e9dc..7ecb30b 100755 --- a/cjio/cjio.py +++ b/cjio/cjio.py @@ -536,7 +536,7 @@ def processor(cm): def update_crs_cmd(epsg): """ Reproject the CityJSON to a new EPSG. - The current file must have an EPSG defined (do it with function update_epsg()). + The current file must have an EPSG defined (do it with function assign_epsg). """ def processor(cm): utils.print_cmd_status('Reproject to EPSG:%d' % epsg) diff --git a/cjio/tiling.py b/cjio/tiling.py index bac5b69..a959b53 100644 --- a/cjio/tiling.py +++ b/cjio/tiling.py @@ -191,10 +191,10 @@ def compute_obb(bbox): The last three elements (indices 9, 10, and 11) define the z-axis direction and half-length. """ obb = [ - bbox[0], bbox[1], bbox[2], - bbox[3]/2, bbox[1], bbox[2], - bbox[0], bbox[4]/2, bbox[2], - bbox[0], bbox[1], bbox[5]/2 + bbox[3]/2, bbox[4]/2, bbox[5]/2, + (bbox[3]-bbox[0])/2, 0, 0, + 0, (bbox[4]-bbox[1])/2, 0, + 0, 0, (bbox[5]-bbox[2])/2 ] return obb @@ -204,13 +204,6 @@ def generate_tileset_json(): "asset": { "version": "1.0" }, "geometricError": 100.0, "root": { - "transform": - [ - 1.0, 0.0, 0.0, 0.0, - 0.0, 0.0, -1.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 1.0 - ], "boundingVolume": {"box": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, diff --git a/docker/run.sh b/docker/run.sh index b60e351..601c3f6 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -1 +1 @@ -docker run --rm --network=host -v $(pwd):/opt/cesium/cjio cesium +docker run --rm --network=host --name=cesium -v $(pwd):/opt/cesium/cjio cesium