I used FreeCAD to model some stepper motor parts so that I can place them into a larger mechanical design.
The Part Design workbench lets me model basic solid parts. A single non-decomposable object like this 28BYJ-48 Stepper usually goes into a file as a single PartBody that I can reuse and instantiate in larger assemblies and in other files.
The intention of having a single solid part is that it can be used to carve out pockets within other solid structures
and that these pockets can be milled straight out of stock.
This makes it easy to create the appropriate mating surfaces for any static fixtures that need to have a rigid attachment
to the stepper.
One issue however is that a given part often has related “pocket” areas that define certain clearances around the part itself. For example, this stepper has a 5-wire cable that extends out of the top of the device. If I were to create a mechanical fixture to hold this stepper, there’s a chance that the fixture would obscure the port that the cable comes out of.
We will create a small ancillary PartBody that will assist with pocketing in any fixtures that may obscure the port. This PartBody will create a hole in the fixture so that the cable has room to weave through it.
In order to do this, we’ll create a new PartBody named Bore.
Now the sketch for the bore needs to be placed on the top of the squarish housing at the top of the stepper. We can’t access any of this geometry because all of it belongs to the Stepper PartBody. This is where ShapeBinder comes in.
To “share” the geometry from Stepper, simply activate the Bore PartBody by double-clicking it. Then use the ShapeBinder button in the Part Design workbench. You should be presented with a list control and some buttons that allow you to add and remove geometry from the ShapeBinder. Ensure that the Stepper PartBody is visible, and add the relevant geometry that you want to share with Bore to the list.
Here I’ve added the Stepper’s top face and its four edges to the list. Notice that the shared geometry goes yellow (for edges) and gold (for faces.)
Now make Bore the active PartBody and create a new Sketch for it. Just use any of the default planes to start, and start creating your basic shape. Don’t add constraints or detail yet, just give yourself a starting point. Leave the sketch editor and select the face from your ShapeBinder. You can now map a sketch to this face even though it’s from the other object.
The rest should be straightforward. You can simply pad this sketch to create a box. That box will become the object that you use to pocket out space for the cables in any fixture or assembly that you create using the stepper.
Here is the finished product, with transparency on the Bore object to indicate its purpose as a pocketing tool.
Remember that external geometry in a procedural object is subject to change. You will find that severe changes to the source of a ShapeBinder object will invalidate operations in the target PartBody that holds that ShapeBinder. As with any procedural modeling, use with caution.