DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0033900

Bad STEP import

CommunityOCCT:Modeling Algorithmsfeedback1 public note

Search issues

Description

Hello,

The attached file is well seen on some CAD softwares, but import it with OCC gives a flat surface instead on a volume with 20 um of thickness.

Steps to reproduce

This code allows to scale the shape and see clearly the (bad) result :
        STEPControl_Reader reader ;
        reader.ReadFile("C:\\Attachment 1 (STEP)") ;
        reader.TransferRoots() ;
        TopoDS_Shape shape = reader.OneShape() ;

        // Scale
        gp_GTrsf gtrsf ;
        gtrsf.SetValue(1, 1, 1000.0) ;
        gtrsf.SetValue(2, 2, 1.0) ;
        gtrsf.SetValue(3, 3, 1.0) ;

        BRepBuilderAPI_GTransform gtr(shape, gtrsf, true) ;
        TopoDS_Shape scaledShape = gtr.Shape() ;

        // Save
        STEPControl_Writer writer ;
        writer.Transfer(scaledShape, STEPControl_AsIs) ;
        writer.Write("C:\\CU_scaled.STEP") ;

Public activity

1 archived note

Participants are labeled by their role within this record.

01Commenter 1
Dear Author,

I have investigated this issue, and the summary is that the OCCT's behavior is completely valid on this input data.
I also checked some other viewers (ODA Viewer and Autodesk online), and they also don't show any volume.

Here is the explanation of the file's invalidity (sorry, I deleted all the "#" from the citations from the file; otherwise, they were interpreted as another mantis issues and made the text unreadable):
The shape consists of one solid, which consists of one shell, and the shell consists of two faces:
274 = MANIFOLD_SOLID_BREP ( 'Importée1', 735 );
735 = CLOSED_SHELL ( 'NONE', ( 797, 161 ) ) ;
797 = ADVANCED_FACE ( 'NONE', ( 423, 846, 428, 786, 82, 635, 645 ), 152, .T. ) ;
161 = ADVANCED_FACE ( 'NONE', ( 613, 195, 107, 337, 479, 902, 125 ), 827, .F. ) ;

These faces are lying on the two parallel planes with a 0.2mm distance between them.
152 = PLANE ( 'NONE',  826 ) ;
827 = PLANE ( 'NONE',  706 ) ;

The problem is that there are no "walls" between these two "top" and "bottom" faces. Our STEP reader cannot imagine them, and in the attempt to fix the obviously invalid solid, it "merges" both faces into one with a tolerance value of 0.2. I will not say that such a solid is a good shape, but there is no possibility to read it "normally" with the given input data.

Related records