Project Specification: Geometric Theory Inference Engine

Target Platform: Web / TensorFlow.js Goal: Semantic reconstruction of point clouds via evolutionary constraint discovery.

1. Abstract

Standard mesh reconstruction algorithms (Poisson, Ball-Pivoting) focus on surface topology—connecting dots to form a skin. This project aims for semantic reconstruction. It seeks to discover the underlying “blueprint” or “theory” that generates the point cloud. **Figure 1:** Contrast between standard surface reconstruction (fitting a skin) versus semantic reconstruction (discovering the underlying geometric blueprint).

The system inputs a raw point cloud and outputs a Minimally-Complex Geometric Model. This model consists of a Constructive Solid Geometry (CSG) hierarchy defined by geometric primitives and boolean operations. The system optimizes the parameters of these primitives (Control Points) to minimize the distance between the input cloud and the generated solid surface.

## 2. The Core Architecture

The model is treated as a structured Autoencoder where the latent space is an explicit geometric graph rather than a black-box vector.

2.1. The Data Flow

**Figure 2:** The system architecture. Unlike traditional autoencoders, the latent bottleneck is an explicit, interpretable geometric graph.

  1. Input ($\mathbf{P}_{obs}$): A point cloud tensor of shape $(N, 3)$.
  2. Latent Variables ($\mathbf{C}$): A set of parameters defining geometric primitives (e.g., center, radius, dimensions) within a CSG tree.
  3. Projection (Surface Evaluation): The mapping of control parameters to a solid surface.
    • The fitness is calculated as the sum of distances from each input point $\mathbf{p} \in \mathbf{P}_{obs}$ to the closest point on the generated solid surface $\mathbf{S}$.
  4. Constraints ($\mathbf{G}$): Boolean operations (Union, Intersection, Difference) combining primitives, plus geometric rules governing primitive parameters.

2.2. The Constraint Layers (The “Theory”)

The “Theory” is defined by the energy potential of the constraints. A valid theory has near-zero energy. The system supports the following differentiable constraint layers: **Figure 3:** Visualizing the library of differentiable geometric constraints used to define the "Theory."

  1. 2-Point Distance: $|c_i - c_j| = k$ (Defines rigid struts).
  2. 3-Point Angle: $\text{acos}(\frac{\vec{v}{ij} \cdot \vec{v}{kj}}{|\vec{v}{ij}| |\vec{v}{kj}|}) = \theta$ (Defines corners/hinges).
  3. 3-Point Line-to-Point: Distance from $c_k$ to line $\overline{c_i c_j}$ is $d$ (often $d=0$ for collinearity).
  4. 4-Point Equal-Length: $|c_i - c_j| = |c_k - c_l|$ (Symmetry/Parallelograms).
  5. 4-Point Torsion: The angle between the plane $ijk$ and plane $jkl$ is $\phi$.
  6. 4-Point Plane-to-Point: Distance from $c_l$ to plane defined by $c_i, c_j, c_k$ is $d$ (Coplanarity).

3. Hybrid Optimization Strategy

The system utilizes a Bilevel Optimization approach to solve the discrete combinatorial problem (Graph Topology) and the continuous parameter problem (Geometry) simultaneously. **Figure 4:** The Bilevel Optimization Strategy. The "Architect" (GA) modifies the graph structure, while the "Engineer" (Solver) optimizes the spatial coordinates for that structure.

### 3.1. Outer Loop: Evolutionary Algorithm (The Architect)

3.2. Inner Loop: Differentiable Solver (The Engineer)

4. Initialization Strategy: Volumetric Decision Trees

To avoid starting the evolutionary process from a completely random state, the system employs a Volumetric Decision Tree for seeding.

Mechanism:

  1. Space Partitioning: The bounding box of the point cloud is recursively subdivided.
  2. Primitive Fitting: At each node, the system attempts to fit available shape primitives (planes, spheres, cylinders) to the points contained within that volume.
  3. Rule Primitives: The decision boundaries are not just axis-aligned planes (like in standard Octrees/KD-trees) but can be defined by the shape primitives themselves.
  4. Tree-to-CSG Conversion: The resulting decision tree is converted into an initial CSG tree, which serves as the starting population for the Genetic Algorithm.

5. Implementation Plan: TensorFlow.js

Using TF.js allows for a “Live Lab” environment where the user can watch the theory evolve in real-time in the browser.

5.1. Technology Stack

5.2. Data Structures (JSON Schema)

A “Theory” can be serialized as:

1
2
3
4
5
6
7
8
9
{
  "controlPoints": 8,
  "constraints": [
    { "type": "distance", "indices": [0, 1], "value": 10.0 },
    { "type": "angle", "indices": [0, 1, 2], "value": 1.5707 },
    { "type": "coplanar", "indices": [0, 1, 2, 3], "value": 0.0 }
  ],
  "weights": "sparse_matrix_indices..."
}

5.3. Development Phases

Phase 1: The Solver (Inner Loop)

Phase 2: The Projector

Phase 3: The Evolution (Outer Loop)

Phase 4: Complexity & Curvature

6. Summary

This system moves beyond fitting data to understanding data. By forcing the reconstruction through a bottleneck of geometric logic, we generate models that are editable, parametric, and human-readable, turning raw scans into CAD-ready definitions.