Tsh177 — ShapeFix_Shell.Perform infinite-loop-detection

§12.3a

topology

Sources

Description

ShapeFix_Shell.Perform infinite-loop-detection

Reproducer recipe

Expected kernel behavior

face_fwd and face_rev both bound the same triangle using the identical three EDGE_CURVE entities (e_ab, e_bc, e_ca), but face_fwd's loop uses all three with .T. sense (same_sense=.T., normal +Z) while face_rev's uses all three with .F. (same_sense=.F., normal -Z) — every shared edge is used with the same absolute sense in both faces rather than opposite senses, so no consistent flip of either face alone resolves it. Detect that a shared-edge sense conflict cannot be resolved by unilaterally flipping one side before attempting to iterate a fix, and bound any iterative orientation-fix loop by a fixed pass limit that reports non-convergence explicitly rather than looping until an internal counter silently exhausts.

Expected validation

occt=shape(1)/shape(1) gmsh=shape(8) ifc=schema_n/a

Tier-3 assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes
1ISO-10303-21;
2/* Tsh177: TWO ADVANCED_FACEs sharing SAME TRIANGULAR EDGE_CURVEs with OPPOSITE same_sense — IS the infinite-loop-detection mechanism; e_ab IS EDGE_CURVE from (0,0,0) to (1,0,0) — shared by both faces; e_bc IS EDGE_CURVE from (1,0,0) to (0.5,1,0) — shared by both faces; e_ca IS EDGE_CURVE from (0.5,1,0) to (0,0,0) — shared by both faces; face_fwd IS wired with loop_fwd (e_ab .T., e_bc .T., e_ca .T.) same_sense=True — normal +Z; face_rev IS wired with loop_rev (e_ab .F., e_bc .F., e_ca .F.) same_sense=False — normal -Z; both ADVANCED_FACEs reference THE SAME EDGE_CURVE entities — IS the shared loop; fixing face_fwd orientation invalidates face_rev — IS the first oscillation step; fixing face_rev re-invalidates face_fwd — IS the second oscillation step; Perform counter-based loop detection exhausts limit before convergence — IS the defect; fix: detect conflicting same_sense on shared edges before fix loop; emit E_PERFORM_LOOP_DETECTED when counter exceeds threshold without convergence */
3HEADER;
4FILE_DESCRIPTION(('Tsh177'),'2;1');
5FILE_NAME('Tsh177.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','','');
6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
7ENDSEC;
8DATA;
9#9000=APPLICATION_CONTEXT('mechanical design');
10#1=CARTESIAN_POINT('',(0.0,0.0,0.0));
11#2=CARTESIAN_POINT('',(1.0,0.0,0.0));
12#3=CARTESIAN_POINT('',(0.5,1.0,0.0));
13#4=VERTEX_POINT('',#1);
14#5=VERTEX_POINT('',#2);
15#6=VERTEX_POINT('',#3);
16#7=DIRECTION('',(1.0,0.0,0.0));
17#8=VECTOR('',#7,1.0);
18#9=LINE('',#1,#8);
19#10=EDGE_CURVE('',#4,#5,#9,.T.);
20#11=DIRECTION('',(-0.5,1.0,0.0));
21#12=VECTOR('',#11,1.0);
22#13=LINE('',#2,#12);
23#14=EDGE_CURVE('',#5,#6,#13,.T.);
24#15=DIRECTION('',(-0.5,-1.0,0.0));
25#16=VECTOR('',#15,1.0);
26#17=LINE('',#3,#16);
27#18=EDGE_CURVE('',#6,#4,#17,.T.);
28#19=ORIENTED_EDGE('',$,$,#10,.T.);
29#20=ORIENTED_EDGE('',$,$,#14,.T.);
30#21=ORIENTED_EDGE('',$,$,#18,.T.);
31#22=EDGE_LOOP('',(#19,#20,#21));
32#23=DIRECTION('',(0.0,0.0,1.0));
33#24=DIRECTION('',(1.0,0.0,0.0));
34#25=AXIS2_PLACEMENT_3D('',#1,#23,#24);
35#26=PLANE('',#25);
36#27=FACE_OUTER_BOUND('',#22,.T.);
37#28=ADVANCED_FACE('',(#27),#26,.T.);
38#29=ORIENTED_EDGE('',$,$,#18,.F.);
39#30=ORIENTED_EDGE('',$,$,#14,.F.);
40#31=ORIENTED_EDGE('',$,$,#10,.F.);
41#32=EDGE_LOOP('',(#29,#30,#31));
42#33=DIRECTION('',(0.0,0.0,1.0));
43#34=DIRECTION('',(1.0,0.0,0.0));
44#35=AXIS2_PLACEMENT_3D('',#1,#33,#34);
45#36=PLANE('',#35);
46#37=FACE_OUTER_BOUND('',#32,.T.);
47#38=ADVANCED_FACE('',(#37),#36,.F.);
48#39=OPEN_SHELL('',(#28,#38));
49#40=SHELL_BASED_SURFACE_MODEL('',(#39));
50#9050=PRODUCT_CONTEXT('',#9000,'mechanical');
51#9051=PRODUCT('Tsh177','Tsh177','',(#9050));
52#9052=PRODUCT_DEFINITION_FORMATION('','',#9051);
53#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design');
54#9054=PRODUCT_DEFINITION('','','',#9052,#9053);
55#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054);
56#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
57#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
58#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
59#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value','');
60#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D'));
61#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#40),#9060);
62#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061);
63ENDSEC;
64END-ISO-10303-21;