Skip to content

Convert raster-to-vector floorplan vectors to Plan2Scene input formats.

License

Notifications You must be signed in to change notification settings

3dlg-hcvc/r2v-to-plan2scene

Repository files navigation

R2V-to-Plan2Scene

Generate Plan2Scene compatible scene.json files from raster-to-vector outputs.

Dependencies

pip install -r requirements.txt

Converting R2V output to Plan2Scene scene.json format

To convert a raster-to-vector output to the scene.json format, run the following command.

export PYTHONPATH=./code/src
python convert.py [Output path] [Path to raster-to-vector output file] --scale-factor [Scale factor]

# The scale factor is used to convert pixel coordinates provided by raster-to-vector into meters.

# Example
python convert.py ./outputs/ ./sample_input/sample_r2v_output.txt --scale-factor 0.08

Note: This tool supports processing of the R2V annotation format as well. You can find many example floorplans in this format in the R2V code repository. The floorplan annotator they used is also available in the same repository. The R2V annotation format is very similar to the R2V output format. However, the room type labels are represented as axis-aligned bounding boxes instead of properties of the wall line segment. If you are processing an r2v annotation file, make sure to provide --r2v-annot flag as a command-line argument.

The outputs directory has the following files:

  • *.scene.json file describing the house architecture.
  • *.objectaabb.json file describing axis-aligned bounding boxes of object icons.
  • Sketches of floorplan and the rooms. Use these for debugging purposes.

Previewing results

  1. To preview the *.scene.json file with house architecture in 3D, use the scene-viewer of SmartScenesToolkit.

  2. We generate 2D sketches that preview the annotations. Use these to identify errors in the parsed floorplan such as missing room-door-room edges.

    The following generated sketch shows room 4 of the provided sample house.

    The focused room (room4) is colored green. Its door connected neighbors are gray colored. The doors are indicated by blue lines and windows are indicated by yellow lines.

Using Plan2Scene with R2V outputs

Please refer to the intructions provided in the Plan2Scene code repository.

Configurations of R2V-to-Plan2Scene tool

In this section, we describe different configurations that you may want to change.

About

Convert raster-to-vector floorplan vectors to Plan2Scene input formats.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages