For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Maybe a Bug: when use BRepBuilderAPI_MakeFace to make a TopoDS_Face from a TopoDS_Wire

zhangzhigang824's picture
Forums: 

Hi everyone,

I use the followed code to make a AIS_Shape and display it.

Standard_Real myData[25][3] = {
{10.671875, 5.500000, 300},
{15.234375, 8.703125, 300},
{19.953125, 15.250000, 300},
{21.328125, 24.390625, 300},
{21.031250, 38.562500, 300},
{23.156250, 37.187500, 300},
{28.796875, 37.187500, 300},
{30.015625, 38.562500, 300},
{32.296875, 36.734375, 300},
{31.078125, 35.812500, 300},
{31.078125, 8.390625, 300},
{33.828125, 8.390625, 300},
{34.734375, 8.703125, 300},
{35.187500, 12.359375, 300},
{35.953125, 11.890625, 300},
{36.406250, 9.000000, 300},
{37.484375, 8.703125, 300},
{36.406250, 6.718750, 300},
{28.953125, 6.718750, 300},
{28.953125, 36.265625, 300},
{23.312500, 36.265625, 300},
{23.468750, 23.171875, 300},
{21.781250, 14.187500, 300},
{15.546875, 7.171875, 300},
{11.125000, 5.046875, 300}
};
BRepBuilderAPI_MakePolygon myPolygon;
for (int i=0; i {
gp_Pnt pnt(myData[i][0],myData[i][1],myData[i][2]);
myPolygon.Add(pnt);
}
myPolygon.Close();
TopoDS_Wire myWire = myPolygon.Wire();
TopoDS_Face myFace = BRepBuilderAPI_MakeFace(myWire);
Handle(AIS_Shape) aAISShape = new AIS_Shape(myFace);
m_hContext->Display(aAISShape);

The shape can be displayed, but it is so surprising, because it is not what we we expected for. I am sure the data is correct. Curiously, the TopoDS_Wire is displayed all right. I think this is a bug of OpenCasCade.

who can give me some advice?
Thanks in advance.

Yaron's picture

I also encountered with the same issue!
I'm using OCCT v6.5.3
any news regarding it?
Thanks

Forum supervisor's picture

Dear zhangzhigang824,
From your post is not clear which result is expected by you and what is really wrong.
At least the result got by me looks acceptable.
See the attached picture (face and wire).
Both shape are valid.
Regards