CollisionDection

Hello everyone,

bool CollisionDection(TopoDS_Shape& aShape, TopoDS_Shape& bShape) 
{
    // Obtain the shapes for conversion
    TopoDS_Shape aShape1, aShape2;
    // Create the API class instance
    Handle(ColDetectionProxy_Intersector) aTool = new ColDetectionProxy_Intersector();
    // Load the shapes for detection
    aTool->LoadTShape(aShape1);
    aTool->LoadTShape(aShape2);
    // Set mode for meshing
    aTool->SetMeshingMode(ColDetectionBase_MeshingMode_Exact);
    // Set meshing deflection
    aTool->SetDeflection(1.e-2);
    // Perform the proximity detection
    ColDetectionProxy_Result aResult1;
    ColDetectionProxy_Result aResult2;
    aTool->Perform(aShape1, aShape2, aResult1, aResult2);    
    // Check for detection result
    printMessage(aResult1.IsFound());
    return aResult1.IsFound();
}

In any case ,it return a value of 0,so what is the problem of the function?

Thanks.

TIAN DAJIANG's picture

why i do not have this clas ColDetectionProxy_Intersector?

Kirill Gavrilov's picture

Collision detection component is not part of open source OCCT framework, it is a commercial extension - see related page.

TIAN DAJIANG's picture

thanks