// corresponding reps and fix case of inversion error
Handle(StepGeom_Axis2Placement3d) org = Origin;
Handle(StepGeom_Axis2Placement3d) trg = Target;
- Standard_Integer code1=0, code2=0, i;
- for ( i=1; code1 != 1 && i <= OrigContext->NbItems(); i++ ) {
- if ( OrigContext->ItemsValue(i) == org ) code1 = 1;
- else if ( OrigContext->ItemsValue(i) == trg ) code1 = -1;
+ Standard_Boolean isOKOrigin = Standard_False, isSwapOrigin = Standard_False;
+ Standard_Boolean isOKTarget = Standard_False, isSwapTarget = Standard_False;
+ for (Standard_Integer i=1; i <= OrigContext->NbItems(); i++)
+ {
+ if (OrigContext->ItemsValue(i) == org)
+ isOKOrigin = Standard_True;
+ else if (OrigContext->ItemsValue(i) == trg)
+ isSwapTarget = Standard_True;
}
- for ( i=1; code2 != 1 && i <= TargContext->NbItems(); i++ ) {
- if ( TargContext->ItemsValue(i) == org ) code2 = -1;
- else if ( TargContext->ItemsValue(i) == trg ) code2 = 1;
+ for (Standard_Integer i=1; i <= TargContext->NbItems(); i++)
+ {
+ if (TargContext->ItemsValue(i) == trg)
+ isOKTarget = Standard_True;
+ else if (TargContext->ItemsValue(i) == org)
+ isSwapOrigin = Standard_True;
}
- if ( code1 != 1 && code2 != 1 ) {
- if ( code1 == -1 && code2 == -1 ) {
- Handle(StepGeom_Axis2Placement3d) swp = org; org = trg; trg = swp;
+ if (! isOKOrigin || ! isOKTarget)
+ {
+ if (isSwapOrigin && isSwapTarget)
+ {
+ std::swap (org, trg);
TP->AddWarning ( org, "Axis placements are swapped in SRRWT; corrected" );
}
- else {
- TP->AddWarning ( ( code1 == 1 ? trg : org ),
+ else
+ {
+ TP->AddWarning ( (isOKOrigin ? trg : org),
"Axis placement used by SRRWT does not belong to corresponding representation" );
}
}
--- /dev/null
+puts "# ====================================================================="
+puts "# 30087: Data Exchange, STEP - invalid result of translation of assembly when relating and related products are mixed in the SRR entity"
+puts "# ====================================================================="
+puts ""
+
+set filepath [locate_data_file bug30087.stp]
+stepread $filepath a *
+tpcompound result
+
+puts "Check dimensions of the result -- will be different if some parts are misplaced"
+set values [bounding result]
+set expected { -0.66 -0.33 -11. 70.66 140.66 10. }
+set components {XMin YMin ZMin XMax YMax ZMax }
+for {set i 0} {$i < 6} {incr i} {
+ checkreal [lindex $components $i] [lindex $values $i] [lindex $expected $i] 0.1 0
+}
+
+puts "Make snapshot to have visual check as well"
+checkview -display result -2d -path ${imagedir}/${test_image}.png
# !!!! This file is generated automatically, do not edit manually! See end script
-puts "TODO CR23096 ALL: TPSTAT : Faulty"
puts "TODO CR23096 ALL: NBSHAPES : Faulty"
puts "TODO CR23096 ALL: LABELS : Faulty"
puts "TODO CR23096 ALL: LAYERS : Faulty"
set ref_data {
DATA : Faulties = 0 ( 0 ) Warnings = 0 ( 0 ) Summary = 0 ( 0 )
-TPSTAT : Faulties = 0 ( 0 ) Warnings = 16 ( 8 ) Summary = 16 ( 8 )
+TPSTAT : Faulties = 0 ( 0 ) Warnings = 16 ( 40 ) Summary = 16 ( 40 )
CHECKSHAPE : Wires = 0 ( 0 ) Faces = 0 ( 0 ) Shells = 0 ( 0 ) Solids = 0 ( 0 )
NBSHAPES : Solid = 60 ( 3 ) Shell = 60 ( 3 ) Face = 2526 ( 504 )
STATSHAPE : Solid = 114 ( 114 ) Shell = 114 ( 114 ) Face = 4044 ( 4044 ) FreeWire = 0 ( 0 )