Partricia will visit her brother at Easter and see looks for a nice gift for her niece. Her niece loves building houses and will become architect when she grows. Lego bricks seem to be a nice idea. But these cannot be the right present because Partricia is a designer in and not a shopper. She wants to produce the bricks by herself with the help of her friends.
So first she has to design her bricks.
On the inner teeth the logo is a composite of a triangle and a rectangle. On the outer teeth there is only a rectangle. The tooth consists of a cylinder and a cone.
Triangle and Rectangle are done with Part Design and padded. Cylinder and Cone come from the Part Module.
The basis of the brick must be a cuboid which is hollow below so that the bricks become stackable. She builds it as the difference of two Part cubes.
The size of the cuboid and thickness of the wall must match the size and placement of the teeth so that bricks can get arranged to a stable wall.
After designing the first prototype she wants to play with the dimensioning to get handy forms. This is a time consuming process: When she has changed one part she has to adjust the others too. What she needs is a controller object, where all parameters can be located in one place and a simple to maintain function to bring the parameters of terms of the parameters to the target parts.
After some conversation with her friends she has gotten a small python module with such a controller engine. After installing the file she writes a short python script to initialize her controller.
The first lines import the library.
The next step for creating the controller is to give it a name and to say, which objects should be modified by the controller.
For every of these objects Partricia has to give a short name and to write the regular object name from the FreeCAD file. Meantime she has changed the objects labels but she still can remember the initial labels and so she writes them down.
Then she adds a list of parameter names with their current values from the cad-file.
The dependency description is a text files with a lot of equations.
The first three lines describe how the Sketch for the triangle must be modified.
There are 3 named constraints a,b, alpha in the sketch and there are three lines in the description file which relate to them.
For the rectangle there are two constraints b,c. The height of the pad can be modified with the global parameter h. This parameter places a role too in the height of the basic cuboid to get the bricks stackable.
cone and cylinder have one common radius. The other radius of the cone is 5 units larger then the b dimension of the triangle and the rectangle. So the logo has enough space on the top of the tooth.
Partricia can configure the size of the Draft array too.
At the end of the script she tests some extra functionality: How to add a dependency description or a new part or a new parameter. Maybe that she will extend her model next days.
After execution the script from the python console she has a new object and she can change the parameters in the property tab. Here the components are displayed with their labels instead of their generic names and can be changed easily
She can change the dependency description too - it's a multi line data field.
The gelo object controls most of the components. It can connect where ever it is useful: To sketches, to pad, to draft arrays and to generic parts. The Dependency graph demonstrates the position of this central configuration tool.