View Issue Details

IDProjectCategoryView StatusLast Update
0032852CommunityOCCT:Modeling Datapublic2022-02-24 11:54
ReporterHeike Assigned Tomsv 
PrioritynormalSeveritymajor 
Status newResolutionopen 
PlatformLinuxOSDebian 6.0 
Product Version7.5.0 
Summary0032852: Read a bincad file throws an exception
DescriptionI write a CAD file with BinTools_ShapeSet, and when I read it back in it doesn't work.
Steps To Reproducewrite:

      BinTools_ShapeSet mySet;
    mySet.SetFormatNb(1);
    mySet.SetWithTriangles(false);

    mySet.Add(transformedShape);

    mySet.Index(transformedShape);

    std::ofstream out(stdFileName, std::ofstream::binary);


read:

std::filebuf fb;
    if (fb.open(stdFileName.c_str(), std::ios::in | std::ios::binary))
    {
        std::istream is(&fb);

        try {
            OCC_CATCH_SIGNALS
                mySet.Read(is);
        }

=====================
Draw script:
restore transformedShape_bug.brep a
binsave a transformedShape_bug.bbrep
binrestore transformedShape_bug.bbrep b

Output:
An exception was caught 000001B1A9F914A0 : Standard_Failure: EXCEPTION in BinTools_SurfaceSet::ReadSurface(..)
000001B1A9F92960 : Standard_ConstructionError: Offset with no C1 Surface
TagsNo tags attached.
Test case number

Attached Files

  • orig_geometry.x_t.tar.gz (1,076,852 bytes)
  • image.png (14,840 bytes)
  • transformedShape_bug.7z (1,571,680 bytes)

Activities

Heike

2022-02-22 16:44

reporter   ~0107033

The original file seems to be to big to get uploaded.
orig_geometry.x_t.tar.gz (1,076,852 bytes)

msv

2022-02-22 18:32

developer   ~0107035

Dear Heike,
Thank you for the described problem.
In order to make a complete code reproduce, could you attach here the BRep shape corresponding to the variable transformedShape in your code?

Heike

2022-02-22 19:03

reporter   ~0107036

I tried to upload the brep file (compressed), but the file exceeds the max size:
image.png (14,840 bytes)

kgv

2022-02-22 19:36

developer   ~0107037

@Heike have you tried using more modern compression algorithms like `tar.xz`? I guess that it may beat the difference to fit into current limits.
Otherwise - may you try sharing the file in some other way temporarily?

I would expect that problem should be reproducible with smaller data set, so that alternatively you may explode the shape and save a smaller .BREP.

Heike

2022-02-23 13:57

reporter   ~0107039

I tried xz now it the file is still slightly too large to upload. I am not sure how I should reduce this example. I run at the moment approx 1000 CAD files, and I see this only happening in a very few CAD models. So it must be related to what exactly is stored in these files. I will try to send the file via email to your support.....

msv

2022-02-24 00:18

developer   ~0107044

Email via support is too long way.
In order to reduce this file: suppose your shape is a compound of some other shapes. You can use TopoDS_Iterator to explode it on subshapes and save each subshape as individual shape in order to try reproducing on each of them. Using such approach you can reduce the reproducible shape to very small one.

kgv

2022-02-24 00:51

developer   ~0107045

By the way, it is also possible splitting tar.gz into multiple-file archive
https://unix.stackexchange.com/questions/61774/create-a-tar-archive-split-into-blocks-of-a-maximum-size

msv

2022-02-24 10:50

developer   ~0107047

I have obtained the file transformedShape_bug.brep.xz from our support. I have repacked it with 7-zip, and it takes now only 1.5Mb. So, I have attached it here.
transformedShape_bug.7z (1,571,680 bytes)

kgv

2022-02-24 10:55

developer   ~0107048

Draw[2]> XOpen {C:\work\Downloads\transformedShape_bug\transformedShape_bug222.xbf} D
BinDrivers_DocumentRetrievalDriver: error of Shape Section EXCEPTION in BinTools_SurfaceSet::ReadSurface(..)
0000013EA4C29B10 : Standard_ConstructionError: Offset with no C1 Surface

BinLDrivers_DocumentRetrievalDriver: warning: failure reading attribute TNaming_NamedShape

Issue History

Date Modified Username Field Change
2022-02-22 16:39 Heike New Issue
2022-02-22 16:39 Heike Assigned To => msv
2022-02-22 16:44 Heike Note Added: 0107033
2022-02-22 16:44 Heike File Added: orig_geometry.x_t.tar.gz
2022-02-22 18:32 msv Note Added: 0107035
2022-02-22 19:03 Heike Note Added: 0107036
2022-02-22 19:03 Heike File Added: image.png
2022-02-22 19:36 kgv Note Added: 0107037
2022-02-23 13:57 Heike Note Added: 0107039
2022-02-24 00:18 msv Note Added: 0107044
2022-02-24 00:51 kgv Note Added: 0107045
2022-02-24 10:50 msv Note Added: 0107047
2022-02-24 10:50 msv File Added: transformedShape_bug.7z
2022-02-24 10:55 kgv Note Added: 0107048
2022-02-24 11:46 msv Steps to Reproduce Updated
2022-02-24 11:47 msv Steps to Reproduce Updated