From 0979f2b96a999d09b09fda26b28adf705902aef2 Mon Sep 17 00:00:00 2001 From: Hadise Rasoulian Date: Tue, 11 Apr 2023 13:37:55 -0400 Subject: [PATCH] Level0 Level0 will walk you through: * Install PyCharm: It is a python editor that we use. * Install miniconda: It is a package and environment manager for python. * Set up an environment and install Cerc-hub. * Basic geometry import * Export back to .obj format The three files included in this commit are: 1. main.py: the final code created in the tutorial level0 pdf. 2. FZK-Haus-LoD2-KIT-IAI-KHH-B36-V1.gml: A geometry file used to create the city (input). 3. Unknown.obj: An export of the city to obj (output). --- Level0/FZK-Haus-LoD2-KIT-IAI-KHH-B36-V1.gml | 240 ++++++++++++++++++++ Level0/Unknown.obj | 28 +++ Level0/main.py | 13 ++ 3 files changed, 281 insertions(+) create mode 100644 Level0/FZK-Haus-LoD2-KIT-IAI-KHH-B36-V1.gml create mode 100644 Level0/Unknown.obj create mode 100644 Level0/main.py diff --git a/Level0/FZK-Haus-LoD2-KIT-IAI-KHH-B36-V1.gml b/Level0/FZK-Haus-LoD2-KIT-IAI-KHH-B36-V1.gml new file mode 100644 index 0000000..baf0544 --- /dev/null +++ b/Level0/FZK-Haus-LoD2-KIT-IAI-KHH-B36-V1.gml @@ -0,0 +1,240 @@ + + + AC14-FZK-Haus + + + 457842 5439083 111.8 + 457854 5439093 118.317669 + + + + + FZK-Haus (Forschungszentrum Karlsruhe, now KIT), created by Karl-Heinz + Haefele + AC14-FZK-Haus + 2017-01-23 + entirelyAboveTerrain + + 120.00 + + + New Building + + + NO + + 1000 + 1000 + 1000 + 2020 + 1030 + 6.52 + 2 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Outer Wall 1 (West) + + + + + + + 457842 5439088 118.317691453624 + 457842 5439093 115.430940107676 + 457842 5439093 111.8 + 457842 5439083 111.8 + 457842 5439083 115.430940107676 + 457842 5439088 118.317691453624 + + + + + + + + + + + Outer Wall 2 (South) + + + + + + + 457854 5439083 115.430940107676 + 457842 5439083 115.430940107676 + 457842 5439083 111.8 + 457854 5439083 111.8 + 457854 5439083 115.430940107676 + + + + + + + + + + + Outer Wall 3 (East) + + + + + + + 457854 5439088 118.317691453624 + 457854 5439083 115.430940107676 + 457854 5439083 111.8 + 457854 5439093 111.8 + 457854 5439093 115.430940107676 + 457854 5439088 118.317691453624 + + + + + + + + + + + Roof 1 (North) + + + + + + + 457842 5439088 118.317691453624 + 457854 5439088 118.317691453624 + 457854 5439093 115.430940107676 + 457842 5439093 115.430940107676 + 457842 5439088 118.317691453624 + + + + + + + + + + + Outer Wall 4 (North) + + + + + + + 457842 5439093 115.430940107676 + 457854 5439093 115.430940107676 + 457854 5439093 111.8 + 457842 5439093 111.8 + 457842 5439093 115.430940107676 + + + + + + + + + + + Roof 2 (South) + + + + + + + 457854 5439083 115.430940107676 + 457854 5439088 118.317691453624 + 457842 5439088 118.317691453624 + 457842 5439083 115.430940107676 + 457854 5439083 115.430940107676 + + + + + + + + + + + Bodenplatte + Base Surface + + + + + + + 457854 5439083 111.8 + 457842 5439083 111.8 + 457842 5439093 111.8 + 457854 5439093 111.8 + 457854 5439083 111.8 + + + + + + + + + + + + + + Eggenstein-Leopoldshafen + + 4711 + Spöcker Straße + + + 76344 + + + + + + + + + \ No newline at end of file diff --git a/Level0/Unknown.obj b/Level0/Unknown.obj new file mode 100644 index 0000000..d456ea9 --- /dev/null +++ b/Level0/Unknown.obj @@ -0,0 +1,28 @@ +# cerc-hub export +# building UUID_d281adfc-4901-0f52-540b-4cc1a9325f82 +g UUID_d281adfc-4901-0f52-540b-4cc1a9325f82 +s off +# surface 9a1623ed-cff3-46e3-b216-6b5bc34caf68 +v 0.0 5.0 6.517691453623996 +v 0.0 10.0 3.630940107675997 +v 0.0 10.0 0.0 +v 0.0 0.0 0.0 +v 0.0 0.0 3.630940107675997 +f 1 2 3 4 5 +# surface 6ac94b17-cc97-4b67-b79a-402cd0325917 +v 12.0 0.0 3.630940107675997 +v 12.0 0.0 0.0 +f 6 5 4 7 +# surface 429f5b6f-2818-4882-b8f4-f6983e707d86 +v 12.0 5.0 6.517691453623996 +v 12.0 10.0 0.0 +v 12.0 10.0 3.630940107675997 +f 8 6 7 9 10 +# surface e934907a-d808-45bc-bc8f-5ad17b0834f1 +f 1 8 10 2 +# surface 0e80bc1f-0b35-4917-ba25-98139457582c +f 2 10 9 3 +# surface d8ef7be5-3144-4947-b054-c9e39f548ad1 +f 6 8 1 5 +# surface f30c3309-acc2-46a8-aa15-e255c345d77c +f 7 4 3 9 diff --git a/Level0/main.py b/Level0/main.py new file mode 100644 index 0000000..9c8a674 --- /dev/null +++ b/Level0/main.py @@ -0,0 +1,13 @@ +from hub.imports.geometry_factory import GeometryFactory +from hub.exports.exports_factory import ExportsFactory + + +gml_file = './FZK-Haus-LoD2-KIT-IAI-KHH-B36-V1.gml' +city = GeometryFactory('citygml', gml_file).city + +for building in city.buildings: + print(building.name) + print(building.volume) + print(building.floor_area) + +ExportsFactory('obj', city, './').export()