How are 3d files generated?

Ah! That’s a good question. So how are the 3D models published on iteration3d.fr actually generated?

build123d as the core engine

On iteration3d.fr, the main 3D file generation engine is based on the tool build123d.

It is an open-source Python program for parametric modeling. This framework is built on the Open Cascade geometry kernel. build123d can be considered an evolution of CadQuery.

What is parametric modeling?

When using Fusion360 or SketchUp, you're used to drawing a "sketch" with a mouse or stylus and then extruding it to obtain a 3D volume. The approach to creating a volume with parametric modeling is completely different. Instead of "drawing in 3D", you code in 3D.

OpenSCAD is a program based on this principle and serves as an accessible entry point to parametric modeling. To put it simply, each "shape" is declared programmatically. In OpenSCAD, the instruction cube([10, 10, 10]) will generate a cube (as you’ve guessed) of 10x10x10. Easy, right? Create another cube, move it with another command, and gradually your program creates a new 3D object.

build123d follows the same principle, in a more complete and therefore more complex way — or maybe not. The build123d documentation even includes a transition tutorial from OpenSCAD.

The power of Python in build123d

The main strength of build123d lies in its full use of the powerful Python programming language. We'll stop here, as the goal of this page is educational, but developers will see the potential of this coding language when applied to parametric modeling.

As an example, the following build123d code will produce a rectangular prism measuring 100 x 42 x 57 mm (Model #768):


with BuildPart() as thisObject:
    Box(100, 42, 57)
            
rectangular prism build123d 100x42x57
Build123d rectangular prism example

Of course, there’s a whole set of instructions to move, merge, subtract, and more. This allows you to generate very complex 3D shapes — and more importantly, to do so in a parametric way, meaning the model is easily modifiable by simply adjusting the variables you've defined.

Curious and want to dive deeper? Here are two links to explore build123d further:

And to conclude: thank you build123d, thank you CadQuery, thank you Python!