Wr051 — step-g imports cleanly but downstream `g-stl` tessellator silently writes zero triangles

§12.13 writer-pathology (sub-class: importer/tessellator disagreement)

P1 — silent data loss

writer

Sources

Sender

STEP files whose features sit at or below the BRL-CAD step-g hard-coded 1e-3 mm tolerance (sliver faces, micro-fillets, sub-tolerance B-spline patches) — the importer treats the geometry as valid but the tessellator's adaptive sampler cannot find sample points satisfying the same hard-coded tolerance.

Description

A STEP file imports cleanly via `step-g` (the resulting .g file contains a `Brep_2.s` solid with face count > 0), but the downstream `g-stl` tessellator prints `ERROR(Brep_2.s): tessellation failure` and writes `0 triangles written`; the resulting `.stl` is empty. The two halves of the BRL-CAD pipeline disagree on whether the model is "good": step-g believes it converted the geometry; g-stl cannot triangulate it. The user-facing symptom is an empty `.stl` with no diagnostic at the file-format interface; the failure happens deep in `PullbackCurve` / `SurfaceTree`. The class of inputs that trigger this is narrow but real: any face whose pcurves and 3D curves agree at vertices but drift to ~1e-3 mm in the interior (because the importer treats 1e-3 as the tolerance, but the tessellator treats anything below 1e-3 as a degeneracy). Distinct from M005 (number-of-facets validation property: facet count, not pipeline disagreement).

Reproducer recipe

STEP `BEZIER_SURFACE` with a 4×4 control net whose v-extent is 3 micrometres (well below step-g's 1e-3 mm tolerance). step-g loads the face; g-stl emits zero triangles.

Expected kernel behavior

reject; the importer and tessellator must agree on a single tolerance value; if a face cannot be tessellated at the importer's tolerance, the importer must reject it at parse time rather than commit a `Brep_2.s` to the .g file. Pipeline diagnostic must surface both the offending face id and the tolerance comparison.

Notes

**See also**: M005, M022, N019, N050. Synonyms: "BRL-CAD step-g imports but g-stl emits empty", "0 triangles written silently", "tessellation failure on sliver face", "importer/tessellator tolerance disagreement", "STEP→.g→.stl produces empty STL no diagnostic".

Expected validation

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

Byte assertions

Tier-3 assertions

Cross-references

M005, M022, N019, N050

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1ISO-10303-21;
2/* Wr051 - step-g BRep imports cleanly but g-stl tessellation produces zero triangles silently
3   Defect: a STEP file imports cleanly via BRL-CAD step-g (the .g file
4   contains a Brep_2.s solid), but the downstream g-stl tessellator
5   prints "ERROR(Brep_2.s): tessellation failure" and writes "0 triangles
6   written" - the resulting .stl file is empty. The two halves of the
7   pipeline disagree on whether the model is "good": step-g believes it
8   converted the geometry; g-stl cannot triangulate it. The user-facing
9   symptom is an empty .stl with no diagnostic at the file-format
10   interface; the failure happens deep in PullbackCurve / SurfaceTree.
11   Reproduce with a file featuring a sliver face on a B-spline (a face
12   whose pcurves and 3D curves agree at the vertices but drift to ~1e-3
13   in the interior - the BRL-CAD m_tolerance threshold) - step-g
14   accepts it, g-stl drops it.
15   Sources: BRL-CAD users mailing list 2017 (Filip Binkiewicz):
16   "ERROR(Brep_2.s): tessellation failure" + "0 triangles written";
17   step-g side accepts the same file. */
18HEADER;
19FILE_DESCRIPTION(
20  ('Wr051 - sliver-face BRep tessellates to zero triangles silently'),
21  '2;1');
22FILE_NAME('Wr051.stp','2026-05-02T00:00:00',('cad-research-suite'),(''),
23  'cad-research-suite','','');
24FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 3 1 1 }'));
25ENDSEC;
26DATA;
27/* A sliver Bezier patch: 4-corner control net but two sides collapse to
28   near-coincident points; the patch has positive area at the 4 corners
29   but interior degenerate parameterisation. step-g loads it; g-stl's
30   PullbackCurve fails to sample it and emits 0 triangles. */
31#10=CARTESIAN_POINT('p00',(0.0,0.0,0.0));
32#11=CARTESIAN_POINT('p01',(0.0,0.000001,0.0));
33#12=CARTESIAN_POINT('p02',(0.0,0.000002,0.0));
34#13=CARTESIAN_POINT('p03',(0.0,0.000003,0.0));
35#20=CARTESIAN_POINT('p10',(0.333,0.0,0.0));
36#21=CARTESIAN_POINT('p11',(0.333,0.000001,0.0));
37#22=CARTESIAN_POINT('p12',(0.333,0.000002,0.0));
38#23=CARTESIAN_POINT('p13',(0.333,0.000003,0.0));
39#30=CARTESIAN_POINT('p20',(0.667,0.0,0.0));
40#31=CARTESIAN_POINT('p21',(0.667,0.000001,0.0));
41#32=CARTESIAN_POINT('p22',(0.667,0.000002,0.0));
42#33=CARTESIAN_POINT('p23',(0.667,0.000003,0.0));
43#40=CARTESIAN_POINT('p30',(1.0,0.0,0.0));
44#41=CARTESIAN_POINT('p31',(1.0,0.000001,0.0));
45#42=CARTESIAN_POINT('p32',(1.0,0.000002,0.0));
46#43=CARTESIAN_POINT('p33',(1.0,0.000003,0.0));
47/* Defect: 4x4 Bezier with a v-extent of 3 micrometres - well below
48   step-g's hard-coded 1e-3 tolerance.  Loaded as a face, tessellated
49   to zero triangles by g-stl. */
50#100=BEZIER_SURFACE('sliver',3,3,
51  ((#10,#11,#12,#13),(#20,#21,#22,#23),(#30,#31,#32,#33),(#40,#41,#42,#43)),
52  .UNSPECIFIED.,.F.,.F.,.F.);
53ENDSEC;
54END-ISO-10303-21;