[AI & Geometry] From Image to BIM: Building a 3-Stage "Self-Correcting" Workflow

 

How we stopped AI from writing bad code and taught it to generate geometry.

https://www.linkedin.com/pulse/geometry-image-to-geometry-workflow-dynamo-gemini-wonho-cho-4u3yc

Introduction: The Evolution of Image-to-Geometry Four years ago, we first tested automated modeling from images using simple edge detection. Today, we are pushing the boundaries further by integrating Generative AI (Gemini) to not just "trace" lines, but to understand and reconstruct geometric patterns.

In this post, I share the technical journey of developing a "3-Stage Decoupled Pipeline" that translates 2D images into parametric Dynamo geometry, and how we solved the chaos of AI-generated code.

1. The Failures: Why "AI Coding" Doesn't Work

  • Phase 1 (The 'AI Coder'): We initially asked AI to write Python code to draw the image and executed it blindly.

    • Result: Total system failure. A single syntax error crashed the entire script. AI is creative, but code requires strict precision.

  • Phase 2 (The Pivot to Data): We redefined AI's role from a 'Coder' to a 'Data Analyst.' Instead of code, we requested structured JSON data (coordinates, points).

    • Result: Stability. By removing the exec() function, we separated creative analysis from precise execution.

2. The Solution: A 3-Stage Decoupled Workflow To maximize stability and debugging, we broke the workflow into three distinct, expert nodes:

  • Stage 1: The AI Analyst (Image → Text)

    • Role: A 'Computational Geometry Expert' that analyzes the image and describes its geometric patterns in natural language using Gemini Pro.

  • Stage 2: The AI Translator (Text → JSON)

    • Role: A 'Data Structuring Expert' that converts the text description into a strictly formatted JSON blueprint. It is forbidden from seeing the image to prevent hallucinations.

  • Stage 3: The Dynamo Constructor (JSON → Geometry)

    • Role: A 'Builder' that parses the JSON and constructs actual Dynamo geometry (Points, Lines, NurbsCurves) using Python.

3. Advanced Tech: Fractal Engines & Self-Correction We are now testing a "Fractal Engine" where AI extracts the 'Design DNA' (generative rules) from a base unit image, and Python recursively grows the pattern.

  • The Self-Correcting Loop: If the AI's output causes an error (e.g., JSONDecodeError), the system automatically captures the error message and feeds it back to the AI, prompting it to "Fix your own mistake." This autonomous debugging loop dramatically increases success rates.

Conclusion: Autonomous Automation This project evolved from a simple experiment into a mature AI-Augmented Generative Design (AAGD) system. By decoupling the workflow and implementing self-correction, we've turned AI from a risky toy into a reliable partner for complex geometric tasks.



댓글

이 블로그의 인기 게시물

Geometry test 0506 stair and routing

Structural Analysis Workflow with Dynamo and Robot