Skip to content

Latest commit

 

History

51 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dalus - MEP Clash Detection System

Automated MEP (Mechanical, Electrical, Plumbing) system layout and clash detection for Grasshopper/Rhino.

Features

  • Multi-system layout generation with configurable parameters
  • 3D clash detection with priority-based resolution
  • Automatic bend generation to resolve conflicts
  • Room-based branch routing with intelligent path finding
  • Polygon centerline extraction using skeletonization algorithm for optimal routing paths

Project Structure

  • src/ - Core Python modules
    • main.py - Main entry point
    • clash_detector.py - 3D clash detection logic
    • system_item.py - System component definitions
    • rooms.py - Room and branch routing logic
    • row_builder.py - Row layout generation
    • system_definitions.py - System configuration
    • bbox_utils.py - Bounding box utilities
    • polygon_centerline.py - Polygon centerline extraction using skeletonization
  • gh_python_dev/ - Grasshopper integration
    • gh_loader.py - Loader script for Grasshopper
  • remote.gh - Grasshopper definition file
  • POLYGON_CENTERLINE.md - Detailed documentation for centerline function

Setup

  1. Clone the repository
  2. Update the path in gh_python_dev/gh_loader.py to match your local directory
  3. Open remote.gh in Grasshopper
  4. Run the Python component to execute the clash detection

Requirements

  • Python 3.x
  • Rhino 7+ with Grasshopper
  • Required Python packages:
    • numpy - For polygon centerline function
    • scikit-image - For skeletonization algorithm
    • scipy - For scientific computing
    • matplotlib - For polygon rasterization

Install dependencies:

pip install numpy scikit-image scipy matplotlib

Polygon Centerline Function

The repository includes a powerful polygon centerline extraction function that uses morphological skeletonization to find the medial axis of polygons. This is particularly useful for:

  • MEP Routing: Finding optimal paths through corridors and rooms
  • Path Planning: Generating centerlines for pipe/duct/cable routing
  • Spatial Analysis: Understanding room structure and topology

Quick Example

from src.polygon_centerline import polygon_centerline

# Define a corridor polygon
corridor = [(0, 0), (50, 0), (50, 3), (0, 3), (0, 0)]

# Calculate centerline
centerline = polygon_centerline(corridor, resolution=100)

# Result: list of (x, y) points along the centerline
print(f"Generated {len(centerline)} centerline points")

For detailed documentation, see POLYGON_CENTERLINE.md

To run examples:

python examples_polygon_centerline.py

To run tests:

python test_polygon_centerline.py

About

Dalus: automated MEP system layout and 3D clash detection for Rhino/Grasshopper (Python), plus a React Three Fiber web viewer

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages