step-examples/12-2b-nurbs/Gn176.stp
Sources
- https://dev.opencascade.org/content/crash-step-import-solidworks (SolidWorks STEP export containing negative pole weight in B_SPLINE_SURFACE_WITH_KNOTS)
- B4 wave-5 DEF-N (LGPL-clean — pattern only, no bytes copied).
Description
STEP file encoding an `ADVANCED_FACE` on a `RECTANGULAR_TRIMMED_SURFACE` whose underlying rational B-spline surface has at least one negative pole weight (-0.15 at pole (1,1)) in its weight vector. Negative weights are geometrically invalid in the homogeneous-coordinate representation of rational NURBS: the denominator w(u,v) must be strictly positive everywhere for the surface to be well-defined. OCCT's `BRepBuilderAPI_NurbsConvert` raises an exception or returns a null/empty shell when it encounters the negative weight, because the conversion path does not defensively clamp or reject individual weights. The defect is directly encoded in the STEP DATA section via a `RATIONAL_B_SPLINE_SURFACE` complex instance carrying the negative weight vector; the fixture synthesizes the pattern reported from SolidWorks exports.
Reproducer recipe
`RECTANGULAR_TRIMMED_SURFACE` wrapping a complex `(B_SPLINE_SURFACE(...) B_SPLINE_SURFACE_WITH_KNOTS(...) RATIONAL_B_SPLINE_SURFACE(((1.,1.,1.),(1.,-0.15,1.),(1.,1.,1.))))` entity; `ADVANCED_FACE` boundary is a rectangular polyline loop; `OPEN_SHELL` + `SHELL_BASED_SURFACE_MODEL`. OCCT accepts the entity structurally but produces 0 faces (empty shell) when building the BRep.
Expected kernel behavior
reject or flag — a negative weight pole makes the rational surface undefined; `BRepBuilderAPI_NurbsConvert` must detect w ≤ 0 and emit `E_NEGATIVE_NURBS_WEIGHT` rather than crashing or silently yielding an empty shell; downstream B-rep topology must never contain a face with a negative-weight underlying surface.
Notes
Pattern from SolidWorks export bug; synthesized from defect description (LGPL-clean). B4 wave-5 DEF-N. Synonyms: "STEP crash SolidWorks import negative weight", "B_SPLINE_SURFACE_WITH_KNOTS negative weight crash", "RECTANGULAR_TRIMMED_SURFACE invalid NURBS", "rational B-spline negative pole weight STEP", "NurbsConvert exception negative weight".
Expected validation
occt=shape(1)/shape(1) gmsh=empty ifc=schema_n/a
Byte assertions
contains(b'RECTANGULAR_TRIMMED_SURFACE')contains(b'B_SPLINE_SURFACE_WITH_KNOTS')contains(b'RATIONAL_B_SPLINE_SURFACE')contains(b'-0.15')
Tier-3 assertions
n_faces_total == 0shape_null == False
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ISO-10303-21; 2/* Gn176: RECTANGULAR_TRIMMED_SURFACE wraps B_SPLINE_SURFACE_WITH_KNOTS (degree 2,2 3x3 net) whose weights list contains -0.15 at pole (1,1); negative weight is geometrically invalid in rational NURBS homogeneous coordinates; OCCT BRepBuilderAPI_NurbsConvert raises exception or returns null shape; defect from SolidWorks export pattern (dev.opencascade.org); RECTANGULAR_TRIMMED_SURFACE IS ADVANCED_FACE.face_geometry â OCC yields null/empty */ 3HEADER; 4FILE_DESCRIPTION(('Gn176'),'2;1'); 5FILE_NAME('Gn176.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('',(0.0,5.0,0.0)); 12#3=CARTESIAN_POINT('',(0.0,10.0,0.0)); 13#4=CARTESIAN_POINT('',(5.0,0.0,0.0)); 14#5=CARTESIAN_POINT('',(5.0,5.0,0.0)); 15#6=CARTESIAN_POINT('',(5.0,10.0,0.0)); 16#7=CARTESIAN_POINT('',(10.0,0.0,0.0)); 17#8=CARTESIAN_POINT('',(10.0,5.0,0.0)); 18#9=CARTESIAN_POINT('',(10.0,10.0,0.0)); 19#10=B_SPLINE_SURFACE_WITH_KNOTS('',2,2,((#1,#2,#3),(#4,#5,#6),(#7,#8,#9)),.UNSPECIFIED.,.F.,.F.,.F.,(3,3),(3,3),(0.0,10.0),(0.0,10.0),.UNSPECIFIED.); 20#11=(B_SPLINE_SURFACE(2,2,((#1,#2,#3),(#4,#5,#6),(#7,#8,#9)),.UNSPECIFIED.,.F.,.F.,.F.)B_SPLINE_SURFACE_WITH_KNOTS((3,3),(3,3),(0.,10.),(0.,10.),.UNSPECIFIED.)RATIONAL_B_SPLINE_SURFACE(((1.,1.,1.),(1.,-0.15,1.),(1.,1.,1.)))); 21#12=RECTANGULAR_TRIMMED_SURFACE('',#11,1.0,9.0,1.0,9.0,.T.,.T.); 22#13=CARTESIAN_POINT('',(1.0,1.0,0.0)); 23#14=CARTESIAN_POINT('',(9.0,1.0,0.0)); 24#15=CARTESIAN_POINT('',(9.0,9.0,0.0)); 25#16=CARTESIAN_POINT('',(1.0,9.0,0.0)); 26#17=VERTEX_POINT('',#13); 27#18=VERTEX_POINT('',#14); 28#19=VERTEX_POINT('',#15); 29#20=VERTEX_POINT('',#16); 30#21=DIRECTION('',(1.0,0.0,0.0)); 31#22=VECTOR('',#21,8.0); 32#23=LINE('',#13,#22); 33#24=EDGE_CURVE('',#17,#18,#23,.T.); 34#25=ORIENTED_EDGE('',$,$,#24,.T.); 35#26=DIRECTION('',(0.0,1.0,0.0)); 36#27=VECTOR('',#26,8.0); 37#28=LINE('',#14,#27); 38#29=EDGE_CURVE('',#18,#19,#28,.T.); 39#30=ORIENTED_EDGE('',$,$,#29,.T.); 40#31=DIRECTION('',(-1.0,0.0,0.0)); 41#32=VECTOR('',#31,8.0); 42#33=LINE('',#15,#32); 43#34=EDGE_CURVE('',#19,#20,#33,.T.); 44#35=ORIENTED_EDGE('',$,$,#34,.T.); 45#36=DIRECTION('',(0.0,-1.0,0.0)); 46#37=VECTOR('',#36,8.0); 47#38=LINE('',#16,#37); 48#39=EDGE_CURVE('',#20,#17,#38,.T.); 49#40=ORIENTED_EDGE('',$,$,#39,.T.); 50#41=EDGE_LOOP('',(#25,#30,#35,#40)); 51#42=FACE_OUTER_BOUND('',#41,.T.); 52#43=ADVANCED_FACE('',(#42),#12,.T.); 53#44=OPEN_SHELL('',(#43)); 54#45=SHELL_BASED_SURFACE_MODEL('',(#44)); 55#9050=PRODUCT_CONTEXT('',#9000,'mechanical'); 56#9051=PRODUCT('Gn176','Gn176','',(#9050)); 57#9052=PRODUCT_DEFINITION_FORMATION('','',#9051); 58#9053=PRODUCT_DEFINITION_CONTEXT('part definition',#9000,'design'); 59#9054=PRODUCT_DEFINITION('','','',#9052,#9053); 60#9055=PRODUCT_DEFINITION_SHAPE('','','',#9054); 61#9056=(LENGTH_UNIT()NAMED_UNIT(*)SI_UNIT(.MILLI.,.METRE.)); 62#9057=(NAMED_UNIT(*)PLANE_ANGLE_UNIT()SI_UNIT($,.RADIAN.)); 63#9058=(NAMED_UNIT(*)SI_UNIT($,.STERADIAN.)SOLID_ANGLE_UNIT()); 64#9059=UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.0E-7),#9056,'distance_accuracy_value',''); 65#9060=(GEOMETRIC_REPRESENTATION_CONTEXT(3)GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#9059))GLOBAL_UNIT_ASSIGNED_CONTEXT((#9056,#9057,#9058))REPRESENTATION_CONTEXT('','3D')); 66#9061=MANIFOLD_SURFACE_SHAPE_REPRESENTATION('',(#45),#9060); 67#9062=SHAPE_DEFINITION_REPRESENTATION(#9055,#9061); 68ENDSEC; 69END-ISO-10303-21;