8000 Generate preview, STL and STEP from one CAD solid by noobydp · Pull Request #249 · tracefinity/tracefinity · GitHub
[go: up one dir, main page]

Skip to content

Generate preview, STL and STEP from one CAD solid - #249

Draft
noobydp wants to merge 2 commits into
tracefinity:mainfrom
noobydp:codex/step-geometry-export
Draft

noobydp wants to merge 2 commits into
tracefinity:mainfrom
noobydp:codex/step-geometry-export

Conversation

@noobydp
@noobydp noobydp commented Nov 12, 2026 •
Copy link
Copy Markdown
Contributor

Summary

Closes #243. Relates to #139, the earlier STEP export feasibility issue.

This draft proposes a path to editable STEP export for Tracefinity. The implementation and testing below address the concerns raised in #139 about maintaining a second geometry backend, adding a heavy runtime CAD dependency, and keeping generation fast enough for larger bins. I think the results make this a practical starting point for STEP support, and I'd welcome feedback on the approach.

Build the bin once as a boundary-representation solid in a Rust worker. The 3D preview renders the mesh tessellated from that solid, STL downloads the same mesh, and STEP serializes the same solid's faces and edges. The preview and export requests carry the same geometry revision. The contrast insert follows the same path as a separate solid.

  • Replace the Manifold generator with one geometry worker for preview, STL, STEP, print-bed split parts, and the meshes used by 3MF. Docker builds the worker into the image, and source installs build it with make geometry. Open CASCADE is used for independent test readback.
  • Add STEP and Insert STEP to the bin export menu and expose STEP export for trace sessions. Older revisions are rejected so a download matches the displayed preview.
  • Preserve traced outline pockets, interior islands, per-cutout depths, finger reliefs, raised rims, stacking lips, magnets, partial and half-grid bases, labels, and inserts. The worker honors allow_wall_cutouts when present in saved settings. The editor toggle is tracked in Allow opt-in wall cutouts for tools and finger reliefs #248.
  • Check meshes for open and non-manifold edges after STL coordinate conversion. Retry with finer tessellation when needed. Add 0.005–0.01 mm of clearance at exact contacts that otherwise produce a zero-width seam.

Generation timings

Local Apple M6, seven alternating HTTP requests per backend after warm-up. Fresh generation includes outline preparation, solid construction, tessellat 8000 ion, file writes and the response. The legacy path generates STL and any configured mesh outputs. The Rust path also writes STEP during generation.

Saved layout Legacy fresh Rust fresh Legacy cached Rust cached
Combined features 103.9 ms 229.4 ms 30.0 ms 30.2 ms
Interior island and finger cutouts 47.6 ms 73.3 ms 30.1 ms 30.0 ms
Disconnected partial bin 43.5 ms 78.0 ms 29.6 ms 29.9 ms
Print-bed split 56.8 ms 117.7 ms 29.9 ms 30.1 ms
4×4, 16 pockets 106.9 ms 137.0 ms 31.0 ms 31.0 ms
6×6, 36 pockets 186.4 ms 227.4 ms 32.3 ms 32.6 ms
10×10, 100 pockets 433.1 ms 563.8 ms 47.8 ms 47.8 ms

Fresh generation took 1.22–2.21× the legacy time on these fixtures. Across the seven paired exports, the outer dimensions agreed to 0.0001 mm and the legacy and Rust STL volumes differed by less than 0.1%. Each Rust STL matched its STEP volume within 0.007%. Raw timing samples

Side-by-side previews

The rotated slot in the interior-island fixture follows the 2D layout angle in the Rust export. In the combined-feature fixture the Rust model joins two half-grid feet to the bridge, so it exports as one solid.

Synthetic fixture Legacy STL preview Rust preview
Combined features Legacy combined-feature bin Rust combined-feature bin
Interior island and rotated relief Legacy bin with interior island and angled relief Rust bin with interior island and angled relief
Print-bed split Legacy print-bed split preview Rust print-bed split preview
10×10, 100 pockets Legacy 100-pocket bin Rust 100-pocket bin

Verification

  • Fusion. Imported a photo-derived bin as one editable solid. Applied a 0.3 mm cut to a pocket floor and checked the wall and stacking-lip openings.
  • 3DXDE. Ran Repair → Check CAD on five STEP exports covering combined features, an insert, an interior island, disconnected partial bins and a bed-split layout. All six solid definitions were valid. 3DXDE · Check results
  • Geometry stress tests. 796 synthetic layouts and 45 existing bins generated watertight STL and valid STEP with bin volumes within 0.2%. The sweep covered overlapping and tangent cutters, near-identical rotations, repeated trace points, enclosed islands, wall/lip crossings, partial-bin seams, inserts, bed splits and the 100-cell limit. The repository suite adds 33 focused geometry regressions.
  • Project checks. make geometry, 944 backend tests, 299 frontend tests, and all five browser accuracy tests passed. make lint passed with nine existing frontend warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Any chance of export in *.step format?

1 participant

0