1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-16 10:08:36 +03:00

0031568: Data Exchange - invalid model produced after STEP import

Add protection against reference to reference in STEP import.
This commit is contained in:
ika 2020-05-18 16:21:22 +03:00 committed by bugmaster
parent faff37677c
commit ae58f70718
2 changed files with 16 additions and 1 deletions

View File

@ -810,9 +810,11 @@ TDF_Label STEPCAFControl_Reader::AddShape(const TopoDS_Shape &S,
TDF_Label subL = AddShape(Sub0, STool, NewShapesMap, ShapePDMap, PDFileMap, ShapeLabelMap);
if (!subL.IsNull()) {
TDF_Label instL = STool->AddComponent(L, subL, it.Value().Location());
if (!ShapeLabelMap.IsBound(it.Value())) {
ShapeLabelMap.Bind(it.Value(), instL);
}
}
}
if (SHAS.Length() > 0) STool->SetExternRefs(L, SHAS);
ShapeLabelMap.Bind(S, L);
//STool->SetShape ( L, S ); // it is necessary for assemblies OCC1747 // commemted by skl for OCC2941

13
tests/bugs/step/bug31568 Normal file
View File

@ -0,0 +1,13 @@
puts "================================================================="
puts "0031568: Data Exchange - invalid model produced after STEP import"
puts "================================================================="
pload DCAF
ReadStep D [locate_data_file bug31568_Konecranes_Sample_3D.stp]
set ref [XGetReferredShape D 0:1:1:41:11]
if {$ref != "0:1:1:23"} {
puts "Error: wrong reference in data model"
}
Close D