I’m trying to accurately create an interactive 3d model of a physical item (a skateboard truck). The design is nearly there, but I’m having trouble “leveling” the wheel axis after a local adjustment. In real live you lean a skateboard, the wheels stay on the ground (?) and because of the angles and pivots involved, the axis turns. Lean left, steer left.

In 3d space modeling this isn’t quite so simple. I can tilt the board (a tiny increment) , but I’m having trouble wrapping my head around the whole level off the wheels and axle. I know that when a wheel /axle axis has a directional vector with Y value = zero, then its level.

Initial design was to just try a tiny increment, rotate the truck/axle/wheel combo, test for level. Pray things converge. Which, they don’t.

Current work in progress code…

And for reference: Here’s what a production truck looks like.

The model is intended to show the effects of different tilt angles and rake values on performance.

My question here involve improving the code for the hanger / axle leveling. Right now its really poor code with lots of iterations in a for loop, test for approximately level then `break`

, ugh. Not really good coding technique.

– converge / diverge algorithm? Take initial big rotation steps, watch results, intentionally overshoot, reduce increment size, reverse direction, try again?

– In the alternative, look at existing interim axle position, attempt to calculate the rotation required to make it level (conceptually this is really difficult as the axis of hanger rotation is changing in 3d space)

Other opportunities for improvement? Many thanks,