1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_Revolution.cpp
4 // Created: 12 May 2015
5 // Author: Dmitry Bobylev
7 #include <GeomAlgoAPI_Revolution.h>
9 #include <GeomAPI_Face.h>
10 #include <GeomAPI_ShapeExplorer.h>
11 #include <GeomAlgoAPI_DFLoader.h>
12 #include <GeomAlgoAPI_MakeShapeList.h>
13 #include <GeomAlgoAPI_Rotation.h>
14 #include <GeomAlgoAPI_ShapeTools.h>
16 #include <BRep_Builder.hxx>
17 #include <BRep_Tool.hxx>
18 #include <BRepAlgoAPI_Cut.hxx>
19 #include <BRepBuilderAPI_MakeEdge.hxx>
20 #include <BRepBuilderAPI_MakeFace.hxx>
21 #include <BRepBuilderAPI_Transform.hxx>
22 #include <BRepBuilderAPI_MakeWire.hxx>
23 #include <BRepCheck_Analyzer.hxx>
24 #include <BRepPrimAPI_MakeRevol.hxx>
25 #include <BRepGProp.hxx>
26 #include <BRepOffsetAPI_MakePipe.hxx>
27 #include <BRepTools.hxx>
28 #include <Geom_Circle.hxx>
29 #include <Geom_Line.hxx>
30 #include <Geom_Plane.hxx>
31 #include <GeomAPI_ProjectPointOnCurve.hxx>
32 #include <GeomLib_IsPlanarSurface.hxx>
33 #include <gp_Circ.hxx>
35 #include <GProp_GProps.hxx>
36 #include <TopExp_Explorer.hxx>
38 #include <TopTools_ListIteratorOfListOfShape.hxx>
40 //=================================================================================================
41 GeomAlgoAPI_Revolution::GeomAlgoAPI_Revolution(std::shared_ptr<GeomAPI_Shape> theBasis,
42 std::shared_ptr<GeomAPI_Ax1> theAxis,
47 build(theBasis, theAxis, std::shared_ptr<GeomAPI_Shape>(), theToAngle, std::shared_ptr<GeomAPI_Shape>(), theFromAngle);
50 //=================================================================================================
51 GeomAlgoAPI_Revolution::GeomAlgoAPI_Revolution(std::shared_ptr<GeomAPI_Shape> theBasis,
52 std::shared_ptr<GeomAPI_Ax1> theAxis,
53 std::shared_ptr<GeomAPI_Shape> theToShape,
55 std::shared_ptr<GeomAPI_Shape> theFromShape,
59 build(theBasis, theAxis, theToShape, theToAngle, theFromShape, theFromAngle);
62 //=================================================================================================
63 TopoDS_Face GeomAlgoAPI_Revolution::makeFaceFromPlane(gp_Pln& thePlane, const gp_Pnt& thePoint)
65 gp_XYZ aVec = thePoint.XYZ() - thePlane.Location().XYZ();
66 double aSign = aVec * thePlane.Axis().Direction().XYZ();
67 if(aSign < 0) thePlane.SetAxis(thePlane.Axis().Reversed());
69 BRepBuilderAPI_MakeFace aMakeFace(thePlane);
70 TopoDS_Face aResultFace = TopoDS::Face(aMakeFace.Shape());
75 //=================================================================================================
76 TopoDS_Solid GeomAlgoAPI_Revolution::makeSolidFromShape(const TopoDS_Shape& theShape)
81 BRep_Builder aBoundingBuilder;
82 if(theShape.ShapeType() == TopAbs_SHELL) {
83 aShell = TopoDS::Shell(theShape);
85 aBoundingBuilder.MakeShell(aShell);
86 aBoundingBuilder.Add(aShell, theShape);
88 aBoundingBuilder.MakeSolid(aSolid);
89 aBoundingBuilder.Add(aSolid, aShell);
94 //=================================================================================================
95 TopoDS_Shape GeomAlgoAPI_Revolution::findClosest(const TopoDS_Shape& theShape, const gp_Pnt& thePoint)
97 TopoDS_Shape aResult = theShape;
99 if(theShape.ShapeType() == TopAbs_COMPOUND) {
100 double aMinDistance = Precision::Infinite();
102 GProp_GProps aGProps;
105 for (TopoDS_Iterator anItr(theShape); anItr.More(); anItr.Next()) {
106 TopoDS_Shape aValue = anItr.Value();
107 BRepGProp::VolumeProperties(aValue, aGProps);
108 aCentr = aGProps.CentreOfMass();
109 aCurDistance = aCentr.Distance(thePoint);
111 if(aCurDistance < aMinDistance) {
112 aMinDistance = aCurDistance;
121 //=================================================================================================
122 void GeomAlgoAPI_Revolution::build(const std::shared_ptr<GeomAPI_Shape>& theBasis,
123 const std::shared_ptr<GeomAPI_Ax1>& theAxis,
124 const std::shared_ptr<GeomAPI_Shape>& theToShape,
126 const std::shared_ptr<GeomAPI_Shape>& theFromShape,
129 if(!theBasis || !theAxis ||
130 (((!theFromShape && !theToShape) || (theFromShape && theToShape && theFromShape->isEqual(theToShape)))
131 && (theFromAngle == -theToAngle))) {
135 // Checking that shell is planar.
136 TopoDS_Shape aBasis = theBasis->impl<TopoDS_Shape>();
137 // TODO: fix planar checking
138 //TopExp_Explorer aBasisExp(aBasis, TopAbs_FACE);
139 //for(; aBasisExp.More(); aBasisExp.Next()) {
140 // const TopoDS_Shape& aCurSh = aBasisExp.Current();
143 // Geting base plane.
144 std::shared_ptr<GeomAPI_Face> aBaseFace;
145 if(theBasis->shapeType() == GeomAPI_Shape::SHELL) {
146 GeomAPI_ShapeExplorer anExp(theBasis, GeomAPI_Shape::FACE);
148 std::shared_ptr<GeomAPI_Shape> aFaceOnShell = anExp.current();
149 aBaseFace = std::shared_ptr<GeomAPI_Face>(new GeomAPI_Face(aFaceOnShell));
152 aBaseFace = std::shared_ptr<GeomAPI_Face>(new GeomAPI_Face(theBasis));
154 if(!aBaseFace.get()) {
157 TopoDS_Face aBasisFace = TopoDS::Face(aBaseFace->impl<TopoDS_Shape>());
158 GeomLib_IsPlanarSurface isBasisPlanar(BRep_Tool::Surface(aBasisFace));
159 gp_Pln aBasisPln = isBasisPlanar.Plan();
160 Geom_Plane aBasisPlane(aBasisPln);
162 // Creating circle for pipe.
163 gp_Pnt aBasisCentre = GeomAlgoAPI_ShapeTools::centreOfMass(theBasis)->impl<gp_Pnt>();
164 const TopoDS_Shape& aBasisShape = theBasis->impl<TopoDS_Shape>();
165 gp_Ax1 anAxis = theAxis->impl<gp_Ax1>();
166 gp_Lin anAxisLin(anAxis);
167 Handle(Geom_Line) anAxisLine = new Geom_Line(anAxis);
168 GeomAPI_ProjectPointOnCurve aProjection(aBasisCentre, anAxisLine);
169 if(aProjection.NbPoints() != 1) {
172 Standard_Real aRadius = aProjection.Distance(1);
173 gp_Circ aCircle(gp_Ax2(aProjection.NearestPoint(), anAxis.Direction()), aRadius);
175 TopoDS_Shape aResult;
176 ListOfMakeShape aListOfMakeShape;
177 if(!theFromShape && !theToShape) { // Case 1: When only angles was set.
178 // Rotating base face with the negative value of "from angle".
180 aBaseTrsf.SetRotation(anAxis, -theFromAngle / 180.0 * M_PI);
181 gp_Pnt aFromPnt = aBasisCentre.Transformed(aBaseTrsf);
182 aCircle = gp_Circ(gp_Ax2(aProjection.NearestPoint(), anAxis.Direction(), gp_Vec(aProjection.NearestPoint(), aFromPnt)),
184 BRepBuilderAPI_Transform* aBaseTransform = new BRepBuilderAPI_Transform(aBasisShape,
187 if(!aBaseTransform || !aBaseTransform->IsDone()) {
190 aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBaseTransform)));
191 TopoDS_Shape aRotatedBaseShape = aBaseTransform->Shape();
193 // Making wire for pipe.
194 TopoDS_Edge aPipeEdge = BRepBuilderAPI_MakeEdge(aCircle, 0, (theFromAngle + theToAngle) / 180.0 * M_PI);
195 TopoDS_Wire aPipeWire = BRepBuilderAPI_MakeWire(aPipeEdge).Wire();
198 BRepOffsetAPI_MakePipe* aPipeBuilder = new BRepOffsetAPI_MakePipe(aPipeWire, aRotatedBaseShape);
199 if(!aPipeBuilder || !aPipeBuilder->IsDone()) {
202 std::shared_ptr<GeomAPI_Shape> aWire(new GeomAPI_Shape);
203 std::shared_ptr<GeomAPI_Shape> aBShape(new GeomAPI_Shape);
204 aWire->setImpl(new TopoDS_Shape(aPipeWire));
205 aBShape->setImpl(new TopoDS_Shape(aRotatedBaseShape));
206 aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aPipeBuilder, aWire, aBShape)));
207 aResult = aPipeBuilder->Shape();
208 TopoDS_Shape aToShape = aPipeBuilder->LastShape();
209 TopoDS_Shape aFromShape = aPipeBuilder->FirstShape();
212 TopExp_Explorer anExp(aToShape, TopAbs_FACE);
213 for(; anExp.More(); anExp.Next()) {
214 std::shared_ptr<GeomAPI_Shape> aTSHape(new GeomAPI_Shape);
215 aTSHape->setImpl(new TopoDS_Shape(anExp.Current()));
216 myToFaces.push_back(aTSHape);
218 anExp.Init(aFromShape, TopAbs_FACE);
219 for(; anExp.More(); anExp.Next()) {
220 std::shared_ptr<GeomAPI_Shape> aFSHape(new GeomAPI_Shape);
221 aFSHape->setImpl(new TopoDS_Shape(anExp.Current()));
222 myFromFaces.push_back(aFSHape);
224 } else if(theFromShape && theToShape) { // Case 2: When both bounding planes were set.
225 // Getting bounding faces.
226 TopoDS_Face aFromFace = TopoDS::Face(theFromShape->impl<TopoDS_Shape>());
227 TopoDS_Face aToFace = TopoDS::Face(theToShape->impl<TopoDS_Shape>());
229 // Getting planes from bounding face.
230 GeomLib_IsPlanarSurface isFromPlanar(BRep_Tool::Surface(aFromFace));
231 GeomLib_IsPlanarSurface isToPlanar(BRep_Tool::Surface(aToFace));
232 if(!isFromPlanar.IsPlanar() || !isToPlanar.IsPlanar()) {// non-planar shapes is not supported for revolution bounding
235 gp_Pln aFromPln = isFromPlanar.Plan();
236 gp_Pln aToPln = isToPlanar.Plan();
238 // Orienting bounding planes properly so that the center of mass of the base face stays
239 // on the result shape after cut.
240 aFromFace = makeFaceFromPlane(aFromPln, aBasisCentre);
241 aToFace = makeFaceFromPlane(aToPln, aBasisCentre);
243 // Making solids from bounding planes and putting them in compound.
244 TopoDS_Shape aFromSolid = makeSolidFromShape(aFromFace);
245 TopoDS_Shape aToSolid = makeSolidFromShape(aToFace);
247 // Rotating bounding planes to the specified angle.
250 double aFromRotAngle = ((aFromPln.Axis().Direction() * aBasisPln.Axis().Direction()) > 0) ? -theFromAngle : theFromAngle;
251 double aToRotAngle = ((aToPln.Axis().Direction() * aBasisPln.Axis().Direction()) > 0) ? -theToAngle : theToAngle;
252 aFromTrsf.SetRotation(anAxis,aFromRotAngle / 180.0 * M_PI);
253 aToTrsf.SetRotation(anAxis, aToRotAngle / 180.0 * M_PI);
254 BRepBuilderAPI_Transform aFromTransform(aFromSolid, aFromTrsf, true);
255 BRepBuilderAPI_Transform aToTransform(aToSolid, aToTrsf, true);
256 TopoDS_Shape aRotatedFromFace = aFromTransform.Modified(aFromFace).First();
257 TopoDS_Shape aRotatedToFace = aToTransform.Modified(aToFace).First();
258 aFromSolid = aFromTransform.Shape();
259 aToSolid = aToTransform.Shape();
261 // Making wire for pipe.
262 TopoDS_Edge aPipeEdge = BRepBuilderAPI_MakeEdge(aCircle, 0, 2 * M_PI);
263 TopoDS_Wire aPipeWire = BRepBuilderAPI_MakeWire(aPipeEdge).Wire();
266 BRepOffsetAPI_MakePipe* aPipeBuilder = new BRepOffsetAPI_MakePipe(aPipeWire, aBasisShape);
267 if(!aPipeBuilder || !aPipeBuilder->IsDone()) {
270 std::shared_ptr<GeomAPI_Shape> aWire(new GeomAPI_Shape);
271 std::shared_ptr<GeomAPI_Shape> aBShape(new GeomAPI_Shape);
272 aWire->setImpl(new TopoDS_Shape(aPipeWire));
273 aBShape->setImpl(new TopoDS_Shape(aBasisShape));
274 aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aPipeBuilder, aWire, aBShape)));
275 aResult = aPipeBuilder->Shape();
277 // Cutting revolution with from plane.
278 BRepAlgoAPI_Cut* aFromCutBuilder = new BRepAlgoAPI_Cut(aResult, aFromSolid);
279 aFromCutBuilder->Build();
280 if(!aFromCutBuilder->IsDone()) {
283 aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aFromCutBuilder)));
284 aResult = aFromCutBuilder->Shape();
286 // Cutting revolution with to plane.
287 BRepAlgoAPI_Cut* aToCutBuilder = new BRepAlgoAPI_Cut(aResult, aToSolid);
288 aToCutBuilder->Build();
289 if(!aToCutBuilder->IsDone()) {
292 aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aToCutBuilder)));
293 aResult = aToCutBuilder->Shape();
295 // If after cut we got more than one solids then take closest to the center of mass of the base face.
296 //aResult = findClosest(aResult, aBasisCentre);
299 for(TopExp_Explorer anExp(aResult, TopAbs_FACE); anExp.More (); anExp.Next ()) {
300 const TopoDS_Shape& aFaceOnResult = anExp.Current();
301 Handle(Geom_Surface) aFaceSurface = BRep_Tool::Surface(TopoDS::Face(aFaceOnResult));
302 Handle(Geom_Surface) aFromSurface = BRep_Tool::Surface(TopoDS::Face(aRotatedFromFace));
303 Handle(Geom_Surface) aToSurface = BRep_Tool::Surface(TopoDS::Face(aRotatedToFace));
304 if(aFaceSurface == aFromSurface) {
305 std::shared_ptr<GeomAPI_Shape> aFSHape(new GeomAPI_Shape);
306 aFSHape->setImpl(new TopoDS_Shape(aFaceOnResult));
307 myFromFaces.push_back(aFSHape);
309 if(aFaceSurface == aToSurface) {
310 std::shared_ptr<GeomAPI_Shape> aTSHape(new GeomAPI_Shape);
311 aTSHape->setImpl(new TopoDS_Shape(aFaceOnResult));
312 myToFaces.push_back(aTSHape);
315 } else { //Case 3: When only one bounding plane was set.
316 // Getting bounding face.
317 TopoDS_Face aBoundingFace;
318 bool isFromFaceSet = false;
320 aBoundingFace = TopoDS::Face(theFromShape->impl<TopoDS_Shape>());
321 isFromFaceSet = true;
322 } else if(theToShape) {
323 aBoundingFace = TopoDS::Face(theToShape->impl<TopoDS_Shape>());
326 // Getting plane from bounding face.
327 GeomLib_IsPlanarSurface isBoundingPlanar(BRep_Tool::Surface(aBoundingFace));
328 if(!isBoundingPlanar.IsPlanar()) { // non-planar shapes is not supported for revolution bounding
331 gp_Pln aBoundingPln = isBoundingPlanar.Plan();
333 // Orienting bounding plane properly so that the center of mass of the base face stays
334 // on the result shape after cut.
335 gp_Pnt aBasisCentr = GeomAlgoAPI_ShapeTools::centreOfMass(theBasis)->impl<gp_Pnt>();
336 aBoundingFace = makeFaceFromPlane(aBoundingPln, aBasisCentr);
338 // Making solid from bounding plane.
339 TopoDS_Shape aBoundingSolid = makeSolidFromShape(aBoundingFace);
341 // Rotating bounding plane to the specified angle.
342 double aBoundingRotAngle = isFromFaceSet ? theFromAngle : theToAngle;
343 if(aBoundingPln.Axis().IsParallel(aBasisPln.Axis(), Precision::Confusion())) {
344 if(isFromFaceSet) aBoundingRotAngle = -aBoundingRotAngle;
346 double aSign = (aBoundingPln.Axis().Direction() ^ aBasisPln.Axis().Direction()) *
348 if((aSign <= 0 && !isFromFaceSet) || (aSign > 0 && isFromFaceSet)) {
349 aBoundingRotAngle = -aBoundingRotAngle;
352 gp_Trsf aBoundingTrsf;
353 aBoundingTrsf.SetRotation(anAxis, aBoundingRotAngle / 180.0 * M_PI);
354 BRepBuilderAPI_Transform aBoundingTransform(aBoundingSolid, aBoundingTrsf, true);
355 TopoDS_Shape aRotatedBoundingFace = aBoundingTransform.Modified(aBoundingFace).First();
356 aBoundingSolid = aBoundingTransform.Shape();
358 // Making wire for pipe.
359 TopoDS_Edge aPipeEdge = BRepBuilderAPI_MakeEdge(aCircle, 0, 2 * M_PI);
360 TopoDS_Wire aPipeWire = BRepBuilderAPI_MakeWire(aPipeEdge).Wire();
363 BRepOffsetAPI_MakePipe* aPipeBuilder = new BRepOffsetAPI_MakePipe(aPipeWire, aBasisShape);
364 if(!aPipeBuilder || !aPipeBuilder->IsDone()) {
367 std::shared_ptr<GeomAPI_Shape> aWire(new GeomAPI_Shape);
368 std::shared_ptr<GeomAPI_Shape> aBShape(new GeomAPI_Shape);
369 aWire->setImpl(new TopoDS_Shape(aPipeWire));
370 aBShape->setImpl(new TopoDS_Shape(aBasisShape));
371 aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aPipeBuilder, aWire, aBShape)));
372 aResult = aPipeBuilder->Shape();
374 // Cutting revolution with bounding plane.
375 BRepAlgoAPI_Cut* aBoundingCutBuilder = new BRepAlgoAPI_Cut(aResult, aBoundingSolid);
376 aBoundingCutBuilder->Build();
377 if(!aBoundingCutBuilder->IsDone()) {
380 aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBoundingCutBuilder)));
381 aResult = aBoundingCutBuilder->Shape();
384 const TopTools_ListOfShape& aBndShapes = aBoundingCutBuilder->Modified(aBoundingFace);
385 for(TopTools_ListIteratorOfListOfShape anIt(aBndShapes); anIt.More(); anIt.Next()) {
386 std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
387 aShape->setImpl(new TopoDS_Shape(anIt.Value()));
388 isFromFaceSet ? myFromFaces.push_back(aShape) : myToFaces.push_back(aShape);
391 // Try to cut with base face. If it can not be done then keep result of cut with bounding plane.
394 aMirrorTrsf.SetMirror(aBasisPlane.Position().Ax2());
395 BRepBuilderAPI_Transform aMirrorTransform(aBasis, aMirrorTrsf, true);
396 aBasis = aMirrorTransform.Shape();
399 // Making solid from basis face.
400 TopoDS_Shape aBasisSolid = makeSolidFromShape(aBasis);
402 // Rotating basis face to the specified angle.
404 double aBasisRotAngle = isFromFaceSet ? theToAngle : -theFromAngle;
405 aBasisTrsf.SetRotation(anAxis, aBasisRotAngle / 180.0 * M_PI);
406 BRepBuilderAPI_Transform aBasisTransform(aBasisSolid, aBasisTrsf, true);
407 TopoDS_Shape aRotatedBasis = aBasisTransform.Modified(aBasis).First();
408 aBasisSolid = aBasisTransform.Shape();
410 // Cutting revolution with basis.
411 BRepAlgoAPI_Cut* aBasisCutBuilder = new BRepAlgoAPI_Cut(aResult, aBasisSolid);
412 aBasisCutBuilder->Build();
413 if(aBasisCutBuilder->IsDone()) {
414 TopoDS_Shape aCutResult = aBasisCutBuilder->Shape();
415 TopExp_Explorer anExp(aCutResult, TopAbs_SOLID);
417 aListOfMakeShape.push_back(std::shared_ptr<GeomAlgoAPI_MakeShape>(new GeomAlgoAPI_MakeShape(aBasisCutBuilder)));
418 aResult = aCutResult;
422 const TopTools_ListOfShape& aBsShapes = aBasisCutBuilder->Modified(aBoundingFace);
423 for(TopTools_ListIteratorOfListOfShape anIt(aBsShapes); anIt.More(); anIt.Next()) {
424 std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
425 aShape->setImpl(new TopoDS_Shape(anIt.Value()));
426 isFromFaceSet ? myToFaces.push_back(aShape) : myFromFaces.push_back(aShape);
429 // If after cut we got more than one solids then take closest to the center of mass of the base face.
430 //aResult = findClosest(aResult, aBasisCentr);
433 for(TopExp_Explorer anExp(aResult, TopAbs_FACE); anExp.More (); anExp.Next ()) {
434 const TopoDS_Shape& aFaceOnResult = anExp.Current();
435 Handle(Geom_Surface) aFaceSurface = BRep_Tool::Surface(TopoDS::Face(aFaceOnResult));
436 Handle(Geom_Surface) aBoundingSurface = BRep_Tool::Surface(TopoDS::Face(aRotatedBoundingFace));
437 if(aFaceSurface == aBoundingSurface) {
438 std::shared_ptr<GeomAPI_Shape> aShape(new GeomAPI_Shape());
439 aShape->setImpl(new TopoDS_Shape(aFaceOnResult));
440 isFromFaceSet ? myFromFaces.push_back(aShape) : myToFaces.push_back(aShape);
445 TopExp_Explorer anExp(aResult, TopAbs_SOLID);
450 // fill data map to keep correct orientation of sub-shapes
451 myMap = std::shared_ptr<GeomAPI_DataMapOfShapeShape>(new GeomAPI_DataMapOfShapeShape());
452 for (TopExp_Explorer Exp(aResult,TopAbs_FACE); Exp.More(); Exp.Next()) {
453 std::shared_ptr<GeomAPI_Shape> aCurrentShape(new GeomAPI_Shape());
454 aCurrentShape->setImpl(new TopoDS_Shape(Exp.Current()));
455 myMap->bind(aCurrentShape, aCurrentShape);
457 myShape = std::shared_ptr<GeomAPI_Shape>(new GeomAPI_Shape());
458 myShape->setImpl(new TopoDS_Shape(aResult));
459 myMkShape = std::shared_ptr<GeomAlgoAPI_MakeShapeList>(new GeomAlgoAPI_MakeShapeList(aListOfMakeShape));
464 //=================================================================================================
465 const bool GeomAlgoAPI_Revolution::isDone() const
470 //=================================================================================================
471 const bool GeomAlgoAPI_Revolution::isValid() const
473 BRepCheck_Analyzer aChecker(myShape->impl<TopoDS_Shape>());
474 return (aChecker.IsValid() == Standard_True);
477 //=================================================================================================
478 const bool GeomAlgoAPI_Revolution::hasVolume() const
480 bool hasVolume(false);
482 const TopoDS_Shape& aRShape = myShape->impl<TopoDS_Shape>();
484 BRepGProp::VolumeProperties(aRShape, aGProp);
485 if(aGProp.Mass() > Precision::Confusion())
491 //=================================================================================================
492 const std::shared_ptr<GeomAPI_Shape>& GeomAlgoAPI_Revolution::shape () const
497 //=================================================================================================
498 const ListOfShape& GeomAlgoAPI_Revolution::fromFaces() const
503 //=================================================================================================
504 const ListOfShape& GeomAlgoAPI_Revolution::toFaces() const
509 //=================================================================================================
510 std::shared_ptr<GeomAPI_DataMapOfShapeShape> GeomAlgoAPI_Revolution::mapOfShapes() const
515 //=================================================================================================
516 std::shared_ptr<GeomAlgoAPI_MakeShape> GeomAlgoAPI_Revolution::makeShape() const