From e9d05765c2f7a3fa48465b5e09aedd83a80e997b Mon Sep 17 00:00:00 2001 From: oan Date: Tue, 5 Nov 2019 16:13:38 +0300 Subject: [PATCH] 0031131: [REGRESSION] Mesh - location of Wire affects Poly_Polygon3D Use TopoDS_Edge without location in case of free edges to produce Poly_Polygon3D without offset. --- src/IMeshTools/IMeshTools_ShapeExplorer.cxx | 9 ++++-- tests/bugs/mesh/bug31131 | 32 +++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 tests/bugs/mesh/bug31131 diff --git a/src/IMeshTools/IMeshTools_ShapeExplorer.cxx b/src/IMeshTools/IMeshTools_ShapeExplorer.cxx index 2dc244a73c..bc690a40df 100644 --- a/src/IMeshTools/IMeshTools_ShapeExplorer.cxx +++ b/src/IMeshTools/IMeshTools_ShapeExplorer.cxx @@ -34,6 +34,7 @@ namespace //======================================================================= void visitEdges (const Handle (IMeshTools_ShapeVisitor)& theVisitor, const TopoDS_Shape& theShape, + const Standard_Boolean isResetLocation, const TopAbs_ShapeEnum theToFind, const TopAbs_ShapeEnum theToAvoid = TopAbs_SHAPE) { @@ -46,7 +47,9 @@ namespace continue; } - theVisitor->Visit (aEdge); + theVisitor->Visit (isResetLocation ? + TopoDS::Edge (aEdge.Located (TopLoc_Location ())) : + aEdge); } } } @@ -77,7 +80,7 @@ void IMeshTools_ShapeExplorer::Accept ( const Handle (IMeshTools_ShapeVisitor)& theVisitor) { // Explore all free edges in shape. - visitEdges (theVisitor, GetShape (), TopAbs_EDGE, TopAbs_FACE); + visitEdges (theVisitor, GetShape (), Standard_True, TopAbs_EDGE, TopAbs_FACE); // Explore all related to some face edges in shape. // make array of faces suitable for processing (excluding faces without surface) @@ -105,7 +108,7 @@ void IMeshTools_ShapeExplorer::Accept ( } // Explore all edges in face. - visitEdges (theVisitor, aFace, TopAbs_EDGE); + visitEdges (theVisitor, aFace, Standard_False, TopAbs_EDGE); // Store only forward faces in order to prevent inverse issue. theVisitor->Visit (TopoDS::Face (aFace.Oriented (TopAbs_FORWARD))); diff --git a/tests/bugs/mesh/bug31131 b/tests/bugs/mesh/bug31131 new file mode 100644 index 0000000000..8764dbc3bc --- /dev/null +++ b/tests/bugs/mesh/bug31131 @@ -0,0 +1,32 @@ +puts "=========" +puts "0031131: Mesh - location of Wire affects Poly_Polygon3D" +puts "=========" +puts "" + +vertex v1 0 0 0 +vertex v2 10 0 0 +vertex v3 10 10 0 +edge e12 v1 v2 +edge e23 v2 v3 +wire w e12 e23 +tcopy w w0 +copy w w11 +copy w w12 +copy w w13 +ttranslate w12 0 0 10 +ttranslate w13 0 0 20 +compound w11 w12 w13 c +incmesh c 1 +vclear +vinit View1 +vdefaults -autoTriang 0 +explode w11 v +#vdisplay w11 w0 w11_1 w11_2 w11_3 +vdisplay w11 w11_1 w11_2 w11_3 +vfit + +bounding w11 -save xmin ymin zmin xmax ymax zmax +checkpoint Min [list [dval xmin] [dval ymin] [dval zmin]] { -1 -1 -1 } 0.0001 +checkpoint Max [list [dval xmax] [dval ymax] [dval zmax]] { 11 11 1 } 0.0001 + +checkview -screenshot -3d -path ${imagedir}/${test_image}.png -- 2.20.1