Ad133 — OCCT #1327 / FreeCAD #30266: OCCT 8.0 STEP writer regression drops curved-surface entities on re-export

§12.11 adversarial (sub-class: writer regression — curved-surface entity elision on re-export; version-specific to OCCT 8.0)

P0 — receiver crash / hang / OOM

round-trip adversarial

Sources

Sender

OCCT 8.0-based CAD/CAM tools re-exporting curved-surface STEP shapes via the C++ `STEPControl_Writer` API (FreeCAD, Salome-Platform, KiCad, and any downstream tool using OCCT 8.0's writer path); the INPUT file is a valid curved-surface STEP shape from any producer.

Description

STEP file with a single `ADVANCED_FACE` on a `CYLINDRICAL_SURFACE` (radius 5.0 mm, axis Z, 90-degree cylindrical patch from z=0 to z=10; boundary `EDGE_LOOP` = bottom arc + right vertical line + top arc + left vertical line). The input bytes are perfectly readable — geometry loads cleanly under any OCCT version. The defect surfaces downstream: on `write → reread` through OCCT 8.0's `STEPControl_Writer` C++ API path, the `CYLINDRICAL_SURFACE` entity reference is silently omitted from the output — the output STEP has an `ADVANCED_FACE` whose surface reference points at a null/missing entity, so a downstream slicer that consumes the re-exported STEP produces completely wrong toolpaths because the curved boundary vanished. OCCT 7.x writes the same source shape correctly; DRAW-path does not reproduce; regression is version-specific to OCCT 8.0.

Reproducer recipe

Standard OCCT-parseable STEP with an `ADVANCED_FACE` on a `CYLINDRICAL_SURFACE` (or `B_SPLINE_SURFACE_WITH_KNOTS`, or `CONICAL_SURFACE`, etc.); mixed-content shape acceptable (curved + planar faces); read via OCCT 8.0 C++ API path; re-export via `STEPControl_Writer::Write()`; compare curved-surface entity references between input and output.

Expected kernel behavior

OCCT 8.0's `STEPControl_Writer` must emit every curved-surface entity present in the source shape into the output STEP; regression fix must ensure `CYLINDRICAL_SURFACE`, `CONICAL_SURFACE`, `B_SPLINE_SURFACE_WITH_KNOTS`, etc. are all preserved on re-export.

Notes

OCCT #1327 / FreeCAD #30266. B4 wave-8 DEF-DDD. Confidence: MEDIUM — regression is confirmed in trackers but exact writer-code path is not root-caused; the fixture encodes the INPUT file (the defect surfaces downstream on `write → reread → compare-with-input` against an OCCT 8.0 kernel). Since we cannot run the pre-fix OCCT 8.0 writer inside CI, the fixture is a WRITER-INTENT specimen: any downstream tool re-exporting this shape through OCCT 8.0 would silently lose the `CYLINDRICAL_SURFACE`. Post-fix / OCCT 7.x reads the input shape correctly (shape(1)); the defect is invisible on the input side. Synonyms: "OCCT 8.0 writer regression", "STEPControl_Writer curved surface dropped", "FreeCAD #30266 cylinder writer bug", "CYLINDRICAL_SURFACE re-export silent loss OCCT 8.0", "toolpath vanishes on STEP round-trip", "OCCT #1327 writer". Provenance tier: writer-side (Q5 reclassification 2026-07-01).

Expected validation

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

Provenance tier

writer-side — defect not fully embodied in fixture bytes.

Byte assertions

Tier-3 assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* Ad133: OCCT #1327 / FreeCAD #30266 writer-regression INPUT: single ADVANCED_FACE on a CYLINDRICAL_SURFACE (a 90-degree curved patch, radius 5.0, axis Z, from z=0 to z=10); input bytes are perfectly readable; defect surfaces downstream — OCCT 8.0's STEPControl_Writer regression silently omits CYLINDRICAL_SURFACE entities on re-export via the C++ API path (as FreeCAD uses); OCCT 7.x writes the same shape correctly; a downstream slicer that consumes the re-exported STEP produces completely wrong toolpaths because the curved boundary vanished; DRAW-path does not reproduce; version-specific to OCCT 8.0; detected only on write→reread→compare-with-input; DEF-DDD; SHELL_BASED_SURFACE_MODEL IS model entity — OCC (reading input) yields shape(1) */
3HEADER;
4FILE_DESCRIPTION(('Ad133'),'2;1');
5FILE_NAME('Ad133.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=AXIS2_PLACEMENT_3D('',#1,#2,#3);
14#5=CYLINDRICAL_SURFACE('ad133_cylinder',#4,5.0);
15#6=CARTESIAN_POINT('',(5.0,0.0,0.0));
16#7=CARTESIAN_POINT('',(0.0,5.0,0.0));
17#8=CARTESIAN_POINT('',(0.0,5.0,10.0));
18#9=CARTESIAN_POINT('',(5.0,0.0,10.0));
19#10=VERTEX_POINT('',#6);
20#11=VERTEX_POINT('',#7);
21#12=VERTEX_POINT('',#8);
22#13=VERTEX_POINT('',#9);
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('ad133_bot_arc',#17,5.0);
28#19=EDGE_CURVE('',#10,#11,#18,.T.);
29#20=DIRECTION('',(0.0,0.0,1.0));
30#21=VECTOR('',#20,10.0);
31#22=LINE('',#7,#21);
32#23=EDGE_CURVE('',#11,#12,#22,.T.);
33#24=CARTESIAN_POINT('',(0.0,0.0,10.0));
34#25=DIRECTION('',(0.0,0.0,1.0));
35#26=DIRECTION('',(1.0,0.0,0.0));
36#27=AXIS2_PLACEMENT_3D('',#24,#25,#26);
37#28=CIRCLE('ad133_top_arc',#27,5.0);
38#29=EDGE_CURVE('',#12,#13,#28,.T.);
39#30=DIRECTION('',(0.0,0.0,-1.0));
40#31=VECTOR('',#30,10.0);
41#32=LINE('',#9,#31);
42#33=EDGE_CURVE('',#13,#10,#32,.T.);
43#34=ORIENTED_EDGE('',$,$,#19,.T.);
44#35=ORIENTED_EDGE('',$,$,#23,.T.);
45#36=ORIENTED_EDGE('',$,$,#29,.T.);
46#37=ORIENTED_EDGE('',$,$,#33,.T.);
47#38=EDGE_LOOP('',(#34,#35,#36,#37));
48#39=FACE_OUTER_BOUND('',#38,.T.);
49#40=ADVANCED_FACE('ad133_cyl_face',(#39),#5,.T.);
50#41=OPEN_SHELL('ad133_shell',(#40));
51#42=SHELL_BASED_SURFACE_MODEL('ad133_sbsm',(#41));
52#9050=PRODUCT_CONTEXT('',#9000,'mechanical');
53#9051=PRODUCT('Ad133','Ad133','',(#9050));
54#9052=PRODUCT_DEFINITION_FORMATION('','',#9051);
55#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design');
56#9054=PRODUCT_DEFINITION('','','',#9052,#9053);
57#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054);
58#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
59#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
60#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
61#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value','');
62#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D'));
63#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#42),#9060);
64#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061);
65ENDSEC;
66END-ISO-10303-21;