STEP import: a closed, gap-free solid wound inward imports inside out (signed volume < 0), nothing says so

Open
#1,617 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
28/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli, data

Research direction

Start with the STEP import path that sets face orientation and emits import notes, and with crates/app/src/pick/winding.rs to see how a wound-inward body is refused. Reproduce with testdata/models/box.step after inverting every same_sense, then check that the signed volume goes negative. The fix needs a guard for closed, gap-free shells (the seams judge) and a flip at import that adds a note; open or lone-face shells must stay unchanged. Done means pinning tests for the inverted box and the lone curved face pass, and the unchecked normal-reading ops are tried on an inverted box with results noted on the issue.

Written by the indexing model from the issue text.

Description

area:3d bug effort:high P3 source:agent

What happens: a STEP solid whose faces are all wound inward (consistently, so no face disagrees with a neighbour) imports with a negative signed volume. Nothing flips it and nothing says so. Seen with the local older test part step-block-371.step (20 facets, V = -102000 mm^3) on upstream main and on the #1576 branch alike, found in the review of PR #1576 (issue #1573). A synthetic stand-in reproduces it: testdata/models/box.step with every same_sense (FACE_SURFACE and FACE_BOUND) inverted imports with V = -1, notes = [].

Why #1576 leaves it: its rule flips faces only where neighbours disagree, so a consistently inverted shell is untouched. Deciding "outward" when nothing flipped is wrong for an open or lone-face shell (a curved open face's centroid volume has no meaning), so it needs a guard: closed, gap-free (the seams judge already knows) and every shared edge opposite.

What a wrong winding can do, as far as traced:

  • crates/app/src/pick/winding.rs already refuses face picks on a wound-inward body by name, so alignment to it is refused, not wrong.
  • The solid law (crates/sim/src/verify/solid.rs) reads the mesh by ray parity, which does not depend on winding, so the gouge check is not fooled on this evidence.
  • NOT traced: generators or checks that read facet normals directly (3D finishing, pocket3d offsets, tool-side). Whoever works this should grep them and test one op on an inverted box; if any gouges or cuts the wrong side, raise to P1.

Rating: P3 (wrong behaviour a user hits, with a workaround: re-export or import an STL; the picks refuse). By the AGENTS.md safety floor the fix touches geometry, so effort:high.

Done means: a closed, gap-free STEP shell with every shared edge opposite and a negative signed volume is flipped outward at import and says so in the import notes (the Graded/MCP notes and status line); an open or lone-face shell is left alone; pinning tests for the inverted box and for the lone-curved-face case; the unchecked normal-reading ops listed above are checked against an inverted box and the result is commented here.

Part of / refs: #1573 (closed-shell watertight), found in the review of PR #1576.

Dominant language
Rust
Stars
8
Forks
11
Avg merge
7h 10m
Merged PRs (30d)
740

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NeoTech/Camcraft

All issues in NeoTech/Camcraft

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.