Boolean subtraction.


Let's create a group by subtracting a torus from another one.


As sgCore is a solid modeling library the resulting Boolean operations objects are in no way connected with each other. They are grouped to return from the function. For the further work with each object separately you should take this group component parts.


The code of creating toruses and constructing objects from their subtraction looks as follows:


 sgCTorus* tor1 = sgCreateTorus(2,1 ,24,24);

 sgCTorus* tor2 = sgCreateTorus(2,0.8 ,24,24);

 SG_VECTOR transV1 = {1,1,0};









 SG_VECTOR transV2 = {-6.0,0,0};


 sgCGroup* bool1 = sgBoolean::Sub(*tor1, *tor2);








See also:

sgBoolean   sgBoolean::Sub

sgCGroup     sgCGroup::BreakGroup   sgCGroup::GetChildrenList

sgCObject::InitTempMatrix sgCMatrix::Translate   sgCObject::ApplyTempMatrix   SgCObject::DestroyTempMatrix   sgGetScene sgCScene::AttachObject   sgCObject::SetAttribute