]> OCCT Git - occt.git/commitdiff
0032717: Modeling Algorithms - BRepBuilderAPI_Copy should not remove triangulation...
authorkgv <kgv@opencascade.com>
Mon, 6 Dec 2021 19:23:24 +0000 (22:23 +0300)
committersmoskvin <smoskvin@opencascade.com>
Wed, 8 Dec 2021 22:22:28 +0000 (01:22 +0300)
BRepBuilderAPI_Copy now ignores toCopyMesh flag for non-geometric shapes.

src/BRepBuilderAPI/BRepBuilderAPI_Copy.cxx
tests/bugs/modalg_7/bug32717 [new file with mode: 0644]

index 3bd8ce0eb0b4899d9b7a665fb8357b8866d837eb..36c25a41e526d2cf3478d0400f464dae245c8f4b 100644 (file)
@@ -59,8 +59,11 @@ public:
   //! copies it if required
   Standard_Boolean NewTriangulation(const TopoDS_Face& F, Handle(Poly_Triangulation)& T) Standard_OVERRIDE
   {
-    if (!myCopyMesh)
+    if (!myCopyMesh
+      && BRep_Tool::IsGeometric (F))
+    {
       return Standard_False;
+    }
 
     TopLoc_Location L;
     T = BRep_Tool::Triangulation(F, L);
@@ -93,8 +96,11 @@ public:
   //! copies it if required
   Standard_Boolean NewPolygon(const TopoDS_Edge& E, Handle(Poly_Polygon3D)& P) Standard_OVERRIDE
   {
-    if (!myCopyMesh)
+    if (!myCopyMesh
+      && BRep_Tool::IsGeometric (E))
+    {
       return Standard_False;
+    }
 
     TopLoc_Location aLoc;
     P = BRep_Tool::Polygon3D(E, aLoc);
@@ -113,8 +119,11 @@ public:
   Standard_Boolean NewPolygonOnTriangulation(const TopoDS_Edge& E, const TopoDS_Face& F,
                                              Handle(Poly_PolygonOnTriangulation)& P) Standard_OVERRIDE
   {
-    if (!myCopyMesh)
+    if (!myCopyMesh
+      && BRep_Tool::IsGeometric (E))
+    {
       return Standard_False;
+    }
 
     TopLoc_Location aLoc;
     Handle(Poly_Triangulation) aTria = BRep_Tool::Triangulation(F, aLoc);
diff --git a/tests/bugs/modalg_7/bug32717 b/tests/bugs/modalg_7/bug32717
new file mode 100644 (file)
index 0000000..6c91e34
--- /dev/null
@@ -0,0 +1,17 @@
+puts "================================================="
+puts "0032717: Modeling Algorithms - BRepBuilderAPI_Copy should not remove triangulation from surface-less faces"
+puts "================================================="
+puts ""
+
+pload XDE MODELING
+box b 1 2 3
+incmesh b 1
+checktrinfo b -tri 12 -nod 24
+tclean -geom b
+trinfo b
+checktrinfo b -tri 12 -nod 24
+
+# check that copied triangulation-only shape is copied with triangulation
+tcopy b bb
+trinfo bb
+checktrinfo bb -tri 12 -nod 24