Introduction: How to Design a Bike Stem in Dreamcatcher
As of this writing, Dreamcatcher runs as a plugin for Maya, but a newer, browser based version is already in the works, so instead of going through the details of how to run the alpha version of the software, I'll cover the basic concepts of working with Dreamcatcher.
Designing a bike stem is usually done through intuition and stress testing. With Dreamcatcher, you can set the forces that you want the piece to withstand and have the genetic algorithm go through thousands of iterations to arrive at a solution.
Step 1: Set Your Ports
The first thing to do is to set your ports.
Ports are the shapes that you want DC to generate a form between. In the case of the bike stem, we want a steerer tube clamp and a handlebar clamp. Those are the ports.
Model these in your 3D modeling program of choice. I use Fusion 360.
Export all your ports as a single STL mesh file.
Step 2: Set Your Obstacles
DC wants to know where it shouldn't build geometry.
We want the stem to be confined to a region, so we add meshes everywhere we don't want DC to generate meshes. There's a cylinder for the steerer tube and the handlebars. There's also a larger cylinder right above the steerer to make room for the steerer cap. And an even larger cylinder below the steerer to create enough clearance to avoid the bike frame ( just in case). And finally, a large tube that confines the entire mesh so it can only build geometry within the tube.
You can have no obstacles. In the case of bike stem, if you set no obstacles, you might get something like the 3d printed stem above.
Step 3: More Obstacles
You'll likely go back and forth between testing a DC run and adding, adjusting, and removing obstacles to control the geometry that DC generates.
In the case of the bike stem, adding obstacles where the each screw goes makes for an easier time after the bike stem is printed, so all you need to do is tap the threads.
Once you have all your obstacles set, export all of them as a single STL mesh file.
Step 4: Import, Expand, Set Ports and Obstacles
Now in Dreamcatcher, import your ports and obstacles.
Through the user interface, label which of your meshes are ports and which are obstacles.
Step 5: Add Interfaces to Ports
Interfaces are the force vectors that are going to get applied to your ports when DC stress tests the geometry it generates.
Forces are applied to the entire mesh, not to individual faces or groups of faces, so keep that in mind when you create your ports. Each interface has XYX values for direction and Newtons for the force.
At least one of your ports needs to be a fixed port. In other words, something needs to be anchored.
In the case of the bike stem, the steerer clamps are fixed and interfaces are applied to the handlebar clamps.
I used 22000N of opposing vertical forces to simulate the force of a rider twisting the handlebars to counteract the pedaling of the bike. This is the biggest force on a stem and is at it's peak when a rider climbs a hill.
A second set of interfaces are applied to simulate the steering action of the bike. Since the wheel and fork usually move with the handlebars without much resistance, this force is relatively small. 800N of opposing forces (parallel to the ground plane) were applied to the handlebar clamps.
And finally, since the orientation of the stem is one sided. I added 1000N of downward force to account for when the bike hits bumps or lands off a jump.
Step 6: Global Parameters
In DC you have a few variables to tweak how the algorithm generates the mesh.
Max Iterations - This is how may resolved iterations you want the DC to solve
MU - This determines how much material gets removed from the mesh in each iterations (think of it like the size of the shovel, or the number of termites). -0.1 will remove more material than -.0001
Advection - This variable is still pretty mysterious to me, but as far as I understand it, It determines how viscous the marching cubes algorithm that flows through the voxels (max 100)
Load Resolution - This will greatly affect the time it takes to generate each mesh. Raise this as you get closer to generating your final mesh (max 1.0)
Voxel Resolution - The XYZ values determine how the bounding box of the mesh gets divided. So the larger value, the more divisions, which means higher resolution, and more time. (max 255)
Symmetry Planes - Often, you'll want a symmetry plane to keep your mesh symmetrical. It doesn't affect the time it takes to generate meshes. It simply mirrors one mesh across to the other after it completes an iteration.
Iterations - This the max number of iterations you want DC to generate before generating a mesh that satisfies the interfaces applied to the ports.
Once you've set all your global parameters, it's time to send start genetic algorithm.
Step 7: Magic
When the genetic algorithm is running, it will save an image and a stress image of each iteration as it converges toward an optimized form. You can keep an eye on these images to see how the iterations are progressing. The first 10-20 iterations should be dramatically different. If it's not, your MU value is probably too small. For example, if it's -.0004, try -.004.
You can stop it at any time, or copy and save the obj file of that iteration if you want to save the geometry and have the algorithm continue.
It's unlikely that the first run of DC will generate something you're happy with. So keep tweaking the numbers and try different things.
A few words of advice...
Tweak only one variable at a time
Keep your force resolution and voxel resolutions low until you're have the right MU value