From eba06712d9791591512c5b8e4e24a09f44f2136b Mon Sep 17 00:00:00 2001 From: dbv Date: Thu, 7 Jul 2016 14:53:28 +0300 Subject: [PATCH] Fixed naming; Fixed UnitTestBox.py --- src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp | 5 +++++ src/PrimitivesPlugin/Test/UnitTestBox.py | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp index e8a372682..061529b7d 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_MakeShape.cpp @@ -157,6 +157,11 @@ void GeomAlgoAPI_MakeShape::setShape(const std::shared_ptr theSha } const TopoDS_Shape& aTopoDSShape = myShape->impl(); + for(TopExp_Explorer anExp(aTopoDSShape,TopAbs_EDGE); anExp.More(); anExp.Next()) { + std::shared_ptr aCurrentShape(new GeomAPI_Shape()); + aCurrentShape->setImpl(new TopoDS_Shape(anExp.Current())); + myMap->bind(aCurrentShape, aCurrentShape); + } for(TopExp_Explorer anExp(aTopoDSShape,TopAbs_FACE); anExp.More(); anExp.Next()) { std::shared_ptr aCurrentShape(new GeomAPI_Shape()); aCurrentShape->setImpl(new TopoDS_Shape(anExp.Current())); diff --git a/src/PrimitivesPlugin/Test/UnitTestBox.py b/src/PrimitivesPlugin/Test/UnitTestBox.py index 3245a09c6..ef63b0109 100644 --- a/src/PrimitivesPlugin/Test/UnitTestBox.py +++ b/src/PrimitivesPlugin/Test/UnitTestBox.py @@ -77,7 +77,7 @@ aPlaneTop.execute() #The face should be at 1.6, so the plane should be at 1.6 + 0.4 = 2. aRefPlaneTopLocation = 2. -#location() is a method from GeomAPI_Face that returns a GeomAPI_Pnt, from which we can extract the z coordinate +#location() is a method from GeomAPI_Face that returns a GeomAPI_Pnt, from which we can extract the z coordinate aPlaneTopResult = aPlaneTop.firstResult() aPlaneTopFace = GeomAPI_Face(aPlaneTopResult.shape()) aPlaneTestLocation = aPlaneTopFace.getPlane() @@ -97,9 +97,11 @@ aPoint1 = aPart.addFeature("Point") aPoint2 = aPart.addFeature("Point") assert(aPoint1.getKind() == "Point") assert(aPoint2.getKind() == "Point") +aPoint1.string("creation_method").setValue("by_xyz") aPoint1.real("x").setValue(2.0) aPoint1.real("y").setValue(2.0) aPoint1.real("z").setValue(2.0) +aPoint2.string("creation_method").setValue("by_xyz") aPoint2.real("x").setValue(2.5) aPoint2.real("y").setValue(2.5) aPoint2.real("z").setValue(2.5) @@ -119,7 +121,7 @@ aBoxBy2Pts.execute() # Check box volume aBoxResult2 = modelAPI_ResultBody(aBoxBy2Pts.firstResult()) -aRefVolume2 = 0.5 * 0.5 * 0.5 +aRefVolume2 = 0.5 * 0.5 * 0.5 aResVolume2 = GeomAlgoAPI_ShapeTools_volume(aBoxResult2.shape()) assert (math.fabs(aResVolume2 - aRefVolume2) < 10 ** -5) -- 2.39.2