Kinematic Voxel Carving: A Framework for Procedural Mechanism Synthesis
1. Abstract
This document outlines a computational framework for generating 3D mechanical linkages—specifically gears and kinematic couplings—using Voxel-Based Topology Optimization. Unlike traditional CAD methods that rely on analytical geometry (e.g., involute curves), this system “discovers” optimal mechanical shapes by simulating the kinematic constraints of rotating or moving bodies within a discretized voxel grid.
By defining the motion paths and bounding volumes of two or more bodies, the system iteratively solves for a configuration where bodies maximize their volume without violating spatial constraints. This approach enables the creation of non-standard gears, print-in-place locking mechanisms, and complex organic linkages that are mathematically difficult to describe but physically functional.
2. Core Philosophy
The central thesis of this engine is Kinematic Subtraction over Time combined with Cellular Automata (CA) Smoothing.
- Implicit Definition: We do not draw teeth. We define motion and volume. The teeth are the emergent result of these definitions.
- Resolution Agnostic: The physics are solved at a coarse level first. High-fidelity details are only calculated where necessary (at the interface surfaces).
- Structural Emergence: Connectivity and structural integrity are enforced via local neighbor rules (CA), preventing “floating islands” of geometry.
3. System Architecture
3.1. The Body Definition
A “Body” is a container for a voxel grid and its kinematic properties.
- Extent (Bounding Volume): The maximum possible shape of the object (e.g., a cylinder, a cone, a torus, or an arbitrary mesh).
- Kinematic Frame: A function $T(t)$ that returns a $4\times4$ transformation matrix (Rotation + Translation) for any given time $t$.
- Symmetry Constraints: Rules defining required repetition (e.g., “Radial Symmetry: 8” implies that if voxel $V$ exists, $V_{rotated}$ must also exist).
3.2. The Voxel Grid
Instead of a Cartesian grid or Octree, the system utilizes a Cylindrical Voxel Grid optimized for rotational bodies.
- Geometry: Voxels are defined in cylindrical coordinates $(r, \theta, z)$. Each voxel is a “slice of cake” (a frustum of a sector) defined by a range for radius $r$, angle $\theta$, and height $z$.
- State: Each voxel holds a state:
SOLID,EMPTY, orUNKNOWN(during solving). - Metadata: Each voxel may store
FitnessScoreorConstraintViolationCount.
4. The Solver Engine
The solver operates in a loop of Constraint Application and Volume Optimization.
4.1. The Constraint Matrix
The fundamental rule is: Two bodies cannot occupy the same point in World Space at the same time $t$.
Let $V_A$ be a voxel in Body A and $V_B$ be a voxel in Body B. For a full rotation cycle $t \in [0, 360^\circ]$:
- Transform $V_A$ to World Space: $P_{world} = T_A(t) \cdot V_A$.
- Transform $P_{world}$ into Body B’s local space: $P_B = T_B(t)^{-1} \cdot P_{world}$.
- If $P_B$ lands inside a voxel coordinate currently marked
SOLIDin Body B, a Constraint Violation is recorded.
4.2. Optimization Strategy (Maximally-Filled)
We do not simply subtract B from A. We want both to be as large as possible to ensure strength.
- Heuristic: If a collision occurs, which voxel do we delete?
- The “Center of Mass” Bias: Voxels closer to the kinematic axis of their respective body are weighted higher. We prefer to delete voxels at the periphery (teeth tips) rather than the core (hub).
- Symmetry Enforcement: If we delete voxel $V$, we must immediately delete all its symmetric counterparts to maintain balance.
4.3. Handling Locking and Interference
- Standard Gears: The solver removes all collisions, resulting in smooth running.
- Locking Mechanisms: If the user desires a lock (e.g., a ratchet), the kinematic definition includes a “Stop” phase. The solver will carve geometry that permits rotation up to a point, then physically collides (locks) because no valid subtraction exists to allow further movement without destroying the core volume.
5. Iterative Resolution & Refinement
To make this computationally feasible, we use a Multigrid Approach.
Phase 1: Coarse Solve
- Grid Size: Low (e.g., $32^3$ voxels).
- Action: Solve the kinematic constraints.
- Result: Blocky, Minecraft-like gears that roughly mesh.
Phase 2: Boundary Detection
- Identify Surface Voxels: Any
SOLIDvoxel adjacent to anEMPTYvoxel. - Identify Interaction Zones: Any voxel in Body A that comes within distance $D$ of Body B during the rotation cycle.
- Optimization: We only care about these zones. The internal volume of the gear is static.
Phase 3: Sub-division (Refinement)
- Subdivide the Surface Voxels into $2 \times 2 \times 2$ smaller voxels.
- Re-run the Constraint Solver only on these new smaller voxels.
- Repeat this process until the desired physical resolution (e.g., 0.1mm for 3D printing) is reached.
6. Cellular Automata (CA) & Structural Integrity
Raw kinematic subtraction often leaves “floating islands” (debris) or impossibly thin connections. We solve this using Voxel Neighborhood Fitness Functions akin to Cellular Automata rules.
The “Life” Rules for Mechanical Voxels: After every constraint pass, run a CA simulation:
- The Island Rule: If a voxel has 0 neighbors, it dies (becomes
EMPTY). - The Strut Rule: If a voxel has only 1 neighbor, it is structurally weak. It either dies (pruning) or triggers a “growth” event to connect to a nearby solid (reinforcement), depending on user settings.
- The Smoothing Rule: If an
EMPTYvoxel is surrounded by $\ge 6$SOLIDneighbors, it becomesSOLID(filling internal voids). - The Axis Anchor: Voxels touching the central rotation axis are immutable (infinite fitness). Connectivity is traced from the axis outward. Any voxel not connected to the axis via a chain of neighbors is culled.
7. Potential Applications
This engine allows for the generation of mechanisms that are difficult to design in CAD:
- Non-Parallel Axis Gears:
- Simply define Axis A as vertical and Axis B as tilted $45^\circ$. The solver will naturally carve Hypoid or Bevel geometries without the user needing to know the complex math.
- Variable Ratio Gears:
- Define the rotation speed of Body A as constant, and Body B as a sine wave. The system will generate Non-Circular Gears (elliptical/nautilus gears).
- Print-in-Place Assemblies:
- Define a “gap tolerance” (e.g., 2 voxels). The solver ensures that even at the tightest mesh point, there is a physical gap, allowing the mechanism to be printed pre-assembled and fused, then broken free.
- Internal/Cavity Gears:
- Body A is a sphere, Body B is a star shape inside it. The system generates a 3D internal track mechanism.
8. Implementation Roadmap
Step 1: The Data Structure
- Implement a cylindrical voxel grid class.
- Implement basic geometric primitives (Cylinder, Cube) to populate the grid.
Step 2: The Kinematic Loop
- Implement the “Time Step” loop.
- Implement Matrix transformations for voxels.
- Create a visualizer (Point cloud or basic mesh) to debug the “Swept Volume.”
Step 3: The Constraint Solver (Coarse)
- Implement the collision detection logic.
- Implement the “Delete” logic (Boolean subtraction).
- Implement Symmetry mirroring.
Step 4: The CA Post-Processor
- Implement the “Flood Fill” algorithm to detect disconnected islands.
- Implement the neighbor-count pruning rules.
Step 5: Refinement & Meshing
- Implement the Cylindrical subdivision for boundary voxels (splitting $r, \theta, z$).
- Implement Dual Contouring or Marching Cubes to convert the final voxel state into an STL/OBJ file.
- Add Laplacian Smoothing to the final mesh to remove “voxel stepping” artifacts.
9. Conclusion
This document describes a generative design engine that trades analytical precision for simulation-based robustness. By treating mechanical design as a space-time constraint problem, we can automate the creation of complex, functional, and novel mechanisms ready for digital fabrication.
