Technical Specification: The Parametric Manifold Solver
1. Executive Summary
The Parametric Manifold Solver (PMS) is a numerical geometry engine designed to resolve hyperdimensional constraints into analytical coordinates. Unlike traditional CAD kernels (Parasolid, ACIS) which solve for a single geometric instance, PMS solves for the topology of the solution space (the manifold).
The system is architected to be driven by AI agents via structured, deterministic languages (JSON/TypeScript). It utilizes a custom numerical solver to minimize constraint error functions in arbitrary dimensions ($N$-D), employing a space-filling density estimation tree to map the entire cloud of valid geometric configurations.
2. Core Philosophy & Architecture
2.1. The “Cloud” vs. The “Instance”
Traditional solvers treat degrees of freedom (DOFs) as variables to be fixed immediately. PMS treats DOFs as dimensions in a probability space.
- Input: A set of entities and a set of Euclidean-like constraints.
- Output: A discrete representation (cloud/tree) of the valid configuration space where the total constraint error $E \approx 0$.
2.2. Arbitrary Dimensionality
The engine makes no assumption of $R^2$ or $R^3$.
- A 2D linkage mechanism may be solved in $R^2$.
- A 4-bar linkage optimizing over time may be solved in $R^{2+T}$ (spatial + temporal dimensions).
- A complex hyper-structure may exist in $R^{42}$.
2.3. Constructive Resolution
The system uses Internal Metrics (relative constraints) to define geometry. Absolute coordinates are derived, not defined.
- Anchoring: To resolve the manifold into Cartesian coordinates, the solver applies minimal priors (e.g., Entity $A$ is at Origin; Entity $B$ lies on the primary axis) to eliminate rigid body transformations, unless those transformations are part of the desired solution set.
3. Interface Specification (API)
The API is designed for LLM Generation. It favors strict syntax (brackets, types) over whitespace-sensitivity to ensure parsing reliability.
3.1. Language Choice
The primary interface definition is JSON (for data interchange) or TypeScript (for programmatic definition), avoiding Python to ensure strict typing and structural clarity.
3.2. Schema Definition (TypeScript Syntax)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
type Scalar = number; // Can be a fixed number or a variable ID
type VectorID = string;
interface Model {
dimensions: number; // e.g., 2, 3, or N
variables: {
[id: string]: { min?: number; max?: number; initial?: number }
};
entities: {
[id: VectorID]: { type: "point" | "vector" | "hyper-sphere" }
};
constraints: Constraint[];
objectives: Objective[];
}
type Constraint =
| { type: "distance"; a: VectorID; b: VectorID; value: Scalar }
| { type: "orthogonal"; a: VectorID; b: VectorID }
| { type: "incidence"; a: VectorID; b: VectorID } // Point on line/plane
| { type: "symmetry"; a: VectorID; b: VectorID; axis: VectorID };
type Objective =
| { type: "minimize"; variable: string }
| { type: "maximize"; variable: string }
| { type: "target"; variable: string; value: number };
3.3. Example Payload (JSON)
A simple triangle where one side length is variable.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"dimensions": 2,
"variables": {
"len_A": { "min": 5.0, "max": 15.0 }
},
"entities": {
"p1": { "type": "point" },
"p2": { "type": "point" },
"p3": { "type": "point" }
},
"constraints": [
{ "type": "distance", "a": "p1", "b": "p2", "value": 10.0 },
{ "type": "distance", "a": "p2", "b": "p3", "value": 10.0 },
{ "type": "distance", "a": "p3", "b": "p1", "value": "len_A" }
]
}
4. The Numerical Solver Engine
The solver is a custom implementation focusing on Energy Minimization. It does not rely on heavy tensor libraries (like TensorFlow/PyTorch) but implements specific linear algebra routines for performance and portability.
4.1. The Energy Function
The system converts all constraints into an error function $E$. For a system state vector $\mathbf{X}$: \(E(\mathbf{X}) = \sum_{i} w_i \cdot (C_i(\mathbf{X}))^2\) Where $C_i$ is the residual of constraint $i$ (e.g., $|dist(A,B) - target|$).
4.2. Solver Strategy
- Initialization: Random seeding within variable bounds or heuristic placement based on graph topology.
- Iterative Descent:
- Use Newton-Raphson for rapid convergence when close to a solution.
- Use Levenberg-Marquardt (Damped Least Squares) for stability when the system is ill-conditioned.
- Anchoring: The solver automatically fixes the first $N$ degrees of freedom to prevent the system from “floating” in hyper-space, unless the user explicitly requests rigid-body exploration.
5. Manifold Exploration: The Density Estimation Tree
To generate the “Cloud” of solutions, we reject simple Monte Carlo “surfing” in favor of a deterministic spatial decomposition method. This ensures we find all disconnected clusters of valid solutions.
5.1. The Algorithm: Hyper-Octree Decomposition
- Bounding Box: Define the hyper-rectangle of the total parameter space (based on variable min/max).
- Subdivision: Recursively split the space into $2^N$ sub-regions (nodes).
- Pruning (Interval Arithmetic):
- For each node, calculate the minimum possible error within that volume using Interval Arithmetic or Lipschitz bounds.
- If $MinError > \epsilon$, the entire node is invalid. Prune it.
- If $MinError \le \epsilon$, subdivide further.
- Leaf Nodes: When nodes reach a minimum size, the center points constitute the Point Cloud of valid solutions.
5.2. Output Analysis
The resulting tree structure allows for immediate topological analysis:
- Connectivity: Are all leaf nodes connected neighbors? If not, the solution space has multiple disconnected modes (e.g., an elbow joint that can snap ‘up’ or ‘down’ but cannot transition between them).
- Dimensionality: PCA on the local cloud reveals the effective degrees of freedom at any point.
6. Temporal & Trajectory Resolution
To handle “optimization over time” or “range of transformations,” the system treats time as a spatial dimension or parameterizes the path.
6.1. Fourier Series Parameterization
Instead of solving for a discrete set of points $P_t$, we solve for the coefficients of a continuous function. A coordinate $x$ is represented as: \(x(t) = a_0 + \sum_{n=1}^{K} (a_n \cos(nt) + b_n \sin(nt))\)
- The Variables: The solver optimizes the coefficients $a_n, b_n$.
- The Constraints: Constraints are integrated over the domain $t \in [0, 1]$.
- Example: “Distance between A and B must be constant over time.”
- $\int_0^1 (dist(A(t), B(t)) - L)^2 dt < \epsilon$
- Result: The output is not a static shape, but a mathematically defined mechanism trajectory that satisfies all constraints throughout the motion.
7. Implementation Roadmap
- Phase 1: The Kernel (C++/Rust)
- Implementation of the $N$-dimensional vector math struct.
- Implementation of the Constraint $\to$ Error function logic.
- Basic Newton-Raphson solver.
- Phase 2: The Explorer
- Implementation of the Hyper-Octree / Density Tree.
- Interval arithmetic integration for pruning.
- Phase 3: The API & AI Layer
- JSON/TypeScript parser.
- Standardized output format for the Point Cloud (e.g., PLY or custom JSON).
- Phase 4: Temporal Extensions
- Fourier series basis functions added to the variable definitions.
