DEV Community

Cover image for Cityweft vs GenAnywhere: Georeferenced GLB in a Three.js Site Viewer
GenAnywhere
GenAnywhere

Posted on

Cityweft vs GenAnywhere: Georeferenced GLB in a Three.js Site Viewer

Our campus master plan had a viewer problem. The architects worked in Revit, the landscape team in Rhino, and the board wanted a browser link that opened on a laptop without plugins. I inherited two site context meshes: one generated from a map selection with GenAnywhere, one exported from Cityweft with coordinates and layers. Only one of them could survive a round trip through Three.js without someone nudging it into place.

GenAnywhere was useful for the concept phase. Select the campus on a map, get a mesh, drop it into a scene. It looks right at a glance, and for a slide it is right enough. The mesh is a single object with baked colors, no real coordinate system, and no separation between ground, buildings, and trees. That last part is what broke the viewer.

What arrives in the GLB

Cityweft exports a 3D site model in GLB that keeps its georeferencing. In our case the model was projected in a State Plane zone, and the exporter wrote a local origin plus enough metadata for us to recover the placement. The file also kept scene layers: ground, buildings, vegetation, and a category for the point cloud we uploaded through My Data. That structure is the difference between a model you can query and a pretty mesh.

Checking coordinates before rendering

The first thing I do with any site export is verify the origin. If the numbers are wrong, the viewer will still render something, and the error will show up three weeks later in a shadow study. This script reads the GLB, pulls the transform, and prints the latitude and longitude of the model origin. The transform uses pyproj and the EPSG code for our county's State Plane zone:
The numbers matched the survey control point within two centimeters. The mesh itself is not survey grade, but the placement is, and that is what matters for overlaying GIS layers. With the GenAnywhere mesh we measured a drift of about 4.2 meters against the same control point, which is visible when you put a walkway on top of it. That number also settled an argument with the board: four meters is a corridor, so the viewer is for orientation and route questions go back to the facilities drawings.

Hooking layers into the UI

Layer names in the GLB follow a prefix convention, so the viewer can build toggles without a config file. The loader runs once, tags each mesh, and the UI filters by tag:
Toggling vegetation off cut the draw calls by a third and made the building edges readable. That is not a rendering trick; it is a data structure decision made upstream. A baked mesh forces you to re-export to hide a tree.

Performance notes

The full campus arrived at 1.4 million triangles. We decimated the terrain to 180,000, kept the buildings at full resolution, and left the trees alone because they were already low poly. Decimation also fixed a z-fighting flicker at the plaza, where two surfaces sat within a centimeter. Textures were 2K and mostly diffuse; the PBR maps from Cityweft were heavier than the scene needed. After cleanup the WebGL viewer held 60 fps on a 2019 laptop with integrated graphics, which was the actual target.

IFC for the architects

The architects did not want a GLB. They wanted the site in Revit, so we exported IFC and handed it over. The building splits survived, the coordinate system survived, and the materials needed a pass. That is normal for IFC and not a reason to skip it. The point of the pipeline is that each team gets a format it can use without a conversion ritual.

What I would change

I would ask for the layers before the first export instead of discovering the naming after the fact. I would pin the exporter version too, because a metadata key changed between releases and broke our parser for an afternoon. I would also keep the GenAnywhere mesh in the repo as a concept artifact, clearly labeled, because it is genuinely useful for early screenshots. The next viewer can start from this export instead of rebuilding the site, which is the practical payoff of a model that knows where it is. Spatial data is only as good as its metadata, and a mesh without an origin is a picture with extra steps.

Top comments (0)