step-examples/12-2c-surfaces/Gs202.stp
Sources
- OCCT `StepToTopoDS_GeometricTool::UpdateParam3d` (`src/StepToTopoDS/StepToTopoDS_GeometricTool.cxx:294-337`, specifically the ordinary-(non-periodic, non-tolerance-closed)-B-spline fallback at `:329-337`: `else if (w1 > w2) { w1 = theCurve->ReversedParameter(w1)
- w2 = theCurve->ReversedParameter(w2)
- theCurve->Reverse()
- }`) @ `bd2a789f15235755ce4d1a3b07379a2e062fdc2e` (verified against source at this commit). This is the SAME function Gs029 (periodic wrap), Gs201 (bounded-curve clamp), and Twi086 (`w1==w2`) exercise — this fixture targets its curve-reversal fallback, reached only when the curve is `Geom_BSplineCurve`, genuinely NOT closed (`StartPoint().Distance(EndPoint())` well above tolerance — unlike Gs203/the tolerance-closed subvariant), and the vertex-projected parameters still come out reversed (`w1 > w2`).
Description
A single `ADVANCED_FACE` on a `PLANE` has one boundary edge whose 3D curve is a clamped, non-periodic, non-closed degree-3 `B_SPLINE_CURVE_WITH_KNOTS` (4 poles, single span, control points `(0,0,0)→(2,3,0)→(4,3,0)→(6,0,0)`, an open curved arc). The `EDGE_CURVE`'s own `VERTEX_POINT`s are SWAPPED relative to the curve's own parametrization: `edge_start` sits at the curve's TRUE end pole `(6,0,0)` and `edge_end` sits at the curve's TRUE start pole `(0,0,0)`. Vertex-to-curve projection is unambiguous (exact pole matches, 3D distance between the two poles is 6.0 — far beyond any tolerance, so this is NOT the tolerance-closed case), yielding `w1=1.0` (the curve's own last parameter) and `w2=0.0` (the curve's own first parameter) — a clean, confident, fully reversed-order result.
Reproducer recipe
`B_SPLINE_CURVE_WITH_KNOTS('name',3,(p0,p1,p2,p3),.UNSPECIFIED.,.F.,.F.,(4,4),(0.0,1.0),.UNSPECIFIED.)` as `EDGE_CURVE.edge_geometry`; `VERTEX_POINT`s at `p3`'s coordinates (edge_start) and `p0`'s coordinates (edge_end) — i.e. the edge's start/end vertices literally at the curve's own last/first control points, in that swapped order.
Expected kernel behavior
the edge-parameter-range repair stage must detect `w1 > w2` on this ordinary (non-periodic, non-tolerance-closed) B-spline curve and repair it by PHYSICALLY REVERSING the curve (flipping the pole/knot sequence) and remapping both parameters to their reversed equivalents — producing a curve whose own `[FirstParameter, LastParameter]` range is increasing again and whose endpoint values at the new range bounds match the edge's actual vertex coordinates, rather than either leaving the range inverted (undefined edge geometry) or silently swapping only the numeric values without re-orienting the underlying curve (which would misalign every intermediate sample point along the arc, not just the endpoints).
Notes
Live-verified directly against the fixture's own bytes (default read — this parameter-range repair runs unconditionally as part of ordinary edge translation): the resulting edge's 3D curve reports parameter range `(0.0, 1.0)` (increasing, confirming the reversal fix applied, not a raw `(1.0, 0.0)` inverted range); evaluating the (now-reversed) curve at its own new `w1=0.0` gives `(6.0, 0.0, 0.0)` — matching `edge_start`'s vertex coordinates exactly — and at `w2=1.0` gives `(0.0, 0.0, 0.0)` — matching `edge_end`'s vertex coordinates exactly — confirming the curve's pole sequence was genuinely reversed (not just the parameter labels), so every point along the arc (not only its endpoints) is now correctly oriented; the resulting face closes as a valid quadrilateral (one curved side), area `15.0`, `shape_null=False`. Fills `stp-edge-curve-param-range`'s previously-missing "reversed order on an ordinary curve → curve reversed and parameters swapped" subvariant (1 of 3 missing; see also Gs201, and the deferred tolerance-closed subvariant in `BACKLOG.md`). Synonyms: "EDGE_CURVE vertices swapped relative to B-spline parametrization", "edge-parameter-range repair's curve-reversal fallback", "curve physically reversed and parameters remapped as edge repair", "w1 greater than w2 ordinary non-periodic non-closed curve", "vertex-to-curve-direction mismatch physically reversed not just swapped".
Expected validation
occt=shape(1)/shape(1) gmsh=shape(9) ifc=schema_n/a
Byte assertions
contains(b'B_SPLINE_CURVE_WITH_KNOTS')count_entity_def(b'ADVANCED_FACE') == 1count_entity_def(b'VERTEX_POINT') == 4
Tier-3 assertions
load == "ok"shape_null == Falsen_faces_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/* Gs202: PLANE IS ADVANCED_FACE.face_geometry; defect EDGE_CURVE curve_3d IS a clamped, NON- 3 periodic, NON-closed degree-3 B_SPLINE_CURVE_WITH_KNOTS (4 poles, single span); the edge's own 4 VERTEX_POINTs are SWAPPED relative to the curve's own parametrization -- edge_start sits at the 5 curve's TRUE end pole (6,0,0) and edge_end sits at the curve's TRUE start pole (0,0,0) -- so 6 vertex projection yields w1=1.0 (curve's last parameter) > w2=0.0 (curve's first parameter); 7 StepToTopoDS_GeometricTool::UpdateParam3d's ordinary-bounded-curve fallback (distinct from the 8 periodic/closed/near-closed branches) must physically REVERSE the curve (Geom_Curve::Reverse()) 9 and remap w1,w2 via ReversedParameter, restoring an increasing [0,1] range on the reversed 10 curve rather than leaving w1>w2 unresolved */ 11HEADER; 12FILE_DESCRIPTION(('Gs202'),'2;1'); 13FILE_NAME('Gs202.stp','2026-07-13T00:00:00',(''),(''),'cad-research-suite','',''); 14FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }')); 15ENDSEC; 16DATA; 17#9000=APPLICATION_CONTEXT('mechanical design'); 18#1=CARTESIAN_POINT('',(0.0,0.0,0.0)); 19#2=DIRECTION('',(0.0,0.0,1.0)); 20#3=DIRECTION('',(1.0,0.0,0.0)); 21#4=AXIS2_PLACEMENT_3D('gs202_ax',#1,#2,#3); 22#5=PLANE('gs202_plane',#4); 23#6=(GEOMETRIC_REPRESENTATION_CONTEXT(2)PARAMETRIC_REPRESENTATION_CONTEXT()REPRESENTATION_CONTEXT('UV','2D')); 24#7=CARTESIAN_POINT('',(0.0,0.0,0.0)); 25#8=CARTESIAN_POINT('',(2.0,3.0,0.0)); 26#9=CARTESIAN_POINT('',(4.0,3.0,0.0)); 27#10=CARTESIAN_POINT('',(6.0,0.0,0.0)); 28#11=B_SPLINE_CURVE_WITH_KNOTS('gs202_bspline',3,(#7,#8,#9,#10),.UNSPECIFIED.,.F.,.F.,(4,4),(0.0,1.0),.UNSPECIFIED.); 29#12=CARTESIAN_POINT('',(6.0,0.0,0.0)); 30#13=VERTEX_POINT('',#12); 31#14=CARTESIAN_POINT('',(0.0,0.0,0.0)); 32#15=VERTEX_POINT('',#14); 33#16=CARTESIAN_POINT('',(0.0,0.0)); 34#17=CARTESIAN_POINT('',(2.0,3.0)); 35#18=CARTESIAN_POINT('',(4.0,3.0)); 36#19=CARTESIAN_POINT('',(6.0,0.0)); 37#20=B_SPLINE_CURVE_WITH_KNOTS('gs202_bspline_pc',3,(#16,#17,#18,#19),.UNSPECIFIED.,.F.,.F.,(4,4),(0.0,1.0),.UNSPECIFIED.); 38#21=DEFINITIONAL_REPRESENTATION('pcdef_e0',(#20),#6); 39#22=PCURVE('pc_e0',#5,#21); 40#23=SURFACE_CURVE('sc_e0',#11,(#22),.PCURVE_S1.); 41#24=EDGE_CURVE('ec_e0',#13,#15,#23,.T.); 42#25=CARTESIAN_POINT('',(0.0,0.0,0.0)); 43#26=DIRECTION('',(0.0,1.0,0.0)); 44#27=VECTOR('',#26,4.0); 45#28=LINE('',#25,#27); 46#29=CARTESIAN_POINT('',(0.0,0.0)); 47#30=DIRECTION('',(0.0,1.0)); 48#31=VECTOR('',#30,4.0); 49#32=LINE('',#29,#31); 50#33=DEFINITIONAL_REPRESENTATION('pcdef',(#32),#6); 51#34=PCURVE('pc',#5,#33); 52#35=SURFACE_CURVE('sc',#28,(#34),.PCURVE_S1.); 53#36=CARTESIAN_POINT('',(0.0,4.0,0.0)); 54#37=VERTEX_POINT('',#36); 55#38=EDGE_CURVE('ec1',#15,#37,#35,.T.); 56#39=CARTESIAN_POINT('',(0.0,4.0,0.0)); 57#40=DIRECTION('',(1.0,0.0,0.0)); 58#41=VECTOR('',#40,6.0); 59#42=LINE('',#39,#41); 60#43=CARTESIAN_POINT('',(0.0,4.0)); 61#44=DIRECTION('',(1.0,0.0)); 62#45=VECTOR('',#44,6.0); 63#46=LINE('',#43,#45); 64#47=DEFINITIONAL_REPRESENTATION('pcdef',(#46),#6); 65#48=PCURVE('pc',#5,#47); 66#49=SURFACE_CURVE('sc',#42,(#48),.PCURVE_S1.); 67#50=CARTESIAN_POINT('',(6.0,4.0,0.0)); 68#51=VERTEX_POINT('',#50); 69#52=EDGE_CURVE('ec2',#37,#51,#49,.T.); 70#53=CARTESIAN_POINT('',(6.0,4.0,0.0)); 71#54=DIRECTION('',(0.0,-1.0,0.0)); 72#55=VECTOR('',#54,4.0); 73#56=LINE('',#53,#55); 74#57=CARTESIAN_POINT('',(6.0,4.0)); 75#58=DIRECTION('',(0.0,-1.0)); 76#59=VECTOR('',#58,4.0); 77#60=LINE('',#57,#59); 78#61=DEFINITIONAL_REPRESENTATION('pcdef',(#60),#6); 79#62=PCURVE('pc',#5,#61); 80#63=SURFACE_CURVE('sc',#56,(#62),.PCURVE_S1.); 81#64=EDGE_CURVE('ec3',#51,#13,#63,.T.); 82#65=ORIENTED_EDGE('',$,$,#24,.T.); 83#66=ORIENTED_EDGE('',$,$,#38,.T.); 84#67=ORIENTED_EDGE('',$,$,#52,.T.); 85#68=ORIENTED_EDGE('',$,$,#64,.T.); 86#69=EDGE_LOOP('',(#65,#66,#67,#68)); 87#70=FACE_OUTER_BOUND('',#69,.T.); 88#71=ADVANCED_FACE('',(#70),#5,.T.); 89#72=OPEN_SHELL('',(#71)); 90#73=SHELL_BASED_SURFACE_MODEL('',(#72)); 91#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 92#9051=PRODUCT('Gs202','Gs202','',(#9050)); 93#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 94#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 95#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 96#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 97#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 98#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 99#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 100#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value',''); 101#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 102#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#73),#9060); 103#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 104ENDSEC; 105END-ISO-10303-21;