1 // File: GeomAlgoAPI_FaceBuilder.cpp
2 // Created: 23 Apr 2014
3 // Author: Mikhail PONIKAROV
5 #include <GeomAlgoAPI_FaceBuilder.h>
7 #include <BRepBuilderAPI_MakeFace.hxx>
8 #include <TopoDS_Face.hxx>
10 boost::shared_ptr<GeomAPI_Shape> GeomAlgoAPI_FaceBuilder::square(
11 boost::shared_ptr<GeomAPI_Pnt> theCenter, boost::shared_ptr<GeomAPI_Dir> theNormal,
14 const gp_Pnt& aCenter = theCenter->impl<gp_Pnt>();
15 const gp_Dir& aDir = theNormal->impl<gp_Dir>();
16 gp_Pln aPlane(aCenter, aDir);
17 // half of the size in each direction from the center
18 BRepBuilderAPI_MakeFace aFaceBuilder(aPlane,
19 -theSize / 2., theSize / 2., -theSize / 2., theSize / 2.);
20 boost::shared_ptr<GeomAPI_Shape> aRes(new GeomAPI_Shape);
21 aRes->setImpl(new TopoDS_Shape(aFaceBuilder.Face()));