Skip to content

atlasmoth-arc/massingpro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MassingPro

AI-powered architectural context massing generator. Upload facade photos, extract perspective, and export a fully textured 3D model ready for Rhino, SketchUp, or any render engine in one click.


What it does

  1. Upload photos of up to four building facades (Front, Back, Left, Right)
  2. Click four corners to correct perspective distortion
  3. Paint a mask over any artifacts (windows, vehicles, scaffolding)
  4. Set building dimensions and hit Build

The app runs Depth-Anything-V2 to generate displacement and normal maps, then packages everything into a ZIP ready for your target software.


Export formats

Render Model — .obj + .mtl + .matpkg

Best for Enscape photorealistic rendering in Rhino.

  • Flat ZIP structure — OBJ, MTL, and all textures sit in the root directory so Rhino resolves paths automatically
  • MTL includes map_Kd (albedo) and map_bump (normal) — textures appear in the Rhino viewport with no extra steps
  • Enscape .matpkg sidecars contain the full PBR schema (BumpMapType: 3, ImageFade, UseColorChannel) for physical displacement rendering
  • MassingPro_{id}_ApplyMaterials.py — Rhino Python script that auto-sets all material texture slots on run

Visual Model — .glb

Best for rapid viewport iteration in Rhino or SketchUp. Self-contained with embedded textures. Note: Rhino imports GLB as a Block Instance, which restricts Enscape material replacement.

SketchUp / DAE — .dae

Best for SketchUp users who need textures visible in the viewport and accessible to render engines.

  • Collada 1.4.1 format — SketchUp's native import path for textured geometry
  • Albedo texture bound to <diffuse> — appears immediately in the SketchUp viewport on import
  • Normal map included via FCOLLADA bump technique — picked up by V-Ray for SketchUp and Enscape for SketchUp
  • Textures sit flat alongside the .dae file; relative paths resolve automatically on import
  • Enscape .matpkg sidecars and displacement maps included in the ZIP for Enscape for SketchUp

Rhino workflow (Render Model)

  1. Extract the ZIP to a folder
  2. Import the .obj into Rhino — textures appear in the viewport automatically
  3. Open Enscape — albedo and normal maps render without any additional setup
  4. Optional: Run MassingPro_{id}_ApplyMaterials.py via Tools > Python Script > Run to force-refresh material slots
  5. Optional: Batch import the .matpkg files in the Enscape Material Editor for physical displacement

SketchUp workflow (DAE)

  1. Extract the ZIP to a folder
  2. Go to File > Import, select the .dae file — textures load automatically from the same folder
  3. The facade textures appear on the building surfaces in the SketchUp viewport immediately
  4. For Enscape for SketchUp: open the Enscape Material Editor and import the .matpkg sidecars for displacement and PBR properties
  5. For V-Ray for SketchUp: the normal map is already referenced in the DAE and will be read on scene open

Auto perspective detection

After uploading a photo, click 🎯 Auto-Detect to auto-fill the four corner points using edge and contour analysis — this is an optional shortcut. You can always ignore it and click the four corners manually on the canvas. If auto-detection lands incorrectly, drag the points to correct them or clear and re-click from scratch.


Tech stack

Layer Library
Frontend Streamlit + custom HTML/JS components
Depth AI ONNX Runtime · Depth-Anything-V2 ViT-S
Geometry trimesh · OpenCV
Export zipfile · PIL

Local setup

pip install streamlit onnxruntime trimesh opencv-python pillow requests numpy
streamlit run app.py

Place depth_anything_v2_vits.onnx in the project root. Download from the Depth-Anything-V2 releases.


Material naming convention

All materials follow the pattern MassingPro_{project_id}_{face} (e.g. MassingPro_482910_Front). The project ID is randomised per build. The Enscape matpkg "Name" field matches this exactly to enable auto-linking by name.


Changelog

2026-04-10

  • UI overhaul for design professionals — dark Streamlit chrome now matches the red accent used throughout (via .streamlit/config.toml); Jost / Neutra font stack applied globally.
  • Sidebar redesign — large bold MassingPro title, tightened vertical spacing so all controls fit without scrolling, faint grey borders on dimension input fields and +/− buttons, step size set to 0.25 m for precise nudging, "Surface Relief" slider replaces "Normal Intensity" with an in-place tooltip explanation.
  • How to use guide — moved from main content area to bottom of sidebar as a collapsible expander; written in plain design-professional language.
  • Perspective-corrected image — display constrained to 60 % of main area width to reduce scrolling between steps.
  • Canvas improvements — numbered corner labels (1 TL / 2 TR / 3 BR / 4 BL) on the perspective picker; plain-English instruction text on both the picker and mask painter canvases.
  • 3D preview auto-expands after each build so the model is visible immediately without a manual click.
  • Faster builds — ONNX inference session cached with @st.cache_resource; model loads from disk once per server process, eliminating repeated initialisation overhead on subsequent builds.
  • Export labels — shortened and made format-centric (e.g. "OBJ + MTL (.obj)", "GLTF Binary (.glb)", "Collada (.dae)").

2026-04-09

  • SketchUp / DAE export — new export option generating a Collada 1.4.1 file with albedo textures bound to <diffuse> (viewport) and normal maps via FCOLLADA bump technique (V-Ray / Enscape for SketchUp). Displacement maps and .matpkg sidecars included in the ZIP.
  • Interactive 3D preview — inline model-viewer panel renders a double-sided GLB preview directly in the app after each build, with expand/collapse toggle.

2026-04-05

  • Render Model export — OBJ + MTL with map_Kd and map_bump for zero-step Rhino viewport textures and Enscape rendering.
  • Rhino auto-material scriptMassingPro_{id}_ApplyMaterials.py generated in every ZIP to force-apply texture slots via Rhino Python.
  • Auto perspective detection — one-click corner detection using edge + contour analysis; points are draggable for refinement.

2026-04-04

  • Hybrid export pipeline — GLB for viewport visibility paired with Enscape .matpkg sidecars for PBR rendering.

2026-04-03

  • Initial release — core pipeline: perspective unwarp, Depth-Anything-V2 depth estimation, normal map generation, 16-bit displacement maps, and ZIP packaging.
  • Enscape .matpkg generation — full PBR JSON schema with albedo, normal, and displacement texture slots.
  • Unique project IDs — randomised per build to prevent material name collisions in Rhino/Enscape.
  • Custom HTML/JS canvas components — zero-lag perspective point picker and mask painter.

License

Apache License 2.0

About

MassingPro is a lightweight, zero-compute architectural utility that converts 2D facade photographs into UV-mapped 3D context models. It bypasses complex 3D topology by generating 16-bit displacement and normal maps, allowing for high-fidelity architectural visualization at zero CAD modeling cost.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages