3D Geodata Academy

All article materials Article materials

Walking distance to the nearest exit, from a scan

A classified S3DIS office floor becomes a walking-distance map to the nearest of eight exits, an escape route per room, the dead-end corridors, and a block-an-exit what-if that re-solves the floor in tens of milliseconds. Multi-source Dijkstra over 16 moves, on a CPU.

Runs on Python 3.10, numpy, scipy, scikit-image, networkx, pytest for the tests, plyfile and pandas to rebuild the scan, and open3d with matplotlib for the 3D replay.

An office floor point cloud coloured by walking distance to the nearest exit, with escape routes
Open

The code

Public, no email needed. Read it, fork it, run it, break it.

  • evacuation_distance.py The ten steps, from roles and the walkable grid to the what-if sweep and the export.
  • prepare_s3dis.py Rebuilds the article’s 5 cm Area 1 floor from your own S3DIS download.
  • visualize.py The stepped 3D replay, one Open3D window per step.
  • tests/conftest.py Shared test helpers, synthetic floors with answers known in advance.
  • tests/test_geometry.py The walkable grid, known widths in and known widths out.
  • tests/test_field.py The distance field, the routes and the what-if on grids whose answers are known.
  • tests/test_dead_ends.py Dead-end corridors and common paths on a floor drawn by hand.
  • tests/test_determinism.py On the real floor, shuffled, rerun and nudged by 0.5 mm; skipped until data/ holds it.
  • run.bat Windows double-click runner, pipeline then replay.
View on GitHub
Email

The reference output

The files my run wrote, so you can check yours against them. Tell me where to send them.

  • metrics.json Every number the article quotes, from the grid to the what-if cascade.
  • evacuation_routes.json The exits, the route of every space and the dead-end corridors, in Area 1’s metres.

Data: Reference outputs computed by Florent Poux from S3DIS, Area 1: I. Armeni, O. Sener, A. R. Zamir, H. Jiang, I. Brilakis, M. Fischer, S. Savarese, 3D Semantic Parsing of Large-Scale Indoor Spaces, CVPR 2016.

Source

Get the data: S3DIS, the Stanford Large-Scale 3D Indoor Spaces dataset

From the official page, download Stanford3dDataset_v1.2_Aligned_Version.zip, unzip it anywhere, then run python prepare_s3dis.py --s3dis "path/to/Stanford3dDataset_v1.2_Aligned_Version" in the kit folder.

prepare_s3dis.py reads the whole of Area 1, leaves out the ceiling and the beams, thins it to one point per 5 cm voxel and writes the copy the article ran on, 1,378,028 points, into a data/ folder next to the scripts, where evacuation_distance.py looks for it. Nothing else from S3DIS is needed.

  • Stanford3dDataset_v1.2_Aligned_Version/Area_1/*/Annotations/*.txt Read. Every room of Area 1, one text file per object, named after its class. Only Area_1 is needed.
  • data/s3dis_area1_open_5cm.ply Written next to the scripts. The whole Area 1 floor at 5 cm, 1,378,028 points.
  • data/classes.json Written beside it. The class names of that file.

The numbers in the article come from S3DIS. Run the kit on your own scan and you get your own numbers.

Terms: Stanford’s registration form: “I will not redistribute the dataset in any way and in any format. Any new access will be established through this form and/or authors’ official method of releasing the dataset. I agree that the data and derivatives will be used only for non-commercial research and academic purposes.”

Get it from the official dataset page

The page’s download link opens the dataset’s registration form.

Where should I send them?

One email, and the download links appear right here. You also get them in your inbox so you can come back to this any time.

Cover of 3D Data Science with Python by Dr. Florent Poux
Go deeper

3D Data Science with Python

Building Accurate Digital Environments with 3D Point Cloud Workflows

This kit is one pipeline. The book is the discipline underneath them: 690 pages from the Python foundations through point cloud processing, meshing and the engineering that keeps a 3D workflow standing up in production. If the script above makes sense and you want the structure they came from, that is where it lives.

O’Reilly Media, 2025 · ISBN 9781098161330 · 15,000+ readers

See the book or buy it on O’Reilly
Dr. Florent Poux

Dr. Florent Poux

Founder and Lead Instructor at the 3D Geodata Academy. 15+ years on the automation of reality capture, from point clouds and photogrammetry to spatial AI, and 1,700+ citations across 60+ peer-reviewed publications.

These are the materials for Walking distance to the nearest exit, from a scan, one of the tutorials I publish on Medium and on learngeodata.eu. Every kit lives at learngeodata.eu/materials/.

Scroll to Top