Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BIM-to-Print: High-Performance Watertight Mesh Engine for Revit

A professional, high-performance Revit add-in written in C++ and C# (.NET 10) designed to reconstruct complex, non-manifold, or faulty BIM geometries into smooth, hollowed, and guaranteed watertight STL meshes optimized for additive manufacturing (3D printing).


The Challenge in BIM 3D Printing

Revit models are designed for construction, not 3D printing. They often contain overlapping geometries, hollow walls, open junctions, nested families, and non-manifold edges. Sending these raw geometries directly to slicers such as Cura, OrcaSlicer, Bambu Studio, or PrusaSlicer frequently results in mesh errors, rendering artifacts, failed slicing operations, and unsuccessful prints.

BIM-to-Print solves this problem by providing a high-speed bridge between Revit's geometry database and a custom C++ voxelization and mesh reconstruction engine, producing clean, manufacturable STL files.


Core Technical Features

Conservative Voxelization Engine (C++)

  • Dynamically calculates triangle edge lengths.
  • Adapts barycentric sampling density in real time.
  • Prevents voxel leakage even on extremely thin walls and large planar surfaces.
  • Produces fully closed volumetric boundaries.

3D Flood-Fill Solver (C++)

  • High-performance Breadth-First Search (BFS) implementation.
  • Starts from padded external bounds.
  • Automatically identifies exterior air volumes.
  • Seals internal voids and faulty BIM junctions.

Laplacian Mesh Smoothing (C++)

  • Iterative Laplacian smoothing on a shared-vertex mesh structure.
  • Eliminates voxel stair-stepping artifacts.
  • Produces cleaner and more organic printable surfaces.

Hollow Shell Generation (C++)

  • Distance-transform-based shelling algorithm.
  • Automatically removes unnecessary internal volume.
  • Allows precise wall-thickness control in millimeters.
  • Reduces material consumption by up to 80%.

Auto-Scaling and Origin Normalization (C#)

  • Moves model coordinates to a normalized origin.
  • Prevents geometry placement far from slicer coordinates.
  • Automatically scales models to fit target printer build volumes.
  • Compatible with Bambu Lab, Prusa, Creality, and other FDM printers.

Real-Time Progress Reporting

  • Thread-safe unmanaged callback architecture.
  • Streams computation progress directly from the native C++ core to the WPF UI.
  • Provides responsive feedback during heavy processing.

Modern Revit User Experience

  • Dark-themed WPF interface.
  • Dedicated Revit 2027 Ribbon tab.
  • Custom commands and icons.
  • Integrated workflow inside Revit.

Architecture

┌─────────────────────────┐
│     Revit 2027 Model    │
└────────────┬────────────┘
             │
             ▼
┌─────────────────────────┐
│ Geometry Extraction &   │
│ Auto-Scaling Layer      │
│ (C# / Revit API)        │
└────────────┬────────────┘
             │
             ▼
┌─────────────────────────┐
│ P/Invoke Interop Layer  │
│ Memory Marshalling      │
└────────────┬────────────┘
             │
             ▼
┌─────────────────────────┐
│ Native C++ Core Engine  │
└──────┬──────────┬───────┘
       │          │
       ▼          ▼
┌────────────┐ ┌────────────────┐
│ Voxelizer  │ │ Flood-Fill BFS │
└──────┬─────┘ └───────┬────────┘
       │               │
       └───────┬───────┘
               ▼
┌─────────────────────────┐
│ Mesh Reconstruction     │
│ & Laplacian Smoothing   │
└────────────┬────────────┘
             │
             ▼
┌─────────────────────────┐
│ Binary STL Exporter     │
└─────────────────────────┘

Technology Stack

Layer Technology
BIM Integration Revit 2027 API
User Interface WPF (XAML)
Managed Layer C# .NET 10
Native Engine C++ (MSVC x64)
Interoperability P/Invoke
Output Format Binary STL

Installation

For End Users

  1. Download the latest release from the repository's Releases section.

  2. Extract the ZIP archive.

  3. Copy both:

    • BimToPrint.addin
    • BimToPrint/

    into:

%APPDATA%\Autodesk\Revit\Addins\2027
  1. Launch Revit 2027.
  2. Approve the security prompt by selecting Always Load.
  3. Open the BIMtoPrint tab from the Revit ribbon.

Building from Source

Prerequisites

  • Visual Studio 2022 (MSVC x64)
  • .NET 10 SDK
  • Revit 2027 SDK

Build Native Core

Open:

x64 Native Tools Command Prompt for VS

Run:

cl /LD core.cpp /Fe:core.dll

Build Revit Plugin

Navigate to the plugin directory:

cd RevitPlugin
dotnet build -c Release

Roadmap

  • GPU-accelerated voxelization
  • Adaptive octree resolution
  • Direct 3MF export
  • Mesh repair diagnostics
  • Multi-material support
  • Printability analysis
  • Automatic support generation

License

Licensed under the MIT License.

See the LICENSE file for details.


Author

Mohammad Amin Moradi

About

A high-performance C++ and C# watertight mesh engine and exporter for Autodesk Revit.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages