solidcore

Units / topology

topology.api_files partial

Layer
49
Upstream lines
132
Functions
0
Rust module
topology::api_files

Status history

Oct 12Nov 25
  1. green 132 lines
  2. partial 132 lines

Source: crates/solidcore/src/topology/api_files.rs

Upstream: source/SM_API/src/SmApiImportExport.cpp, source/SM_API/src/SmApiBrep.cpp

Port-plan notes

These notes preserve historical port measurements and limitations, not current CI results.

[2026-11-04 (#2400): PARTIAL, 2 known mismatches: the blend corner is the default and the old corner code is deleted, so these cases no longer agree with C++ v1.0.1's pinned corner (plan/findings/blend.fillet_corner_p3--blend-corner-default-diverges-from-cpp-v1-0-1-2026-11-04.md)] NOT IN callgraph/units.json: SmApiReadBrepFromFile (SmApiImportExport.cpp:12), SmApiReadPartFromFile (SmApiImportExport.cpp:61), SmApiTurnToNurbs (SmApiBrep.cpp:2630) and the file-static SmApiAddCurveOutputSlots (SmApiBrep.cpp:46) are listed in harness/callgraph/unused_functions.txt (SM_API gap table batch 4). Rust: topology::api_files::{read_brep_from_file, read_part_from_file, turn_to_nurbs, add_curve_output_slots}; topology::brep::p5::turn_to_nurbs_plain (the plain SmBrep::TurnToNURBS entry point Transform already used). Difftest topology.api_files: 77 fixture cases (SM_API_test TestSmImportExport ASCII and binary round trips, TestSmErrorCodes null arguments, TestSmRemoveFilletNurbsPlanes' filleted box, the 15 topology.brep_p7 read files with and without UV trim rebuild, 8 part files with and without prefilled outputs) plus generated cases. SmApiAddCurveOutputSlots is file static (no C++ entry point a shim can call without compiling SmApiBrep.cpp into it); its callers SmApiProjectCurve / SmApiCreateSilhouetteCurves are unported, so it is covered by unit tests only until they land. TurnToNURBS reaches its analytic branches through SM_API_test TestSmBrepCopyRepresentation's bodies (SmApiCreateCylinder(o,3,8), Cone(o,3,1,8), Sphere(o,3), Torus(o,5,1), and the box with face 0 replaced by its CopyAnalyticAsNurb); the 15 read files are pure B-spline (the already-NURBS no-op). Unreached: its SmOffsetSurface branch (ApproximateOffsetSurface and CreateExtendedSurface) and its SmCrvOnSurf edge-curve lift (no constructed body has either). Records compare the UV trim curves (per edge use: type, interval, three samples) and support/primitive_record.h's append (edge use and trim counts), so read_brep with and without rebuild and TurnToNURBS's trim handling are compared beyond topology. A binary read of an ASCII test file (read_disk_ascii_file_as_binary) is a memory-safety crash in SmBrepData::ReadFromDB (held record); the FFI guard rejects binary reads of the text test files, so the case is recorded as rejected. The test crates/difftest/tests/api_files_binary_text.rs reads every upstream .smb and .smp as binary through the wrappers and requires an error without a panic or an abort; the binary success path is compared through the round trips. Status set when the difftest gate has run. SM_API batch S2 (fixer-7, 2026-10-29): SmApiWriteBrepToFile added (topology::api_files::write_brep_to_file over topology::brep_data_write::write_brep_to_file, SmBrep::WriteToFile with bNewFile TRUE, bWriteAsBSplines FALSE); its written file is compared byte for byte (op write_bytes: shim entry sc_topology_api_files_write, FFI write, ASCII and binary, SM_API primitives and the 12 topology.brep_mirror B-rep files), fixtures/topology.api_files/write_bytes.json (42, incl. TestSmImportExport's box) and 200 write_bytes cases from their own seeds; the round trip (op 4) is unchanged. Gate counts: to be filled from the builder's run.

Goldens

This is committed inventory, not a runtime result or a correctness proof. A golden records what solidcore produced when blessed. Current results require the canonical CI gate, not these counts.

Golden records
339
Stored error outcomes
0
Stored deferrals
0
Stored harness rejections
0
Known-failure entries
0

Metadata counts describe fields in the stored records; they are not passes or live failures.

Source at f9704ee3b: golden JSONL · known-failure list.

Dependencies

Depends on: topology.brep_data green topology.brep_p3 partial topology.brep_p5 green topology.brep_p7 green

Soft dependencies: none

Dependents: topology.api_projection partial

Soft dependents: none

Upstream functions

No upstream functions listed in harness/callgraph/units.json.

Module file-header table (5 rows)
RustUpstream
[read_brep_from_file]SmApiReadBrepFromFile
[read_part_from_file]SmApiReadPartFromFile
[write_brep_to_file]SmApiWriteBrepToFile
[turn_to_nurbs]SmApiTurnToNurbs
[add_curve_output_slots]SmApiAddCurveOutputSlots (file static)

Upstream tests reaching this unit

tests/SM_API_test/src/TestSmImportExport.cpp:TestSmImportExport, tests/SM_API_test/src/TestSmErrorCodes.cpp:TestSmErrorCodes, tests/SM_API_test/src/TestSmFillets.cpp:TestSmRemoveFilletNurbsPlanes