step-examples/12-7-pmi/Pmi139.stp
Sources
- HOOPS Exchange fixed-bugs list 2024, SDHE-36465
- https://docs.techsoft3d.com/exchange/2024/fixed_bugs.html
Description
A STEP AP242 file (modeled on HOOPS Exchange SDHE-36465) where a `DRAUGHTING_ANNOTATION_OCCURRENCE` entity is emitted in the DATA section with no reference from any `DRAUGHTING_MODEL` or `MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION` (orphan — not reachable from the model shape tree). Additionally the entity record has an attribute-count mismatch: four arguments instead of the expected three (extra trailing `$`). A correctly-formed annotation is also present and wired into a `DRAUGHTING_MODEL`. The pre-fix HOOPS Exchange writer emitted exactly this pattern when an annotation write pass started but the parent reference was lost mid-stream. Downstream parsers must skip the malformed orphan with a diagnostic rather than crashing or accepting the corrupt record silently.
Reproducer recipe
STEP AP242 file with one valid `DRAUGHTING_ANNOTATION_OCCURRENCE` inside a `DRAUGHTING_MODEL`, and one orphan `DRAUGHTING_ANNOTATION_OCCURRENCE('orphan_annotation',(#psa),#poly,$)` with a trailing `$` argument and no parent `DRAUGHTING_MODEL` reference.
Expected kernel behavior
skip the malformed orphan entity with a `W_ANNOTATION_ORPHAN` or `E_ATTR_COUNT_MISMATCH` diagnostic; never crash; continue loading the valid annotation from the correctly-formed `DRAUGHTING_MODEL`.
Notes
STEP file containing a `DRAUGHTING_ANNOTATION_OCCURRENCE` that is not connected to any `DRAUGHTING_MODEL` and has an attribute-count mismatch (extra trailing `$`). **See also**: Pmi014, Pmi082, A020. B4 wave-4 commercial-tracker synthesis batch A (DEF-H). Synonyms: "orphan DRAUGHTING_ANNOTATION_OCCURRENCE", "unattached annotation occurrence", "annotation entity with no parent model reference", "STEP annotation syntax error with dangling occurrence", "SDHE-36465 annotation orphan".
Expected validation
occt=shape(1)/shape(1) gmsh=shape(1) ifc=schema_n/a
Byte assertions
count_entity_def(b'DRAUGHTING_ANNOTATION_OCCURRENCE') == 2contains(b'DRAUGHTING_MODEL')contains(b'orphan_annotation')
Tier-3 assertions
shape_null == Falsen_vertices_total == 1
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Pmi139: two DRAUGHTING_ANNOTATION_OCCURRENCE entities: one correctly wired into a DRAUGHTING_MODEL, one orphan with no parent reference AND an attribute count mismatch (extra trailing $); parsers must skip the malformed orphan with a diagnostic rather than crashing; GEOMETRIC_CURVE_SET IS model entity â OCC yields empty */ 3HEADER; 4FILE_DESCRIPTION(('Pmi139'),'2;1'); 5FILE_NAME('Pmi139.stp','2026-06-17T00:00:00',(''),(''),'cad-research-suite','',''); 6FILE_SCHEMA(('AP242_MANAGED_MODEL_BASED_3D_ENGINEERING_MIM_LF { 1 0 10303 442 1 1 4 }')); 7ENDSEC; 8DATA; 9#9000=APPLICATION_CONTEXT('mechanical design'); 10#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 11#2=GEOMETRIC_CURVE_SET('',(#1)); 12#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 13#9051=PRODUCT('Pmi139','Pmi139','',(#9050)); 14#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 15#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 16#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 17#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 18#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 19#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 20#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 21#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value',''); 22#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 23#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#2),#9060); 24#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 25#9063=PRESENTATION_STYLE_ASSIGNMENT($); 26#9064=CARTESIAN_POINT('',(0.0,0.0,0.0)); 27#9065=CARTESIAN_POINT('',(10.0,0.0,0.0)); 28#9066=POLYLINE('',(#9064,#9065)); 29#9067=DRAUGHTING_ANNOTATION_OCCURRENCE('valid_annotation',(#9063),#9066); 30#9068=DRAUGHTING_MODEL('pmi_view',(#9067),#9060); 31#9069=CARTESIAN_POINT('',(20.0,0.0,0.0)); 32#9070=CARTESIAN_POINT('',(30.0,0.0,0.0)); 33#9071=POLYLINE('',(#9069,#9070)); 34#9072=DRAUGHTING_ANNOTATION_OCCURRENCE('orphan_annotation',(#9063),#9071,$); 35ENDSEC; 36END-ISO-10303-21;