|
As it is possibile to see, every csgShape is composed of an optional element complementation, a multiple choice and a relative position. The choice is between a primitive and an operation. As primitive we choose cylinder, cone, box and sphere, that is the ones implemented by Java3D. For every primitive we have some attributes which defines its dimensions. Width, height and depth of the box are named as the axis they are directed as (x,y,z). As default, the height of cone and cylinder is direct as the Y-axis, so we have called this attribute “y”. Of course, the attribute radius is called “radius”. The origin of the reference frame is placed in the center of the 3D primitive object. Every operation contains a sequence of object (at least two; only two in the case of difference) which can be as like as a new csgShape (a primitive, or also a result of another operation, translated depending on its system reference), reftlecting the ricursive nature of CSG. The relative position contains a translation and a rotation around axes. The first one to be computed is the rotation, so the translation have to be calculated with the new rotated system reference.
|