Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

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

Maybe a Bug: when use BRepBuilderAPI_MakeFace to make a TopoDS_Face from a TopoDS_Wire
zhangzhigang824 2009/06/22 04:56
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<25; 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 2009/06/29 09:00
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 2009/06/29 09:30
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 2012/11/19 10:08
I also encountered with the same issue!
I'm using OCCT v6.5.3
any news regarding it?
Thanks
 
 
Latest news
  • Open CASCADE Technology 6.8.0 is available for download!
  • New features to enhance the development process
  • Open CASCADE Technology 6.7.1 is available for download!

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map