Introduction
In mechanical assemblies with moving parts—such as gears, cams, and robotic mechanisms—it's crucial to design shapes that avoid collisions throughout their motion. Traditional methods often fix the geometry of one part and compute the maximal collision-free shape of the other. While effective, this limits design flexibility and may lead to suboptimal solutions.

The cylinder's path is predefined to remove material using the unsweep. Varying optimization weights produces a family of collision-free designs.
Our method introduces a co-generation approach, allowing both shapes to be designed simultaneously without predefining either geometry. This expands the design space and enables the discovery of more efficient and innovative solutions.

Co-generation of collision-free shapes for rotating about their centers with varying relative areas.
Measuring Collision
For each point on a shape, its path during motion is tracked. By determining how much of this path intersects with the other shape, we obtain a local collision measure. This measure indicates where and when collisions occur. Aggregating these local measures across the shape produces a global collision measure—a single value representing the total collision between the two shapes throughout their motion.
Collision is inherently tied to the relative motion of the shapes. By analyzing the motion paths of both shapes, potential collisions at different points in time can be predicted and addressed. Indicator functions help in this analysis by identifying whether a point is inside a shape or not, aiding in efficient calculation of collision measures.

Illustration of collision paths and global collision measure.
Optimization Framework
The optimization framework aims to maximize the combined volume (or other utility measures) of both shapes while ensuring they remain collision-free. The process includes:
- Objective Function: Maximize the total volume of both shapes to ensure they are as functional as possible.
- Constraints:
- Collision Avoidance: The global collision measure must be zero, meaning no collisions occur during motion.
- Volume Ratio Control: A parameter to control the relative sizes of the two shapes, allowing designers to prioritize based on specific needs.
- Iterative Optimization Process: Starting with initial shapes that may collide, calculate collision measures and iteratively adjust shapes to reduce and eliminate collisions while satisfying objectives.
Computational Implementation
Shapes are discretized into small elements (like voxels) for efficient calculation of collision measures across complex geometries. Precomputed matrices capture interactions between shape elements during motion, enabling rapid updates in each optimization iteration. Sensitivity analysis guides the algorithm by showing how small changes in shapes affect collision measures.

Computational workflow for collision calculation and optimization.
Applications
This method can automatically generate intricate, collision-free shapes for mechanical assemblies. Applications include:
- Cam and Follower Mechanisms: Designing cam profiles that maintain continuous contact with followers without collisions.
- 3D Cam: Creating a complex 3D cam profile that avoids collisions with follower mechanisms.
- Threaded Fasteners: Generating matching threads on bolts and nuts for smooth operation.

Prescribing the motion of a cam and follower and the initial collision field with the resulting geometries after optimization

Prescribing the motion of a 3d cam and follower

Threads appear when the prescribed motion is a screw motion