This example generates the surface figure "olimpic rings" that consists of toruses 
    
#include <CoreAPI.h>
 
#define OUT_RADIUS 50
#define SEC_RADIUS 5
#define N 5
 
                               coat::vec3(OUT_RADIUS+OUT_RADIUS/8,-OUT_RADIUS,0),
 
                               coat::vec3(3*OUT_RADIUS+3*OUT_RADIUS/8,-OUT_RADIUS,0)};
 
EXPORT
int main() {
    
    
    auto volume = current.
Volume();
 
    
    volume.toSurface();
    float ringRadius = OUT_RADIUS;
    float crossSectionRadius = SEC_RADIUS;
    float rotate = 90;
    
    torus.rings(16).slices(64);
    
    
    for(int i = 0; i < N; i++) {
        matrix.SetTranslation(cpoints[i]);
        torus.transform(matrix).add(volume);
    }
    return 0;
}
SceneElement addChild(const char *name) const
add the child element of the same nature
 
static SceneElement sculptRoot()
get the root of all sculpt objects
 
The torus.
Definition CorePrimAPI.h:480
 
static void toRoom(const char *name, bool Force=false)
switch to the room
 
comms::cVec3 vec3
3D - float vector, see the cVec3
Definition CoreAPI.h:50
 
comms::cMat4 mat4
4x4 float matrix, see the cMat4
Definition CoreAPI.h:59