아래는 OCC에 들어 있는 예제중의 하나 입니다.
TopoDS_Edge E1 = BRepBuilderAPI_MakeEdge(gp_Pnt(0.,0.,0.), gp_Pnt(50.,0.,0.)); TopoDS_Edge E2 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,0.,0.), gp_Pnt(50.,50.,0.)); TopoDS_Edge E3 = BRepBuilderAPI_MakeEdge(gp_Pnt(50.,50.,0.), gp_Pnt(0.,0.,0.)); TopoDS_Wire W = BRepBuilderAPI_MakeWire(E1,E2,E3); gp_Ax1 axe = gp_Ax1(gp_Pnt(0.,0.,30.),gp_Dir(0.,1.,0.)); ///Handle(Geom_Axis1Placement) Gax3 = new Geom_Axis1Placement(axe); /// i don't know why below code raises error ///Handle (AIS_Axis) ax3 = new AIS_Axis(Gax3); ///m_hAISContext->Display(ax3,Standard_False); TopoDS_Shape S3 = BRepPrimAPI_MakeRevol(W , axe , 210.*PI180); Handle(AIS_Shape) ais5 = new AIS_Shape(W); m_hAISContext->Display(ais5,Standard_True); Handle(AIS_Shape) ais6 = new AIS_Shape(S3); m_hAISContext->SetColor(ais6,Quantity_NOC_GREEN,Standard_False); m_hAISContext->SetMaterial(ais6,Graphic3d_NOM_PLASTIC,Standard_False); m_hAISContext->Display(ais6,Standard_True);
댓글
댓글 쓰기