N052 — BRepBuilderAPI_Sewing.SameParameterEdge SetMaxTolerance bypass

§12.4 (sub-class: api-contract-violation)

topology

Sources

Description

Direct BRep_TEdge::Tolerance() write at line 1168 bypasses the SetMaxTolerance API cap when computed tolerance exceeds the user-specified limit. The static_cast and raw TShape mutation circumvent the validation that UpdateEdge would perform, violating the API contract that SetMaxTolerance(cap) enforces cap on all merged edges.

Reproducer recipe

Construct two faces meeting at edges that need sewing with non-trivial discretized-curve tolerance path. Call `BRepBuilderAPI_Sewing sw; sw.SetMaxTolerance(0.01); sw.Add(shape); sw.Perform();` — when computed tolerance (0.05) exceeds cap, raw write at line 1168 creates edge with 0.05 tolerance, bypassing cap. Expected: cap enforcement nullifies edge or rejects computation.

Expected kernel behavior

reject raw tolerance write; enforce SetMaxTolerance cap via UpdateEdge API or nullify edge if tolerance exceeds cap

Notes

The `N052.stp` fixture documents the input geometry but the defect only manifests when paired with the `SetMaxTolerance(0.01)` runtime API call above. A passive STEP loader will not trigger the bypass; the consuming test harness must invoke `BRepBuilderAPI_Sewing` with an explicit cap. **See also**: N055.

Expected validation

occt=empty/empty gmsh=empty ifc=schema_n/a

Tier-3 assertions

Cross-references

N055

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes
1ISO-10303-21;
2/* N052: sewing input: two faces with 0.05 mm edge gap; SetMaxTolerance(0.01) is bypassed by raw TShape mutation at line 1168; GEOMETRIC_CURVE_SET — OCC yields empty */
3HEADER;
4FILE_DESCRIPTION(('N052'),'2;1');
5FILE_NAME('N052.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','','');
6FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
7ENDSEC;
8DATA;
9#1=CARTESIAN_POINT('f1_p00',(0.0,0.0,0.0));
10#2=CARTESIAN_POINT('f1_p10',(10.0,0.0,0.0));
11#3=CARTESIAN_POINT('f1_p11',(10.0,10.0,0.0));
12#4=CARTESIAN_POINT('f1_p01',(0.0,10.0,0.0));
13#5=CARTESIAN_POINT('f2_p00_gap',(0.0,0.0,0.05));
14#6=CARTESIAN_POINT('f2_p10_gap',(10.0,0.0,0.05));
15#7=VERTEX_POINT('v00',#1);
16#8=VERTEX_POINT('v10',#2);
17#9=VERTEX_POINT('v11',#3);
18#10=VERTEX_POINT('v01',#4);
19#11=VERTEX_POINT('vq00',#5);
20#12=VERTEX_POINT('vq10',#6);
21#13=DIRECTION('',(1.0,0.0,0.0));
22#14=VECTOR('',#13,10.0);
23#15=LINE('',#1,#14);
24#16=EDGE_CURVE('shared_e_f1',#7,#8,#15,.T.);
25#17=DIRECTION('',(1.0,0.0,0.0));
26#18=VECTOR('',#17,10.0);
27#19=LINE('',#5,#18);
28#20=EDGE_CURVE('shared_e_f2_gap',#11,#12,#19,.T.);
29#21=GEOMETRIC_CURVE_SET('sewing_input',(#16,#20));
30#22=APPLICATION_CONTEXT('automotive_design');
31#23=PRODUCT_CONTEXT('',#22,'mechanical');
32#24=PRODUCT('N052','N052','',(#23));
33#25=PRODUCT_DEFINITION_FORMATION('','',#24);
34#26=PRODUCT_DEFINITION_CONTEXT('part definition',#22,'design');
35#27=PRODUCT_DEFINITION('','',#25,#26);
36#28=PRODUCT_DEFINITION_SHAPE('','',#27);
37#29=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
38#30=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
39#31=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
40#32=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-6),#29,'distance_accuracy_value','model_precision');
41#33=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#32))GLOBAL_UNIT_ASSIGNED_CONTEXT((#29,#30,#31))REPRESENTATION_CONTEXT('ctx','3D'));
42#34=GEOMETRICALLY_BOUNDED_WIREFRAME_SHAPE_REPRESENTATION('',(#21),#33);
43#35=SHAPE_DEFINITION_REPRESENTATION(#28,#34);
44ENDSEC;
45END-ISO-10303-21;