- const gp_Dir& aNormal = aPlane->Pln().Axis().Direction();
- if (isFirstNorm) {
- aShapeNormal = aNormal;
- isFirstNorm = false;
- } else if (!aShapeNormal.IsEqual(aNormal, tolerance)) // non-planar shapes is not supported for extrusion yet
- return boost::shared_ptr<GeomAPI_Shape>();
- aBuilder.Add(aFaces, aFace);
+ BRepPrimAPI_MakePrism* aBuilder = new BRepPrimAPI_MakePrism(aBasis, aVec);
+ if(aBuilder) {
+ setImpl(aBuilder);
+ myDone = aBuilder->IsDone() == Standard_True;
+ if (myDone) {
+ TopoDS_Shape aResult;
+ if(aBuilder->Shape().ShapeType() == TopAbs_COMPOUND)
+ aResult = GeomAlgoAPI_DFLoader::refineResult(aBuilder->Shape());
+ else
+ aResult = aBuilder->Shape();
+ // fill data map to keep correct orientation of sub-shapes
+ for (TopExp_Explorer Exp(aResult,TopAbs_FACE); Exp.More(); Exp.Next()) {
+ std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
+ aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current()));
+ myMap.bind(aCurrentShape, aCurrentShape);
+ }
+ myShape->setImpl(new TopoDS_Shape(aResult));
+ myFirst->setImpl(new TopoDS_Shape(aBuilder->FirstShape()));
+ myLast->setImpl(new TopoDS_Shape(aBuilder-> LastShape()));
+ myMkShape = new GeomAlgoAPI_MakeShape (aBuilder);
+ }