step-examples/12-3a-shells/Tsh257.stp
Sources
- occt-coverage PARTIAL audit, work packet A4 item `stp-partial-assembly-continuation`, `exchange/problems.json` `stp-partial-assembly-continuation` (`StepToTopoDS_Builder::Init(GeometricSet)`, `StepToTopoDS_Builder.cxx:742-756` — per-patch loop over `RCS->NbSegmentsI()/NbSegmentsJ()`, `TranslateBoundedSurf` called per patch, `if (!f.IsNull()) B.Add(C,f)` silently skips a patch whose face build failed). Mirror Bo002 demonstrates the analogous fatal-outer-shell case for `MANIFOLD_SOLID_BREP`
- this class's `RECTANGULAR_COMPOSITE_SURFACE` failing-patch subvariant was previously unrepresented in the live corpus.
Description
A `RECTANGULAR_COMPOSITE_SURFACE` (inside a bare `GEOMETRIC_SET`) has two `SURFACE_PATCH` segments: a GOOD patch whose `parent_surface` is a `RECTANGULAR_TRIMMED_SURFACE` wrapping a `PLANE` (a genuine `Geom_BoundedSurface`, `[0,5]x[0,5]`), and a BAD patch whose `parent_surface` is a raw, un-trimmed `PLANE` entity directly — an illegal type for `surface_patch.parent_surface` (EXPRESS type `bounded_surface`; `PLANE` alone is an elementary, unbounded surface). The low-level STEP entity reader hard-flags the bad `SURFACE_PATCH` ("Entity has illegal type") and it never resolves, so the per-patch loop simply never produces a face for it, while the good patch's face is built normally.
Reproducer recipe
`#6=RECTANGULAR_TRIMMED_SURFACE('',#5,0.0,5.0,0.0,5.0,.T.,.T.)` (`#5` a `PLANE`); `#7=SURFACE_PATCH(#6,.CONTINUOUS.,.CONTINUOUS.,.T.,.T.)` (good). `#12=PLANE('bad_patch_surface',#11)` (raw, unbounded); `#13=SURFACE_PATCH(#12,.CONTINUOUS.,.CONTINUOUS.,.T.,.T.)` (bad — illegal `parent_surface` type). `#14=RECTANGULAR_COMPOSITE_SURFACE('tsh257_rcs',((#7),(#13)))`, wrapped in `GEOMETRIC_SET('tsh257_gs',(#14))` inside a `MANIFOLD_SURFACE_SHAPE_REPRESENTATION`.
Expected kernel behavior
the bounded-surface translation step is only reachable for patches whose `parent_surface` resolved to a valid surface entity of bounded kind; a patch whose declared attribute type is wrong is dropped by the low-level reader before ever reaching that step, and the surrounding composite-surface per-patch loop simply produces one fewer face in its output compound rather than failing the whole composite surface or the whole model.
Notes
Live-verified (this worktree's OCP/OCCT 7.8.1): the low-level entity-check pass on this fixture shows a hard `F:SURFACE_PATCH: Parameter n0.1 (parent_surface) : Entity has illegal type` check specifically on the bad patch's entity, confirming the low-level reader itself rejects it (not merely a downstream geometric-construction failure). The reader's root-transfer step nonetheless returns 1 transferred root and 1 output shape, with the resulting shape carrying exactly 1 face / 4 edges (the trim-rectangle boundary the face-builder auto-generates for the surviving patch) / 8 (raw) vertices, `face[0].surface_type == "plane"`, `brepcheck.valid == True` — confirming the good patch alone survived and the bad patch was silently skipped, not fatal to the model. Synonyms: "RectangularCompositeSurface drops failed patch", "surface_patch illegal parent_surface type skipped", "composite surface partial continuation", "one bad patch doesn't sink the whole composite surface", "bounded_surface type violation silently dropped". Provenance tier: bytes-sufficient.
Expected validation
occt=shape(1)/shape(1) gmsh=shape(9) ifc=schema_n/a
Byte assertions
contains(b'tsh257_rcs')contains(b'good_patch_surface')contains(b'bad_patch_surface')count_entity_def(b'SURFACE_PATCH') == 2contains(b'RECTANGULAR_COMPOSITE_SURFACE')
Tier-3 assertions
shape_null == Falsen_faces_total == 1n_edges_total == 4n_vertices_total == 8face[0].surface_type == "plane"brepcheck.valid == True
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Tsh257: TEST - RECTANGULAR_COMPOSITE_SURFACE with one good patch (RECTANGULAR_TRIMMED_SURFACE wrapping a PLANE) and one failing patch (raw unbounded PLANE as parent_surface, illegal type for surface_patch.parent_surface) inside a bare GEOMETRIC_SET */ 3HEADER; 4FILE_DESCRIPTION(('Tsh257'),'2;1'); 5FILE_NAME('Tsh257.stp','2026-07-13T00: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/* good patch: RECTANGULAR_TRIMMED_SURFACE wrapping a PLANE, bounded [0,5]x[0,5] -- a 11 genuine Geom_BoundedSurface, so TranslateBoundedSurf builds a real TopoDS_Face */ 12#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 13#2=DIRECTION('',(0.0,0.0,1.0)); 14#3=DIRECTION('',(1.0,0.0,0.0)); 15#4=AXIS2_PLACEMENT_3D('',#1,#2,#3); 16#5=PLANE('good_patch_surface',#4); 17#6=RECTANGULAR_TRIMMED_SURFACE('',#5,0.0,5.0,0.0,5.0,.T.,.T.); 18#7=SURFACE_PATCH(#6,.CONTINUOUS.,.CONTINUOUS.,.T.,.T.); 19/* bad patch: raw unbounded PLANE used directly as parent_surface -- illegal type 20 for the surface_patch.parent_surface (bounded_surface) attribute; the low-level 21 STEP reader flags this SURFACE_PATCH with a hard FAIL and the entity never 22 resolves, so RectangularCompositeSurface's per-patch loop simply skips it 23 (TranslateBoundedSurf never even runs for it) while the good patch survives. */ 24#8=CARTESIAN_POINT('',(10.0,0.0,0.0)); 25#9=DIRECTION('',(0.0,0.0,1.0)); 26#10=DIRECTION('',(1.0,0.0,0.0)); 27#11=AXIS2_PLACEMENT_3D('',#8,#9,#10); 28#12=PLANE('bad_patch_surface',#11); 29#13=SURFACE_PATCH(#12,.CONTINUOUS.,.CONTINUOUS.,.T.,.T.); 30#14=RECTANGULAR_COMPOSITE_SURFACE('tsh257_rcs',((#7),(#13))); 31#15=GEOMETRIC_SET('tsh257_gs',(#14)); 32#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 33#9051=PRODUCT('Tsh257','Tsh257','',(#9050)); 34#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 35#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 36#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 37#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 38#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 39#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 40#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 41#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value',''); 42#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 43#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#15),#9060); 44#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 45ENDSEC; 46END-ISO-10303-21;