Tsh063 — Adjacent toroidal faces with identical parameters are not detected as same-surface

§12.3a shells/orientation

P1 — silent data loss

topology

Sources

Description

Two adjacent faces on the same `TOROIDAL_SURFACE` (e.g., a torus split into halves by a planar cut, both halves later resurrected) are not detected as sharing a surface because the surface-equality check uses pointer comparison rather than geometric equivalence. Both halves reference distinct `TOROIDAL_SURFACE` entities with identical parameters, so adjacent same-surface face merging skips them.

Reproducer recipe

Two `ADVANCED_FACE`s on two `TOROIDAL_SURFACE` entities with identical major / minor radius and identical `AXIS2_PLACEMENT_3D`. Same-surface check returns false; merge skipped.

Expected kernel behavior

Heal and accept: normalize the surface-equality check to compare structural parameters (axis, radii, etc.) rather than pointers; collapse named parameter equality to a single canonical surface.

Notes

**See also**: Tfa016, Tsh047. Synonyms: "duplicate torus surfaces not merged", "two halves of torus stay separate", "surface equality uses pointer not parameters", "identical TOROIDAL_SURFACE entities not detected as same", "torus halves don't unify".

Expected validation

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

Closure intent

ambiguous — the open shell is an incidental scaffold for a non-closure-related test.

Byte assertions

Tier-3 assertions

Cross-references

Tfa016, Tsh047

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* Tsh063: OPEN_SHELL with 2 ADVANCED_FACEs each on its own TOROIDAL_SURFACE entity; both TOROIDAL_SURFACE entities have IDENTICAL parameters (major=4.0, minor=1.0, same AXIS2_PLACEMENT_3D) but ARE distinct entities (different IDs); distinct TOROIDAL_SURFACE entities with identical parameters IS the mechanism; pointer-comparison surface-equality check returns false despite geometric identity; same-surface face merge is skipped; fix: compare surface parameters structurally (axis position, radii) not by pointer; collapse parametrically equal surfaces to one canonical entity */
3HEADER;
4FILE_DESCRIPTION(('Tsh063'),'2;1');
5FILE_NAME('Tsh063.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=DIRECTION('',(0.0,0.0,1.0));
12#3=DIRECTION('',(1.0,0.0,0.0));
13#4=CARTESIAN_POINT('',(0.0,0.0,0.0));
14#5=DIRECTION('',(0.0,0.0,1.0));
15#6=DIRECTION('',(1.0,0.0,0.0));
16#7=AXIS2_PLACEMENT_3D('',#4,#5,#6);
17#8=CARTESIAN_POINT('',(0.0,0.0,0.0));
18#9=DIRECTION('',(0.0,0.0,1.0));
19#10=DIRECTION('',(1.0,0.0,0.0));
20#11=AXIS2_PLACEMENT_3D('',#8,#9,#10);
21#12=TOROIDAL_SURFACE('',#7,4.0,1.0);
22#13=TOROIDAL_SURFACE('',#11,4.0,1.0);
23#14=CARTESIAN_POINT('',(0.0,0.0,0.0));
24#15=DIRECTION('',(0.0,0.0,1.0));
25#16=DIRECTION('',(1.0,0.0,0.0));
26#17=AXIS2_PLACEMENT_3D('',#14,#15,#16);
27#18=CIRCLE('',#17,4.0);
28#19=CARTESIAN_POINT('',(4.0,0.0,0.0));
29#20=VERTEX_POINT('',#19);
30#21=CARTESIAN_POINT('',(4.0,0.0,0.0));
31#22=VERTEX_POINT('',#21);
32#23=EDGE_CURVE('',#20,#22,#18,.T.);
33#24=ORIENTED_EDGE('',$,$,#23,.T.);
34#25=EDGE_LOOP('',(#24));
35#26=FACE_OUTER_BOUND('',#25,.T.);
36#27=ADVANCED_FACE('',(#26),#12,.T.);
37#28=ORIENTED_EDGE('',$,$,#23,.F.);
38#29=EDGE_LOOP('',(#28));
39#30=FACE_OUTER_BOUND('',#29,.T.);
40#31=ADVANCED_FACE('',(#30),#13,.T.);
41#32=OPEN_SHELL('',(#27,#31));
42#33=SHELL_BASED_SURFACE_MODEL('',(#32));
43#9050=PRODUCT_CONTEXT('',#9000,'mechanical');
44#9051=PRODUCT('Tsh063','Tsh063','',(#9050));
45#9052=PRODUCT_DEFINITION_FORMATION('','',#9051);
46#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design');
47#9054=PRODUCT_DEFINITION('','','',#9052,#9053);
48#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054);
49#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
50#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
51#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
52#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value','');
53#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D'));
54#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#33),#9060);
55#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061);
56ENDSEC;
57END-ISO-10303-21;