View Issue Details

IDProjectCategoryView StatusLast Update
0023638CommunityOCCT:Data Exchangepublic2023-03-14 15:42
ReporterszvAssigned Todpasukhi  
PrioritynormalSeverityminor 
Status resolvedResolutionopen 
Product Version6.5.4 
Target Version7.8.0 
Summary0023638: Data Exchange - Reading IGES file produced invalid shape
DescriptionThis problem is reported by ChengShengXiong (via Contact Form).

The enclosed IGES file, when read in DRAW with default parameters, produces invalid shape.

Setting read.surfacecurve.mode to -3 allows to lower tolerance, however do not remove invalidity.
Steps To Reproducepload MODELING DATAEXCHANGE
# the following command is used in this case because it allows to lower the tolerance after import
param read.surfacecurve.mode -3
igesread d:/cadbad.igs a *

test bugs iges bug23638
TagsNo tags attached.
Test case numberbugs iges bug23638

Attached Files

  • cadbad.zip (2,393,169 bytes)

Relationships

related to 0033338 resolveddpasukhi Open CASCADE Coding - IGESToBRep_CurveAndSurface's method has unreachable code 

Activities

szv

2012-12-17 17:14

manager  

cadbad.zip (2,393,169 bytes)

git

2017-07-24 18:50

administrator   ~0068647

Branch CR23638 has been created by mkv.

SHA-1: f939c7fa1ab7539835db389e2e7f5023e6a8a981


Detailed log of new commits:

Author: mkv
Date: Mon Jul 24 18:50:27 2017 +0300

    Test for 0023638: Reading IGES file produced invalid shape

mkv

2017-07-27 18:15

tester   ~0068812

Dear BugMaster,
problem described in issue is reproduced on current state of OCCT.

git

2017-07-28 10:20

administrator   ~0068826

Branch CR23638 has been updated by apv.

SHA-1: 0b31c7e9a1dfc0085b876c1d90dc593d685dd9db


Detailed log of new commits:

Author: apv
Date: Fri Jul 28 10:19:54 2017 +0300

    Test case adjustment

git

2023-01-13 16:25

administrator   ~0112799

Branch CR23638 has been updated forcibly by DenisOrlov.

SHA-1: 2d6281a32e9d637d9b69bb786827e70808f60570

git

2023-01-19 12:25

administrator   ~0112882

Branch CR23638 has been updated forcibly by DenisOrlov.

SHA-1: 7d96f4e0d4070d12f8e52d0ccc14a46b52c61453

git

2023-01-25 12:57

administrator   ~0112984

Branch CR23638 has been updated forcibly by DenisOrlov.

SHA-1: d2f9004dea10d936abe3fffce0e929d1613e1921

git

2023-02-06 14:28

administrator   ~0113083

Branch CR23638 has been updated forcibly by DenisOrlov.

SHA-1: 537223925f9438f57e57a19bf6bbe14b6202f010

git

2023-02-10 19:29

administrator   ~0113113

Branch CR23638 has been updated forcibly by DenisOrlov.

SHA-1: 9600589d4816a63ac72c233d88f46c777565744e

git

2023-02-14 18:34

administrator   ~0113138

Branch CR23638 has been updated forcibly by DenisOrlov.

SHA-1: a91875b65ee92ec5a57677899597de256702a29b

dpasukhi

2023-02-14 18:41

developer   ~0113139

Dear @DenisOrlov

src/IGESData/IGESData_IGESModel.hxx
Please remove Standard_EXPORT for inline methods.
  //! Returns ReShape fixed on previous step
  Standard_EXPORT Handle(ShapeBuild_ReShape) ReShape() { return myReShape; };

src/IGESToBRep/IGESToBRep_CurveAndSurface.cxx
Do not comment useless code
  Handle(TCollection_HAsciiString) label = GetModel()->StringLabel(start);
  // Handle(TCollection_HAsciiString) aLabel = GetModel()->StringLabel(start);

Moreover, I can't fine any normal changes on this file. It looks line a just no full code staly update. Please, if you want update code for file, that not impact on your task, create new task for it and make full style rework.

src/ShapeAlgo/ShapeAlgo_ToolContainer.cxx
Noy impacted changes

src/ShapeAlgo/ShapeAlgo_ToolContainer.hxx
Not impacted changes

src/ShapeFix/ShapeFix_Shape.hxx
Not impacted changes

src/XSAlgo/XSAlgo_AlgoContainer.hxx
Please use predefined definition. Not include for handle
#include <ShapeBuild_ReShape.hxx>

If you start to update style, do it fully. Spaces, names.
But I want to see a new method, that use just one additional method. Not default and not nullptr.
You can desigh methods to call one from one with just creating ReShape new object.
  Standard_EXPORT virtual TopoDS_Shape ProcessShape (
      const TopoDS_Shape& shape, const Standard_Real Prec, const Standard_Real MaxTol,
      const Standard_CString rscfile, const Standard_CString seq, Handle(Standard_Transient)& info,
      const TopoDS_Shape& theShape, const Standard_Real thePrec, const Standard_Real theMaxTol,
      const Standard_CString thePrscfile, const Standard_CString thePseq, Handle(Standard_Transient)& theInfo,
      const Message_ProgressRange& theProgress = Message_ProgressRange(),
      const Standard_Boolean NonManifold = Standard_False) const;
      const Standard_Boolean theNonManifold = Standard_False,
      const Handle(ShapeBuild_ReShape)& theReShape = nullptr) const;

src/XSAlgo/XSAlgo_AlgoContainer.cxx
If you start to update one method, make it fully.

git

2023-02-16 16:22

administrator   ~0113155

Branch CR23638 has been updated forcibly by DenisOrlov.

SHA-1: 44753060f8593659dbec814563ab7668ad57e1bb

DenisOrlov

2023-02-23 11:59

developer   ~0113197

Dear ika, please review: OCCT: CR23638 PROD: NO
Most of builds are ok,
http://jenkins-test-10.nnov.opencascade.com/view/CR23638-master-DenisOrlov/view/PRODUCTS%20compile/
Tests relevant to the bug are passed.
http://jenkins-test-10.nnov.opencascade.com/view/CR23638-master-DenisOrlov/view/COMPARE/
I Removed double healing of Iges group entities.

dpasukhi

2023-02-23 12:20

developer   ~0113198

Dear @DenisOrlov
There a few remarks, please check

src/IGESData/IGESData_IGESModel.hxx
Not clear, what step is means?
-
+  //! Returns ReShape fixed on previous step
+  Handle(ShapeBuild_ReShape) ReShape() { return myReShape; };

src/IGESToBRep/IGESToBRep_Actor.cxx
Why you change code style?
-    shape = XSAlgo::AlgoContainer()->ProcessShape( shape, theeps, CAS.GetMaxTol(), 
-                                                   "read.iges.resource.name", 
-                                                   "read.iges.sequence", info,
-                                                   aPS.Next());
+    shape = XSAlgo::AlgoContainer()->ProcessShape(
+      shape, theeps, CAS.GetMaxTol(), 
+      "read.iges.resource.name", "read.iges.sequence",
+      info, mymodel->ReShape(), aPS.Next());

src/IGESToBRep/IGESToBRep_CurveAndSurface.cxx
I can't find any changes. Please revert or upgrade code style on each line that you update(not recommended).

src/ShapeFix/ShapeFix_Shape.cxx
Please put simple checking on the first position.
-  if(myMapFixingShape.Contains(aShapeNullLoc)) {
-    myShape.Location(L, Standard_False);
+  if( myMapFixingShape.Contains( aShapeNullLoc ) || isRecorded ) {
+    myShape.Location( L, Standard_False );

Please make const
+  Standard_Boolean isRecorded = Context()->IsNewShape(myShape);

src/XSAlgo/XSAlgo_AlgoContainer.cxx
You try to update code style. But not fully. Revert changes and apply only needed changes or make fully rework of tached methods.

Why you split first parameter on the next line?
+  return ProcessShape(
+    theShape, thePrec, theMaxTol, thePrscfile,
+    thePseq, theInfo, aReShape, theProgress, theNonManifold);

src/XSAlgo/XSAlgo_AlgoContainer.hxx
Where is any description?
+
+  Standard_EXPORT virtual TopoDS_Shape ProcessShape(
+    const TopoDS_Shape& theShape, const Standard_Real thePrec, const Standard_Real theMaxTol,
+    const Standard_CString thePrscfile, const Standard_CString thePseq, Handle(Standard_Transient)& theInfo,
+    const Handle(ShapeBuild_ReShape)& theReShape,
+    const Message_ProgressRange& theProgress = Message_ProgressRange(),
+    const Standard_Boolean theNonManifold = Standard_False) const;

tests/bugs/iges/bug23638
Why you remove this?
-param read.surfacecurve.mode -3

Why you chose 22487?
TODO OCC11111, means that this bug should be fixed in the 11111
If it should be fixed put OCC00000
+puts "TODO OCC22487 ALL: Faulty shapes in variables faulty_1 to faulty_1"

dpasukhi

2023-02-23 13:37

developer   ~0113200

An addition remark,
Please update summary of the commit description, you forgot "Data Exchange"
0023638: Data Exchange - Reading IGES file produced invalid shape

git

2023-02-27 15:06

administrator   ~0113206

Branch CR23638 has been updated forcibly by DenisOrlov.

SHA-1: e81bb6021eb844e4c22106a95a385f4018ec1a21

DenisOrlov

2023-02-27 15:24

developer   ~0113207

param read.surfacecurve.mode -3
forces opencascade not to read 2d curves from a source file, but create it from the edges instead,
most of time it works well, but in very specific cases, when a surface is created from a revolved curve and the edge is very close to the center of rotation, the resulting 2d curve is wrong.
And that's the case of the current bug.
So, the main recommendation here is not to set this parameter to -3.

dpasukhi

2023-02-27 16:49

developer   ~0113209

Last edited: 2023-02-27 16:53

Dear @DenisOrlov
All remarks for the src/XSAlgo/XSAlgo_AlgoContainer.cxx are not done.
Please check. For all updated line you are an author. So you need to update names and code style.

src/IGESData/IGESData_IGESModel.hxx
There the general name is Gets. I think it will be better. And a desctiption are not clearly.
And we need to add set, I think.
For example, (it is just recommnedation)
const Handle(ShapeBuild_ReShape)& ReShape() const { return }
void SetReShape(const Handle(ShapeBuild_ReShape)& theReShape) { = }
@@ -151,8 +151,8 @@ public:
   //! i.e. a string "Dnn" with nn = directory entry number (2*N-1)
   Standard_EXPORT Handle(TCollection_HAsciiString) StringLabel (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
 
-
-
+  //! Returns ReShape fixed on previous step of healing
+  Handle(ShapeBuild_ReShape) ReShape() { return myReShape; };

git

2023-02-27 17:12

administrator   ~0113210

Branch CR23638 has been updated forcibly by DenisOrlov.

SHA-1: 5d0fbfcb7e32ee3ad817df4a01e168d2967aee53

git

2023-02-27 19:10

administrator   ~0113212

Branch CR23638 has been updated forcibly by DenisOrlov.

SHA-1: e885cebdbad70a6428424edac2eedd4706caa26b

Issue History

Date Modified Username Field Change
2012-12-13 11:25 szv New Issue
2012-12-13 11:25 szv Assigned To => gka
2012-12-17 17:14 szv File Added: cadbad.zip
2017-07-24 18:50 git Note Added: 0068647
2017-07-24 18:53 mkv Test case number => bugs iges bug23638
2017-07-27 18:15 mkv Note Added: 0068812
2017-07-28 10:20 git Note Added: 0068826
2022-12-07 12:20 ika Assigned To gka => DenisOrlov
2023-01-13 16:25 git Note Added: 0112799
2023-01-19 12:25 git Note Added: 0112882
2023-01-19 13:20 dpasukhi Summary Reading IGES file produced invalid shape => Data Exchange, Iges Import - Reading IGES file produced invalid shape
2023-01-19 13:20 dpasukhi Summary Data Exchange, Iges Import - Reading IGES file produced invalid shape => Data Exchange - Reading IGES file produced invalid shape
2023-01-24 19:11 eugeny.belousov_162739 Target Version => 7.7.1
2023-01-25 12:57 git Note Added: 0112984
2023-02-06 14:28 git Note Added: 0113083
2023-02-10 19:29 git Note Added: 0113113
2023-02-14 18:34 git Note Added: 0113138
2023-02-14 18:41 dpasukhi Note Added: 0113139
2023-02-16 16:22 git Note Added: 0113155
2023-02-23 11:59 DenisOrlov Assigned To DenisOrlov => ika
2023-02-23 11:59 DenisOrlov Status new => resolved
2023-02-23 11:59 DenisOrlov Steps to Reproduce Updated
2023-02-23 11:59 DenisOrlov Note Added: 0113197
2023-02-23 12:03 dpasukhi Assigned To ika => dpasukhi
2023-02-23 12:20 dpasukhi Note Added: 0113198
2023-02-23 12:20 dpasukhi Assigned To dpasukhi => DenisOrlov
2023-02-23 12:20 dpasukhi Status resolved => assigned
2023-02-23 13:37 dpasukhi Note Added: 0113200
2023-02-27 15:06 git Note Added: 0113206
2023-02-27 15:24 DenisOrlov Assigned To DenisOrlov => ika
2023-02-27 15:24 DenisOrlov Status assigned => resolved
2023-02-27 15:24 DenisOrlov Note Added: 0113207
2023-02-27 16:49 dpasukhi Note Added: 0113209
2023-02-27 16:52 dpasukhi Note Edited: 0113209
2023-02-27 16:53 dpasukhi Note Edited: 0113209
2023-02-27 17:12 git Note Added: 0113210
2023-02-27 17:46 dpasukhi Relationship added related to 0033338
2023-02-27 19:10 git Note Added: 0113212
2023-03-06 18:55 eugeny.belousov_162739 Target Version 7.7.1 => 7.8.0
2023-03-14 15:42 ika Assigned To ika => dpasukhi