Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roofs shape in 3D building preview #1061

Open
Andygol opened this issue Aug 29, 2023 · 10 comments
Open

Roofs shape in 3D building preview #1061

Andygol opened this issue Aug 29, 2023 · 10 comments
Labels
bluesky Bluesky issues are extra challenging - this might take a while or be impossible feature-3d Issue or request related to the 3d viewer

Comments

@Andygol
Copy link

Andygol commented Aug 29, 2023

Description

Re #993

As of now, there is almost no convenient tool for visualizing the shape of roofs during 3D modeling of buildings before saving the data in the database. It seems that a similar plugin in JOSM is currently in the process of being redesigned, and it does not work as expected. It would be nice to be able to preview buildings with LOD2+ before sending them to an upstream DB and not wait for third party tools like https://osmbuildings.org and https://demo.f4map.com/ to render.

It would be great to have roof shape support in the next release of RapiD.

@bhousel bhousel added the feature-3d Issue or request related to the 3d viewer label Aug 29, 2023
@Bonkles
Copy link
Contributor

Bonkles commented Aug 29, 2023

To be sure, I investigated this and tried a few different ways to get roof shapes into the 3D capabilities of maplibre-gl-js, but there was no simple way to do it. I also want this feature to be a thing very badlly!

Adding some context here:
This feature was requested in mapbox-gl back in 2017: mapbox/mapbox-gl-js#3998

It was never implemented in either mapbox-gl or maplibre-gl. The official response seems to be to create a 3D model for any buildings we want to draw at higher fidelity. I don't love that idea because I suspect it will bring performance to a standstill.

If we really need roof shapes though, we might have to look at using something like cesium's building renderer instead.

@tordans
Copy link

tordans commented Aug 30, 2023

Maybe this has something helpful about the roof shapes https://ths.rwth-aachen.de/wp-content/uploads/sites/4/schulz20203d.pdf

In his dissertation, at the RWTH Aachen, Philipp Schulz studied [PDF] the construction of 3D maps based on OSM data. His aim was to make the planning of wind farms easier. He focused on how to create 3D shapes for buildings, including roofs, and how to create curved roads and trees.

Source: WeeklyOSM

@rene78
Copy link

rene78 commented Aug 15, 2024

I know this might sound naive, but sites like f4map display buildings in 3D. I wonder why it's so challenging to achieve something similar within the iD editor. Implementing 3D tags would really take off with better visualization. As @Andygol mentioned, it's currently a struggle since we have to wait for the building to be rendered in f4map.

@bhousel
Copy link
Contributor

bhousel commented Aug 15, 2024

We are using Maplibre to render the 3D scene, and it really only supports extruded shapes.

If we wanted to turn the buildings into meshes with roofs, and render them to a canvas, maybe with another Pixi.js scene, that's possible too, but it's not what we can do currently.

@bhousel bhousel added the bluesky Bluesky issues are extra challenging - this might take a while or be impossible label Aug 15, 2024
@bryceco
Copy link

bryceco commented Aug 15, 2024

Kinda related to bryceco/GoMap#728

Beakerboy’s renderer pulls from the OSM API by default, but you can also send it an XML with relevant data to render.

@1ec5
Copy link

1ec5 commented Sep 10, 2024

A full-fledged 2.5D map library like MapLibre might not be well-suited for the task of previewing a 3D building – essentially, previewing a 3D model. Even if you do generate a proper 3D model for the building, GL JS doesn’t really help you beyond positioning it in the middle of the frame and swiveling the camera. What if the preview were an A-Frame model instead? 3DStreet shows how this could be useful at a street scale. It’s part of an interactive lane editor, so you can see how it might perform in a Rapid environment.

@tordans
Copy link

tordans commented Sep 10, 2024

FYI @tordanik just started a funding phase with the Prototype Fund https://prototypefund.de/project/osm2world/ which AFAIK will entail to make it easier to embed OSM2World into other environments.

@bhousel
Copy link
Contributor

bhousel commented Sep 10, 2024

I’d probably just use Pixi, the same thing we use for the main map. We can make our own meshes and render the scene with perspective.

lot of work for roofs though 😆

@1ec5
Copy link

1ec5 commented Sep 10, 2024

Sure, that’s the only reason I suggested A-Frame: that it’s pretty much ready-made for displaying buildings with roofs in 3D. (An A-frame is a roof shape.) So it’s probably less work for you then building a 3D model renderer atop pixi.js and generating a mesh. Though I guess there would still be the work to figure out coordinate spaces. That might make OSMBuilding a less involved option.

@tordanik
Copy link

@tordans thanks for the ping!

I indeed got funding to provide OSM2World's functionality as a library (planning to use Kotlin multiplatform to target web and mobile): Input some OSM data, get 3D meshes that you can display with your preferred rendering solution. OSM2World fully supports Simple 3D Buildings, by the way, not just roof shapes – so if desired this would allow an editor preview to be very close to what the building will look on f4map and similar renderers.

Happy to keep you updated on the project's progress if it's relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bluesky Bluesky issues are extra challenging - this might take a while or be impossible feature-3d Issue or request related to the 3d viewer
Projects
None yet
Development

No branches or pull requests

8 participants