Files
FreeCADWasmDev/docs/current/PART_COPY_PROGRESS.md

5.0 KiB

Part document copy gap completion

Date: 2026-09-17 (Asia/Shanghai) Requirements: Part:desktop:Part_SimpleCopy, Part:desktop:Part_TransformedCopy, Part:desktop:Part_ElementCopy

Implementation

Desktop reference: _copyShape and the three command handlers in freecad-source/src/Mod/Part/Gui/CommandSimple.cpp.

  • Simple copy resolves the actual object through native App::GeoFeature::resolveElement before copying its whole shape, as the desktop selection resolver does.
  • Transformed copy obtains geometry through the selected object/subobject path and keeps its accumulated placement. It does not reinterpret the command as an arbitrary translation of detached BREP data.
  • Element copy retains the selected native face, edge, vertex, wire, shell, or solid and creates independent geometry using the native copy operation.
  • All three create static Part::Feature objects with unique native names, native duplicate-label behavior, no source dependencies, and persisted provenance. Multiple selections commit as one transaction, while invalid selections reject before creating any objects.
  • Face appearance is mapped in the source object's topology before transformed instances are copied. Complete copies preserve the face color list; subface copies preserve the selected face's color. Link colors use the existing native link resolver.
  • Mounted controls provide multiple selections, nested subobject paths, topology menus, read/cancel, undo/redo, FCStd save/open and OPFS persistence. The existing Three.js view now supports optional point markers used by copied vertices.

Core files: PartCopyDocument.h, DocumentProbe.cpp, part-document-facade.ts, part-desktop-adapter.ts, part-copy-task.tsx, openscad-desktop-view.tsx, and workbench-shell.tsx.

First Acceptance

Command: python3 tools/run_business_acceptance.py --module Part --ids Part:desktop:Part_SimpleCopy Part:desktop:Part_TransformedCopy Part:desktop:Part_ElementCopy --reuse

Result: 3 requirements passed; 19 simple-copy, 19 transformed-copy and 20 element-copy scenario records; 33.220 seconds.

Formal evidence

The three requirements share one native kernel, fixture document and browser workflow. Existing native libraries were reused; only the DocumentProbe target was rebuilt. TypeScript checking, the production Vite build and the changed document source's whitespace check passed. Historical requirement suites were not executed.

The first acceptance attempt found a real color-mapping failure: separately retrieved transformed shapes need not share native topology identity. Mapping now uses one source topology before copying. The failed report remains in the evidence history; the passing run used the corrected source and artifacts.

Cases prove:

  • A box of volume 24 mm3 copied at local bounds [1,2,3,3,5,7] by Simple Copy and at accumulated bounds [16,2,3,18,5,7] by Transformed Copy.
  • Nested face selection produces a single face of area 12 mm2 in Element Copy, while the two whole-shape commands copy the complete solid and deduplicate face selections.
  • Per-face colors, transformed App::Link geometry, edge and vertex copies, whole-object selection, unique names, unchanged source objects, and isolated documents.
  • Rejection of invalid objects, topology paths, detached BREP payloads, foreign document selections and inappropriate translation parameters without partial output/history changes.
  • Pending edits survive read/cancel. Copies survive source edits, source-link deletion, native FCStd restoration and browser reload.

Visual Inspection

Playwright covered 1440x900 and 390x844 viewports, nonblank colored model pixels, changed images after camera rotation, and absence of horizontal task overflow. Desktop geometry and the mobile task screenshots were visually inspected.

Continuation

Snapshot: 200/1508 requirements declare executable coverage; 1308 remain uncovered. This is a coverage total, not the number of currently fresh full-project acceptances. No original requirements were removed.

Keep prioritizing missing functionality and coverage. These three requirements now have passing first evidence; do not rerun them or historical IFC cases solely to refresh fingerprints. The cases do not certify every desktop selection-container variant, cross-document copying, or advanced material rendering. Unsupported paths fail explicitly.

The overall task remains unfinished. The existing scheduler was thawed after shared-file work. After one response-timeout backoff, cycle 9288 started with a live child process (426822) and an agent message, selecting Join Features, Section Cut and Sweep. Keep prioritizeCoverageGaps and deferPreviouslyPassedValidation enabled.