Gn002 — RATIONAL_BSPLINE_CURVE / SURFACE with `NbWeights ≠ NbControlPoints`

§12.2b NURBS/knots

silent-loss geometry

Sources

Description

A `RATIONAL_B_SPLINE_CURVE` (or surface) has a weights array whose length differs from the control-point list length, breaking reader contracts. OCCT's writer historically also emitted mismatched lengths.

Reproducer recipe

Emit `RATIONAL_B_SPLINE_CURVE(..,(w0,w1,w2))` paired with a 2D/3D pole list of length 4; or surface analogue with rectangular weight grid having a missing row.

Expected kernel behavior

heal; pad weights with 1.0 / truncate to match pole count; warn. Do not crash. Writers must always emit len(weights) == len(poles).

Notes

Both malformed rational entities (curve: 4 poles / 3 weights; surface: 4×4 net / 4×3 weight grid) are wired as members of a `GEOMETRIC_SET` (`#2`) reachable from the shape representation — they are genuinely part of the loaded model, not orphan definitions. **Live-oracle behaviour (OCCT 7.8.1, deterministic across reruns):** the parser accepts the file but the transfer stage silently DROPS both entities on the weight-count mismatch, so `occt` yields `shape_null` (empty); gmsh likewise yields empty. This is genuinely CAUSED by the defect: a well-formed control (curve 4 weights, surface 4×4 grid) built the same way yields a real edge+face (`occt=shape(1)`, face:1). So the fixture demonstrates the class by the observable empty-vs-nonempty contrast, not merely by byte presence. (An earlier version placed the malformed entities in an *unreferenced* `GEOMETRIC_CURVE_SET` beside a decoy point, which loaded a 1-vertex stub and demonstrated nothing — corrected 2026-07-17 to wire the defect carriers into the loaded model.) **See also**: Ad059. Synonyms: "rational B-spline weights count doesn't match poles", "weights array length differs from control points", "NbWeights ≠ NbControlPoints", "NURBS curve weight vector wrong length", "rational BSpline missing weight or has extra weight".

Expected validation

occt=empty/empty gmsh=empty ifc=schema_n/a

Byte assertions

Tier-3 assertions

Cross-references

Ad059

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* Gn002: RATIONAL_B_SPLINE_CURVE: 4 control points but only 3 weights (length mismatch); RATIONAL_B_SPLINE_SURFACE: 4x4 control net but 4x3 weights grid (column missing); STEP semantics require strict equality NbWeights == NbControlPoints. Both malformed rational entities are wired into a GEOMETRIC_SET reachable from the shape representation; OCCT's transfer stage throws on the weight mismatch and yields an empty shape (a well-formed control yields a real edge+face). */
3HEADER;
4FILE_DESCRIPTION(('Gn002'),'2;1');
5FILE_NAME('Gn002.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,1.0,0.0));
12#3=CARTESIAN_POINT('',(2.0,1.0,0.0));
13#4=CARTESIAN_POINT('',(3.0,0.0,0.0));
14#5=(
15  BOUNDED_CURVE()
16  B_SPLINE_CURVE(3,(#1,#2,#3,#4),.UNSPECIFIED.,.F.,.F.)
17  B_SPLINE_CURVE_WITH_KNOTS((4,4),(0.0,1.0),.UNSPECIFIED.)
18  CURVE()
19  GEOMETRIC_REPRESENTATION_ITEM()
20  RATIONAL_B_SPLINE_CURVE((1.0,2.0,1.0))
21  REPRESENTATION_ITEM('rcurve_bad_weights')
22);
23#6=CARTESIAN_POINT('',(0.0,0.0,0.0));
24#7=CARTESIAN_POINT('',(0.0,1.0,0.0));
25#8=CARTESIAN_POINT('',(0.0,2.0,0.0));
26#9=CARTESIAN_POINT('',(0.0,3.0,0.0));
27#10=CARTESIAN_POINT('',(1.0,0.0,0.0));
28#11=CARTESIAN_POINT('',(1.0,1.0,0.1));
29#12=CARTESIAN_POINT('',(1.0,2.0,0.2));
30#13=CARTESIAN_POINT('',(1.0,3.0,0.3));
31#14=CARTESIAN_POINT('',(2.0,0.0,0.0));
32#15=CARTESIAN_POINT('',(2.0,1.0,0.2));
33#16=CARTESIAN_POINT('',(2.0,2.0,0.4));
34#17=CARTESIAN_POINT('',(2.0,3.0,0.6));
35#18=CARTESIAN_POINT('',(3.0,0.0,0.0));
36#19=CARTESIAN_POINT('',(3.0,1.0,0.3));
37#20=CARTESIAN_POINT('',(3.0,2.0,0.6));
38#21=CARTESIAN_POINT('',(3.0,3.0,0.9));
39#22=(
40  BOUNDED_SURFACE()
41  B_SPLINE_SURFACE(3,3,((#6,#7,#8,#9),(#10,#11,#12,#13),(#14,#15,#16,#17),(#18,#19,#20,#21)),.UNSPECIFIED.,.F.,.F.,.F.)
42  B_SPLINE_SURFACE_WITH_KNOTS((4,4),(4,4),(0.0,1.0),(0.0,1.0),.UNSPECIFIED.)
43  GEOMETRIC_REPRESENTATION_ITEM()
44  RATIONAL_B_SPLINE_SURFACE(((1.0,1.0,1.0),(1.0,1.0,1.0),(1.0,1.0,1.0),(1.0,1.0,1.0)))
45  REPRESENTATION_ITEM('rsurf_bad_weights')
46  SURFACE()
47);
48#23=GEOMETRIC_SET('',(#5,#22));
49#9050=PRODUCT_CONTEXT('',#9000,'mechanical');
50#9051=PRODUCT('Gn002','Gn002','',(#9050));
51#9052=PRODUCT_DEFINITION_FORMATION('','',#9051);
52#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design');
53#9054=PRODUCT_DEFINITION('','','',#9052,#9053);
54#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054);
55#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.));
56#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.));
57#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT());
58#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value','');
59#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D'));
60#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#23),#9060);
61#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061);
62ENDSEC;
63END-ISO-10303-21;