View Issue Details

IDProjectCategoryView StatusLast Update
0032928CommunityOCCT:Modeling Datapublic2022-04-13 08:40
Reporterkhara Assigned Tomsv 
PrioritynormalSeveritymajor 
Status newResolutionopen 
PlatformWindowsOSVC++ 2019 
Product Version7.6.1 
Summary0032928: BRep reader cannot strictly restore original geometry that has been written out
DescriptionWrite a topology using BRep_Tool::Write, then read it using BRep_Tool::Read, the read topology data may have small difference from the written one.

I researched cause of the issue, it was not in brep writer nor brep format, in brep reader.

When OCCT will restore gp_Dir value from input stream, three real values are read and those are given to gp_Dir.SetCoord method. In there, the three values are *modified* to satisfy the invariant condition of gp_Dir class (the norm of vector should be 1). That's why the original values in brep format will be often restored inexactly.

The problem is spreading to axis geometry classes (gp_Ax1, gp_Ax2, ...) because they depends on gp_Dir. Similar inexact restoration happens for transformation geometry classes (gp_Trsf and gp_Mat). Of couse 2d geometry classes also have same problems as 3d ones.

Binary brep reader (BinTools::Read) has same problem.
Steps To ReproduceRead test1.brep using BRepTools::Read, then write it. The written out result (test2.brep) has small differences in following places:

<3D circle Dx> and <3D circle Dy> in Circle - <3D curve record 2>.
2nd and 3rd <3D direction> in Sphere - < surface record 4 >.
TagsNo tags attached.
Test case number

Attached Files

  • GeomTools.diff (17,728 bytes)
  • BinTools.diff (20,837 bytes)
  • test1.brep (1,310 bytes)
  • test2.brep (1,334 bytes)

Activities

khara

2022-04-13 08:39

reporter   ~0107904

I've tried to create patch for OCCT to fix this issue, but couldn't complete it.
I post my incomplete patches for BRepTools and BinTools package.
(This patch does not contain fixes for gp_Trsf and gp_Mat classes)
GeomTools.diff (17,728 bytes)
BinTools.diff (20,837 bytes)

khara

2022-04-13 08:40

reporter   ~0107905

Reproduction samples.
test1.brep (1,310 bytes)
test2.brep (1,334 bytes)

Issue History

Date Modified Username Field Change
2022-04-13 08:34 khara New Issue
2022-04-13 08:34 khara Assigned To => msv
2022-04-13 08:39 khara Note Added: 0107904
2022-04-13 08:39 khara File Added: GeomTools.diff
2022-04-13 08:39 khara File Added: BinTools.diff
2022-04-13 08:40 khara Note Added: 0107905
2022-04-13 08:40 khara File Added: test1.brep
2022-04-13 08:40 khara File Added: test2.brep