Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in debug mode when reading NIST-PMI-STEP-example nist_stc_07_asme1_ap242-e3.stp #383

Open
T-Dunker opened this issue Feb 19, 2025 · 0 comments
Labels
0. New The issue was created, but not updated by maintainer. Waiting for updates labels and categories 1. Data Exchange Import/Export or iterating of the CAD data 2. Bug Something isn't working
Milestone

Comments

@T-Dunker
Copy link

Description

When reading nist_stc_07_asme1_ap242-e3.stp in debug mode there is an exception in src/STEPCAFControl/STEPCAFControl_Reader.cxx line 3007.

            gp_Ax2 anA(aPnt, aDir, aDirR);

This is a correct behavior, as the two passed directions are colinear. The reason are in lines 3004-6.

            aDir.SetCoord(aDirArr->Lower(), aDirArr->Lower() + 1, aDirArr->Lower() + 2);
            aDirR.SetCoord(aDirRArr->Lower(), aDirRArr->Lower() + 1, aDirRArr->Lower() + 2);
            aPnt.SetCoord(aLocArr->Lower(), aLocArr->Lower() + 1, aLocArr->Lower() + 2);

There one passes consecutive indices instead of values. These lines need to be replaced by

            aDir.SetCoord(aDirArr->Value(aDirArr->Lower()),
                          aDirArr->Value(aDirArr->Lower() + 1),
                          aDirArr->Value(aDirArr->Lower() + 2));
            aDirR.SetCoord(aDirRArr->Value(aDirRArr->Lower()),
                           aDirRArr->Value(aDirRArr->Lower() + 1),
                           aDirRArr->Value(aDirRArr->Lower() + 2));
            aPnt.SetCoord(aLocArr->Value(aLocArr->Lower()),
                          aLocArr->Value(aLocArr->Lower() + 1),
                          aLocArr->Value(aLocArr->Lower() + 2));

Expected Behavior

STEPCAFControl_Reader::Transfer() without problem

Actual Behavior

Step Reader: Failed to transfer nodes
gp_Dir::CrossCross() - result vector has zero norm

Sample Code or DRAW Tcl Script

Handle(TDocStd_Document) doc;
Handle(XCAFApp_Application) app = XCAFApp_Application::GetApplication();
app->NewDocument("MDTV-XCAF", doc);
STEPCAFControl_Reader reader;
reader.SetColorMode(true);
reader.SetNameMode(true);
reader.SetLayerMode(false);
const auto status = reader.ReadFile("nist_stc_07_asme1_ap242-e3.stp"); // status == IFSelect_RetDone
try
{
auto success = reader.Transfer(doc); // success != Standard_False
}
catch (const std::exception& ex)
{
std::cout << ex.what();
}

Operating System

Windows

Compiler

MSVC

Bitness

64-bit

OCCT Version

7.8

Additional Files

nist_stc_07_asme1_ap242-e3.zip

@T-Dunker T-Dunker added 0. New The issue was created, but not updated by maintainer. Waiting for updates labels and categories 2. Bug Something isn't working labels Feb 19, 2025
@dpasukhi dpasukhi added the 1. Data Exchange Import/Export or iterating of the CAD data label Feb 19, 2025
@dpasukhi dpasukhi added this to the Release 7.9.1 milestone Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. New The issue was created, but not updated by maintainer. Waiting for updates labels and categories 1. Data Exchange Import/Export or iterating of the CAD data 2. Bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants