KPovModeler 0.2

Written by Olivier Saraja (olivier_at_linuxgraphic.org)
English version

Modelling a screwdriver using CSG

In this tutorial, we will see how to model a screwdriver using CSG (Constructive Solid Geometry). The process is quite straightforward, and uses Boolean logics. This mean rigor and basic knowledge in order to get the proper result. Fortunately, the Object Tree will help us getting the right result. But here we go for a little explanation on Boolean operations first.

A few words on the Boolean operations

Kpovmodeler make use of four kind of Boolean operations during the modeling stage. Union, Intersection, Difference and Merge. Let's study how these operands work when two (or more!) overlaping volumes are involved:

Union and Merge:

These two cases seem to behave the same way: the two objects look as glued altogether (as on the previous picture that involves no Boolean). But in fact, there are slight differences between the two results, that can be easily seen if you give the same texture -with some transparency- to the two objects (let's say a Pigment Solid Color with a Filter value set to around 0.4).

In fact, Union merely glues two objects altogether and keeps the frontiers of each, while Merge considers only the frontier of the overall object. This is why the overlap volume of the two objects is showed on the Union picture, and not on the Merge picture. As a first thought, the difference between Union and Merge becomes relevant only when you deal with transparent materials.

A common question could be « Why should I bother using Union or Merge when I could get the same look on my rendering without using any CSG? » Let's face it, you're certainly right: upon rendering (unless you make use of semi-transparent materials) you won't see a difference. It's more in the way you deal with objects after a Merge or Union operation that you'd find a difference. When multiple objects are involved, you can rotate, translate, resize, assign a material and much more to all the involved objects at once if you used Boolean first. If you didn't, then you'll have to apply all the transformations on a one-for-one basis for EACH object involved! But hey, it's your time and your business!

Intersection:

The result of an Intersection operation is quite easy to understand: The resulting volume is equal to the overlaping volume of the two objects.

Difference:

The order in which the objects are described in the Object Tree (reading from top to bottom) particularly matters in this case: Box then Sphere reads as a boolean « substract Sphere volume from the Box volume » operation. Of course, Sphere then Box reads as a boolean « substract Box volume from the Sphere volume » operation.