]> OCCT Git - occt-copy.git/commitdiff
0024595: STEP import missing surfaces
authoroan <oan@opencascade.com>
Wed, 3 Feb 2016 08:03:45 +0000 (11:03 +0300)
committeroan <oan@opencascade.com>
Wed, 3 Feb 2016 08:03:45 +0000 (11:03 +0300)
Modification to create natural bounds for face based on the spherical and Bspline surface and having only one bound represented by Vertex loop was made.
 According to the specification of ISO-10303 part 42:
    "If the face has only one bound and this is of type vertex_loop, then the interior of the face is the domain of the face_surface.face_geometry. In such a case the underlying surface shall be closed (e.g. a spherical_surface.)"
    - natural bounds are applied only in case if VertexLoop is only the one
      defined face bound.

Update of test-cases according to the new behavior

Test-case for issue #24595

src/StepToTopoDS/StepToTopoDS_TranslateFace.cxx
tests/bugs/step/bug24595 [new file with mode: 0644]
tests/de/step_1/D1

index 1bfc6e7e19ef9bfdd1949a6a06d5f0e505b3a4da..5fd1aece3dcfab2a9b6120b60fc79e6bd61c63de 100644 (file)
@@ -239,12 +239,7 @@ void StepToTopoDS_TranslateFace::Init
 //  Standard_Boolean fautcoudre =
 //    ( (NbBnd == 2) && (GeomSurf->IsUClosed() || GeomSurf->IsVClosed()) );
 
-  Standard_Boolean isExistOuter = Standard_False;
-  for (Standard_Integer i = 1; i <= NbBnd; i++) {
-    FaceBound = FS->BoundsValue(i);
-    if (FaceBound->IsKind(STANDARD_TYPE(StepShape_FaceOuterBound)))
-      isExistOuter = Standard_True;
-  }
+  
   for (Standard_Integer i = 1; i <= NbBnd; i ++) {
 
 #ifdef OCCT_DEBUG
@@ -268,13 +263,14 @@ void StepToTopoDS_TranslateFace::Init
       if (GeomSurf->IsKind (STANDARD_TYPE(Geom_SphericalSurface)) ||
           GeomSurf->IsKind (STANDARD_TYPE(Geom_BSplineSurface)) )
       {
-        if (!isExistOuter || FaceBound->IsKind(STANDARD_TYPE(StepShape_FaceOuterBound))) {
+        if (NbBnd ==1 || FaceBound->IsKind(STANDARD_TYPE(StepShape_FaceOuterBound))) {
           BRepBuilderAPI_MakeFace mf (GeomSurf, Precision());
           for (TopoDS_Iterator it(mf); it.More(); it.Next()) 
             B.Add (F, it.Value());
-        }
+        
 
         continue;
+        }
       }
       
       if (//GeomSurf->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ||
diff --git a/tests/bugs/step/bug24595 b/tests/bugs/step/bug24595
new file mode 100644 (file)
index 0000000..e2999b7
--- /dev/null
@@ -0,0 +1,29 @@
+puts "================"
+puts "OCC24595"
+puts "================"
+puts ""
+#######################################################################################
+# STEP import missing surfaces
+#######################################################################################
+
+set BugNumber OCC24595
+stepread [locate_data_file bug24595_281390.stp] a *
+explode a_1 f
+set mlog [nbshapes a_1_3]
+
+set status 1
+
+if (![regexp {WIRE[ ]+: 1} $mlog]) {
+  set status 0
+}
+
+set mlog [bounding a_1_3]
+if (![regexp {(-7.26623440743389) (-8.0984932752388978) (-150.09849327523889) (7.2662344074338865) (8.0984932752388978) (-141.90150672476111)} $mlog]) {
+  set status 0
+}                        
+                                
+if {$status == 1} {
+  puts "OK ${BugNumber}"
+} else {
+  puts "Faulty ${BugNumber}"
+}
\ No newline at end of file
index a090a45344c23c8050f3c71104cadc83c7d9c51a..ba098ae99ac85313e8411a4628736d031d238a16 100644 (file)
@@ -1,14 +1,13 @@
 # !!!! This file is generated automatically, do not edit manually! See end script
-
 set filename trj9_b2-ai-214.stp
 
 set ref_data {
 DATA        : Faulties = 0  ( 0 )  Warnings = 0  ( 0 )  Summary  = 0  ( 0 )
-TPSTAT      : Faulties = 0  ( 0 )  Warnings = 8  ( 38 )  Summary  = 8  ( 38 )
-CHECKSHAPE  : Wires    = 1  ( 1 )  Faces    = 1  ( 1 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
-NBSHAPES    : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 221  ( 221 )   Summary  = 1465  ( 1463 )
-STATSHAPE   : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 221  ( 221 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 610  ( 610 )
-TOLERANCE   : MaxTol   = 0.004950186716  ( 0.004950186717 )  AvgTol   =  0.0003553188051  (  0.0003621212346 )
+TPSTAT      : Faulties = 0  ( 0 )  Warnings = 7  ( 38 )  Summary  = 7  ( 38 )
+CHECKSHAPE  : Wires    = 0  ( 0 )  Faces    = 0  ( 0 )  Shells   = 0  ( 0 )   Solids   = 0 ( 0 )
+NBSHAPES    : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 221  ( 221 )   Summary  = 1460  ( 1459 )
+STATSHAPE   : Solid    = 1  ( 1 )  Shell    = 1  ( 1 )  Face     = 221  ( 221 )   FreeWire = 0  ( 0 )   FreeEdge  = 0 ( 0 )   SharedEdge = 608  ( 608 )
+TOLERANCE   : MaxTol   = 0.004950137219  ( 0.004950137216 )  AvgTol   =  0.0003566630364  (  0.0003615446964 )
 LABELS      : N0Labels = 1  ( 1 )  N1Labels = 0  ( 0 )  N2Labels = 0  ( 0 )   TotalLabels = 1  ( 1 )   NameLabels = 1  ( 1 )   ColorLabels = 1  ( 1 )   LayerLabels = 0  ( 0 )
 PROPS       : Centroid = 1  ( 1 )  Volume   = 1  ( 1 )  Area     = 1  ( 1 )
 NCOLORS     : NColors  = 1  ( 1 )