]> OCCT Git - occt.git/commitdiff
0027122: Data Exchange - invalid shapes are produced during model translation due...
authoratereshi <andrey.tereshin@opencascade.com>
Fri, 15 Jul 2022 11:09:09 +0000 (14:09 +0300)
committerVadim Glukhikh <vadim.glukhikh@opencascade.com>
Mon, 21 Nov 2022 17:06:04 +0000 (20:06 +0300)
Problem: The shape has two faces that dimensions are less than tolerance in the specified STEP file. This situation produces the invalid shape.
Change: Shape process has operator FixFaceSize, that is exactly suitable for this shape. The only option of FixFaceSize operator was added to InterfaceStatic, to manage the operator from DRAW command.
Result: The shape without artifacts can be reproduced from STEP file with an extra healing procedure.

src/STEPControl/STEPControl_Controller.cxx
tests/bugs/step/bug27122 [new file with mode: 0644]

index 1970fff87af3070307de62e24e3f6a5d66dd7a58..bdb17f8f88e90c2399dfdb60d1f54265349ea22c 100644 (file)
@@ -239,6 +239,7 @@ STEPControl_Controller::STEPControl_Controller ()
     Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixNonAdjacentIntersectingEdgesMode", 't', "-1");
     Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixVertexPositionMode",       't', "0");
     Interface_Static::Init ("XSTEP", "FromSTEP.FixShape.FixVertexToleranceMode",      't', "-1"); 
+    Interface_Static::Init ("XSTEP", "FromSTEP.FixFaceSize.Tolerance",                't', "1.e-7"); 
 
     // ika 28.07.16: Parameter to read all top level solids and shells,
     // should be used only in case of invalid shape_representation without links to shapes.
diff --git a/tests/bugs/step/bug27122 b/tests/bugs/step/bug27122
new file mode 100644 (file)
index 0000000..b4c4f6a
--- /dev/null
@@ -0,0 +1,27 @@
+puts "================"
+puts "OCC27122"
+puts "================"
+puts ""
+#####################################################################
+# STEP import regression: invalid shapes are produced during model translation due to huge face tolerance
+#####################################################################
+
+pload XDE
+
+# Empty resource file name to take params from InterfaceStatic
+param "read.step.resource.name" "\"\""
+# Add FixFaceSize operator
+param "FromSTEP.exec.op" FixShape,FixFaceSize
+# Set a tolerance exceeding the size of the problem face to FixFaceSize operator
+param "FromSTEP.FixFaceSize.Tolerance" 0.0508
+
+stepread [locate_data_file bug27122_280696.stp] a *
+
+# restore old params
+param "read.step.resource.name" STEP
+param "FromSTEP.exec.op" FixShape
+param "FromSTEP.FixFaceSize.Tolerance" 1.e-7
+
+checknbshapes a_1 -t -face 10
+
+checkview -display a_1 -3d -path ${imagedir}/${test_image}.png