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.

Thanks in advance!

Kazumasa Uno's picture

Hello zhangzhigang824

I try your code, and It is certain that the result is strange.

http://www.fisco21.com/img/OCC/20090629.jpg

I found that If reverse the direction of defining vertex as follows,

> gp_Pnt pnt(myData[24-i][0],myData[24-i][1],myData[24-i][2]);

It display the correct results.

zhangzhigang824's picture

Hi Kazumasa,

firstly, Thank you very much for you reply!
I have the same result with you, when I take you advise to change the direction of defining vertex, the result is right. I don't the reason, can you tell me?

In fact I have extracted much geometric data from many fonts, and I want to display them in 3D space. I also doubt that changing the direction of defining vertex may be not right in other fonts and characters.

Thank you again!

Yaron's picture

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