Invalid Cube created

Hi All,
I am trying to do a very simple thing: create a Solid Cube. Having created this I try to do some Analysis on it. So, I go through its faces and foreach face through all its wires (it is 1 in this case) and foreach wire I try to check a few things.

To my utter shock the method
saw.CheckConnected()
returns true -- which basically means that the wire is not connected.

obviously there is somthing wrong that I am doing, can somebody please help me out.
I have spent enough time on this.

----------- THE CODE ---------

// create a solid bounding box covering all of the 3d space
BRepPrimAPI_MakeBox outerBox(gp_Pnt(-10000, -10000, -10000), gp_Pnt(10000, 10000, 10000));
//AnalyzeSolid(recordShape(outerBox.Solid()), 0, true);

for (TopExp_Explorer faceIter(outerBox.Solid(), TopAbs_FACE);
faceIter.More();
faceIter.Next())
{
const TopoDS_Face& aFace = TopoDS::Face(faceIter.Current());

for (TopExp_Explorer wireIter(aFace, TopAbs_WIRE);
wireIter.More();
wireIter.Next())
{
const TopoDS_Wire& aWire = TopoDS::Wire(wireIter.Current());
double precision = 1e-04;
ShapeAnalysis_Wire saw(aWire, aFace, precision);
if (saw.CheckOrder())
{
throw gcnew Exception("Wire not ordered properly");
}
}
}

Thanks for the patience to read this through. Your help is very much appriciated.

Kapil's picture

I meant saw.CheckOrder() instead of saw.CheckConnected() --> this basically means that the wire is not properly ordered.

Sharad Verma's picture

Try this.

ShapeAnalysis_Wire saw(aWire, aFace, precision);

saw.Perform(); // Only this line is added by me

if (saw.CheckOrder())
{
throw gcnew Exception("Wire not ordered properly");
}

Kapil's picture

Hey Sharad, thanks for replying.

But I am not sure why should that help - Perform() does a bunch of checks one of them being CheckOrder(). The whole point is that CheckOrder should not return true whereas it is returing true.