step-examples/12-2a-pcurves/Gp008.stp
Sources
- 03-occt-tests.md R026 (bug17128, bug17129, OCC209, bug210)
Description
A pcurve produced by projecting a 3D curve onto a host surface oscillates at high frequency along its domain; the projector lacks adaptive sampling and emits a 2D curve whose second derivative changes sign many times along the parametric span. A subsequent wire self-intersection check mis-detects the oscillations as crossings and corrupts wire topology.
Reproducer recipe
A 3D curve close to the boundary of a `B_SPLINE_SURFACE_WITH_KNOTS` whose projector lacks adaptive sampling; pcurve evaluation shows >10 zero-crossings of the second derivative.
Expected kernel behavior
refit the pcurve with smoothing before any self-intersection analysis, reject pcurves whose curvature exceeds a threshold, or use an intersection check that is robust against high-frequency noise.
Notes
**See also**: Gs009. **OCC behavior**: accepts and loads shape(1); OCC's STEP reader recomputes the pcurve from the 3D curve on transfer (per Gp193), so the declared 2D/pcurve defect does not survive into the built shape. Perturbing the declared defect from clean to grossly exaggerated leaves the built shape unchanged in both shape-counts and BRepCheck validity (heal_on and heal_off), so the shape-count oracle cannot distinguish it from a clean input; shape(1) does not witness a kernel bug. Synonyms: "pcurve oscillates wildly", "high-frequency noise on projected pcurve", "wire self-intersection check fooled by pcurve wiggles", "non-adaptive pcurve projector emits zigzag", "spurious self-intersections from oscillating 2D curve".
Expected validation
occt=shape(1)/shape(1) gmsh=reject ifc=schema_n/a
Byte assertions
contains(b'SURFACE_CURVE')contains(b'EDGE_CURVE')count_entity_def(b'PCURVE') >= 1
Tier-3 assertions
shape_null == Falsen_faces_total == 1n_edges_total == 1n_vertices_total == 2face[0].surface_type == "bspline"
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/* Gp008: pcurve oscillations on B_SPLINE_SURFACE_WITH_KNOTS host (non-adaptive projection) */ 3HEADER; 4FILE_DESCRIPTION(('Gp008'),'2;1'); 5FILE_NAME('Gp008.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=CARTESIAN_POINT('',(1.0,0.0,0.4)); 12#3=CARTESIAN_POINT('',(2.0,0.0,0.4)); 13#4=CARTESIAN_POINT('',(3.0,0.0,0.0)); 14#5=CARTESIAN_POINT('',(0.0,0.3,0.0)); 15#6=CARTESIAN_POINT('',(1.0,0.3,0.8)); 16#7=CARTESIAN_POINT('',(2.0,0.3,0.8)); 17#8=CARTESIAN_POINT('',(3.0,0.3,0.0)); 18#9=CARTESIAN_POINT('',(0.0,0.7,0.0)); 19#10=CARTESIAN_POINT('',(1.0,0.7,0.5)); 20#11=CARTESIAN_POINT('',(2.0,0.7,0.5)); 21#12=CARTESIAN_POINT('',(3.0,0.7,0.0)); 22#13=CARTESIAN_POINT('',(0.0,1.0,0.0)); 23#14=CARTESIAN_POINT('',(1.0,1.0,0.0)); 24#15=CARTESIAN_POINT('',(2.0,1.0,0.0)); 25#16=CARTESIAN_POINT('',(3.0,1.0,0.0)); 26#17=B_SPLINE_SURFACE_WITH_KNOTS('host_nurbs',2,2,((#1,#2,#3,#4),(#5,#6,#7,#8),(#9,#10,#11,#12),(#13,#14,#15,#16)),.UNSPECIFIED.,.F.,.F.,.F.,(3,1,3),(3,1,3),(0.0,0.5,1.0),(0.0,0.5,1.0),.UNSPECIFIED.); 27#18=CARTESIAN_POINT('',(0.5,0.05,0.15)); 28#19=CARTESIAN_POINT('',(2.5,0.05,0.15)); 29#20=VERTEX_POINT('',#18); 30#21=VERTEX_POINT('',#19); 31#22=DIRECTION('',(1.0,0.0,0.0)); 32#23=VECTOR('',#22,2.0); 33#24=LINE('',#18,#23); 34#25=CARTESIAN_POINT('',(0.17,0.2)); 35#26=CARTESIAN_POINT('',(0.22,0.5)); 36#27=CARTESIAN_POINT('',(0.27,0.15)); 37#28=CARTESIAN_POINT('',(0.33,0.55)); 38#29=CARTESIAN_POINT('',(0.39,0.12)); 39#30=CARTESIAN_POINT('',(0.45,0.58)); 40#31=CARTESIAN_POINT('',(0.51,0.1)); 41#32=CARTESIAN_POINT('',(0.57,0.6)); 42#33=CARTESIAN_POINT('',(0.63,0.13)); 43#34=CARTESIAN_POINT('',(0.69,0.56)); 44#35=CARTESIAN_POINT('',(0.75,0.17)); 45#36=CARTESIAN_POINT('',(0.81,0.5)); 46#37=CARTESIAN_POINT('',(0.83,0.22)); 47#38=B_SPLINE_CURVE_WITH_KNOTS('osc_pcurve',3,(#25,#26,#27,#28,#29,#30,#31,#32,#33,#34,#35,#36,#37),.UNSPECIFIED.,.F.,.F.,(4,1,1,1,1,1,1,1,1,1,4),(0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0),.UNSPECIFIED.); 48#39=(GEOMETRIC_REPRESENTATION_CONTEXT(2)PARAMETRIC_REPRESENTATION_CONTEXT()REPRESENTATION_CONTEXT('UV','2D')); 49#40=DEFINITIONAL_REPRESENTATION('osc_pcurve_def',(#38),#39); 50#41=PCURVE('uv_curve',#17,#40); 51#42=SURFACE_CURVE('edge_with_osc_pcurve',#24,(#41),.PCURVE_S1.); 52#43=EDGE_CURVE('osc_edge',#20,#21,#42,.T.); 53#44=ORIENTED_EDGE('',$,$,#43,.T.); 54#45=EDGE_LOOP('',(#44)); 55#46=FACE_OUTER_BOUND('',#45,.T.); 56#47=ADVANCED_FACE('face_on_nurbs',(#46),#17,.T.); 57#48=OPEN_SHELL('',(#47)); 58#49=SHELL_BASED_SURFACE_MODEL('',(#48)); 59#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 60#9051=PRODUCT('Gp008','Gp008','',(#9050)); 61#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 62#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 63#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 64#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 65#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 66#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 67#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 68#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value',''); 69#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 70#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#49),#9060); 71#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 72ENDSEC; 73END-ISO-10303-21;