step-examples/12-8-mixed/M197.stp
Sources
- 04-occt-translation.md (Q020)
- StepToTopoDS_TranslatePolyLoop.cxx:117-119 (consecutive-point comparison is by entity identity, not coordinate equality
- a repeat is skipped with a bare loop continue, leaving the running "previous point" unmoved so the next distinct point closes the gap cleanly).
Description
A faceted polygon boundary lists its points as a flat, closable loop. When the very same point entity appears twice in a row, building an edge between that pair would produce a zero-length edge with no useful geometry. Instead of doing that, the reader recognizes the immediate repeat and simply omits that one segment, so the resulting boundary is the honest polygon with the redundant vertex silently absorbed rather than a polygon with a degenerate stub edge in it.
Reproducer recipe
`FACETED_BREP` referencing a `CLOSED_SHELL` containing one `ADVANCED_FACE` on a `PLANE` whose `FACE_OUTER_BOUND` is a `POLY_LOOP` listing five point references for a four-corner unit square, where the second corner's point entity is listed twice in immediate succession (positions 2 and 3 of the flat point list both cite the same `CARTESIAN_POINT`).
Expected kernel behavior
recognize and skip the degenerate repeated-point segment, closing the loop across the gap; or reject the boundary as malformed if zero-length segments are not tolerated at all — either way, never silently build a zero-length edge into the result.
Notes
Synonyms: "faceted polygon repeats a point twice in a row", "degenerate polygon segment silently skipped", "same point entity referenced consecutively in a poly loop", "faceted brep avoids a zero-length edge from a duplicate vertex reference". Live-verified: the resulting boundary has exactly four edges (not five), area exactly matching the intended unit square, and the validity check reports the face as fully valid — confirming the redundant reference was cleanly absorbed rather than producing a corrupt loop. Mirrors M055, which uses four distinct points on a deliberately non-planar surface to test a different problem (the schema-illegal non-planar-face path); this entry keeps the surface planar and duplicates one point reference instead, isolating the degenerate-segment skip from the non-planar check.
Expected validation
occt=shape(1)/shape(1) gmsh=shape(9) ifc=schema_n/a
Byte assertions
contains(b'POLY_LOOP')matches(rb"POLY_LOOP\('dup_point_loop',\(#6,#7,#7,#8,#9\)\)")
Tier-3 assertions
shape_null == Falsen_faces_total == 1n_edges_total == 4face[0].surface_type == "plane"face[0].area == 1.0brepcheck.valid == True
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/* M197: FACETED_BREP POLY_LOOP listing the same CARTESIAN_POINT entity (#7) twice in immediate succession inside an otherwise clean planar unit-square boundary; input: AP214 file where a POLY_LOOP's flat point list repeats one point reference at two consecutive positions, which would otherwise produce a zero-length edge; StepToTopoDS_TranslatePolyLoop.cxx:117-119 compares consecutive point HANDLES (P1==P2, entity identity not coordinate equality) and skips building an edge for the repeated pair via a bare continue, leaving the point-pair index unmoved so the following real point closes the gap cleanly -- the resulting wire is the honest quadrilateral P0-P1-P2-P3-P0 with the degenerate segment silently omitted, not a zero-length stub edge; mirrors M055 (four distinct points, on a deliberately non-planar CYLINDRICAL_SURFACE to test a different problem, the schema-illegal-non-planar-face check) fixed by duplicating one point reference and keeping the surface planar so this fixture isolates the degenerate-segment skip cleanly from the non-planar-face mechanism; covers stp-polyloop-dup-point; synonyms: poly loop repeated consecutive point, degenerate polygon segment skipped, same cartesian point twice in poly loop, faceted brep zero-length edge avoided, polyloop consecutive duplicate vertex reference */ 3HEADER; 4FILE_DESCRIPTION(('M197'),'2;1'); 5FILE_NAME('M197.stp','2026-07-12T00: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.)); 11#2=DIRECTION('',(0.,0.,1.)); 12#3=DIRECTION('',(1.,0.,0.)); 13#4=AXIS2_PLACEMENT_3D('',#1,#2,#3); 14#5=PLANE('base_plane',#4); 15#6=CARTESIAN_POINT('p0',(0.,0.,0.)); 16#7=CARTESIAN_POINT('p1',(1.,0.,0.)); 17#8=CARTESIAN_POINT('p2',(1.,1.,0.)); 18#9=CARTESIAN_POINT('p3',(0.,1.,0.)); 19#10=POLY_LOOP('dup_point_loop',(#6,#7,#7,#8,#9)); 20#11=FACE_OUTER_BOUND('',#10,.T.); 21#12=ADVANCED_FACE('faceted_face_dup_point',(#11),#5,.T.); 22#13=CLOSED_SHELL('dup_point_shell',(#12)); 23#14=FACETED_BREP('faceted_brep_dup_point',#13); 24#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 25#9051=PRODUCT('M197','M197','',(#9050)); 26#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 27#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 28#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 29#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 30#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 31#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 32#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 33#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value',''); 34#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 35#9061=ADVANCED_BREP_SHAPE_REPRESENTATION('',(#14),#9060); 36#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 37ENDSEC; 38END-ISO-10303-21;