Scripted Parts: Ball Bearing - Part 2

Introduction
This tutorial is meant as a beginner's introduction to creating parts with python scripts within FreeCAD.

This tutorial will cover how to build a ball bearing with a workflow that consists of creating sketches and revolving them.

The code will produce a new FreeCAD document with 12 shapes (Inner Ring, Outer Ring and 10 balls/spheres).

It will look like this:



Workflow
The workflow is more or less identical how you would create the part in part design workbench.

Just some small differences.


 * Create a new empty document and make it the active document
 * Draw the basic shape of the outer ring consisting of four straight lines and four arcs
 * Connect the lines and arcs and upgrade them to one single wire
 * Upgrade the wire to a face
 * Revolve the face to get a shape
 * Draw a circle
 * Upgrade circle to wire
 * Upgrade wire to face
 * Revolve face and apply boolean cut to obtain groove in outer ring
 * Draw the basic shape of the inner ring consisting of four straight lines and four arcs
 * Connect the lines and arcs and upgrade them to one single wire
 * Upgrade the wire to a face
 * Revolve the face to get a shape
 * Draw a circle
 * Upgrade circle to wire
 * Upgrade wire to face
 * Revolve face and apply boolean cut to obtain groove in inner ring
 * Insert balls with same workflow as in part 1 (because of effectiveness)
 * Set view to axometric
 * Zoom to fit all

Making the groove
Bla and blub ...

Links
Scripted objects: The wiki page explaing the basics of scripting

Topological data scripting: A tutorial for covering basics of scripting

Scripted Parts: Ball Bearing - Part 1: Doing it with part primitives

Bearings from scripted sketches: Base for this tutorial, thanks to JMG ...