Scripted Parts: Ball Bearing - Part 1/ro

Introduction
Acest tutorial este conceput ca o introducere pentru începători în crearea de piese cu script Python în cadrul FreeCAD.

Acest tutorial descrie cum să construiți un rulment cu bile CSG-workflow.

Codul va produce un nou document FreeCAD cu 12 forme (Inel INterior, Inel exterior și 10 bile/sfere).

Va arăta astfel:



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

Just some small differences.


 * Create a new empty document and make it the active document
 * Insert Cylinder
 * Insert Cylinder
 * Do boolean cut to get basic shape of inner ring
 * Select all edges and apply a fillet
 * Insert torus
 * Move torus into position and do a boolean cut to create the groove for the balls
 * Repeat all steps for getting the shape for the outer ring
 * Insert first ball
 * Insert other balls using math to calculate the position of the balls
 * Set view to axometric
 * Zoom to fit all

Filleting edges
In part workbench using the GUI, you would select chamfers in the 3D view or in the menu for fillets and then apply the fillets.

Here we select all edges of a shape and apply fillets.

Therefore we need to select the edges BEFORE creating the groove.

Note
Acest tutorial folosește primitive și operații booleene, care pot fi consumatoare de performanță.

For doing a scripted part with revolved sketches have a look at the tutorial Scripted Parts: Ball Bearing - Part 2.

Links
Scripted objects: Pagina wiki explică elementele de bază ale scripting-ului

Topological data scripting: Un tutorial care acoperă elementele de bază ale scripturilor

Scripted Parts: Ball Bearing - Part 2: Doing it with sketches

Bearing Script 1: Base for this tutorial, thanks to JMG ...