erikgaal / funda-floorplan-extractor

Extracts 3D floorplan models from Dutch real estate platform funda.nl
MIT License
0 stars 0 forks source link

Input url #1

Open simonsapiel opened 4 years ago

simonsapiel commented 4 years ago

Hi @erikgaal! Cool project. Could you elaborate on what is the input url you're passing to

with urllib.request.urlopen(url) as response: body = response.read()?

erikgaal commented 4 years ago

Hi there,

Apologies for the lack of documentation. Currently, you need to supply the URL of the floorplan project directly (e.g. https://cloud.funda.nl/valentina_media/128/642/790.xml?editor_version=2.4.601&auth_token=undefined for https://www.funda.nl/koop/rotterdam/huis-41828585-edelweisslaan-26). You can find the URL in the Network tab of the Developer tools and filtering for cloud.funda.nl mime-type:text/xml.

At some point in the future, I will try to allow you to use the regular Funda URL instead.

simonsapiel commented 4 years ago

Awesome thanks! Do you provide the script for creating the sample plot from the obj file also somewhere?

erikgaal commented 4 years ago

The sample plot is made using macOS' Preview.app. If you are not using macOS, any modelling should be able to view the mesh.

simonsapiel commented 4 years ago

Ah, I see. Mint didn't support out of the box viewing for the wavefront objects. Also looking at the xml file you provided the structure seems rather peculiar. Any chance you might know what would be the correct elements for the 2D representation? @erikgaal

erikgaal commented 4 years ago

I'm sorry but I don't think I exactly understand your question. What this tool does is get the proprietary Funda floorplan (https://cloud.funda.nl/valentina_media/128/642/790.xml?editor_version=2.4.601&auth_token=undefined), pick out the right parts with some filtering and convert them to a Wavefront object, like so:

$ python3 main.py https://cloud.funda.nl/valentina_media/128/642/790.xml\?editor_version\=2.4.601\&auth_token\=undefined
# area
v 3.38791 0.0 8.05191
v 3.88791 0.0 8.05191
v 3.88791 0.0 6.92191
v 3.38791 0.0 6.92191
f -4 -3 -2 -1

# area
v 6.44791 0.0 8.05191
v 6.94791 0.0 8.05191
v 6.94791 0.0 6.92191
v 6.44791 0.0 6.92191
f -4 -3 -2 -1
...

If you're interested in what elements of the proprietary format I've used, you can check https://github.com/erikgaal/funda-floorplan-extractor/blob/e1f7354d8c028d96451917f61efa7dfdfce26290/main.py#L47 and https://github.com/erikgaal/funda-floorplan-extractor/blob/e1f7354d8c028d96451917f61efa7dfdfce26290/main.py#L8.