jianbaoxia
CAD master
Hi I'm JianBaoXia.
TopoDS::Face() is a function I usually used.
Today, I used it as before, however, it raise error.
I have no idea why it occurs.
There is my simply demo:
TopoDS::Face() is a function I usually used.
Today, I used it as before, however, it raise error.
I have no idea why it occurs.
There is my simply demo:
Code:
//
#include <BRepPrimAPI_MakeCylinder.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
//
#include <BRepAlgoAPI_Common.hxx>
//
#include <gp_Pln.hxx>
//
#include <TopoDS.hxx>
#include <TopExp_Explorer.hxx>
//
#include <ShapeAnalysis.hxx>
//
#include <STEPControl_Writer.hxx>
#include <Interface_Static.hxx>
int main()
{
TopoDS_Shape cylinder = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), 5, 10);
gp_Pln pln(gp_Pnt(0, 0, 5), gp_Dir(0, 0, 1));
TopoDS_Face aPlane = BRepBuilderAPI_MakeFace(pln);
TopoDS_Shape com = BRepAlgoAPI_Common(cylinder, aPlane);
TopoDS_Face comFace = TopoDS::Face(com); // error occurs cause this code
return 0;
}