-
Mechanical cam slot rotation – calculating pointOnPath distance to null point?
Hey guys,
I’m wondering if it’s possible to use the function “pointOnPath” to find the point along a path that is closest to a specific null.
My ultimate goal is to rotate a “cam-slotted plate” in such a way that the cam pin always stays within the slot inside the plate.
(See photos below for a visual guide.)Rotated input lever (cam pin) by -25 degrees

The yellow null is parented to the “cam pin” (upper brown circle).
The green path is the path within the slot that the pin should move along.
The blue null is the pointOnPath – point along the green path.The idea is to create a function that will rotate the slotted plate by the degrees required where the distance between yellow null and blue null will be (almost) zero.
The range of motion for the plate is physically limited to 0 through approx -36. It stays stationary at 0 degrees when the cam pin rotates in the positive direction, due to the slot shape.
I believe this may be possible by iterating through the possible rotations (0 to -36) while constantly checking for the distance between yellow null and approx 100 possible positions for the blue null? and when the distance is close to 0, use that rotation amount. I’m just not experienced in writing functions from scratch..
Any help is much appreciated!
Thank you
