5.1 KiB
Part point sampling gap completion
Date: 2026-09-17 (Asia/Shanghai)
Requirement: Part:desktop:Part_PointsFromMesh
Implementation
Desktop references: CmdPartPointsFromMesh in src/Mod/Part/Gui/CommandSimple.cpp and src/Mod/Part/BasicShapes/Utils.py.
The command samples native geometric properties through getPoints, the same method called by desktop makeCompoundFromPoints, and creates independent Part::Feature compounds containing native vertices. It supports shapes and mesh objects already present in the current document, deduplicates repeated selections, and commits each batch as one transaction. Provenance and sampling distance are stored without source dependencies.
The first selected Part shape supplies the default sampling distance (bounding-box diagonal / 20), maximum (diagonal / 2), and minimum based on desktop unit precision. For a degenerate bounding box, the range is clamped to the minimum. A mesh-only selection defaults to distance 1; the mesh implementation returns its native vertices independently of spacing. Mixed selections use the first Part shape's distance for the batch, matching desktop behavior.
Input validation precedes document mutation. Missing, foreign, nongeometric and empty sources, invalid distances, detached BREP payloads and unsupported subelement selections fail explicitly without partial point sets. Read/cancel preserve pending edits and history.
The mounted task offers source selection, sampling distance, undo/redo, FCStd save/open, OPFS storage and Three.js point markers. A local Show Sources checkbox permits inspecting point distributions without changing source-object visibility in the native document.
Files: PartSamplePointsDocument.h, DocumentProbe.cpp, part-document-facade.ts, part-desktop-adapter.ts, part-sample-points-task.tsx, and workbench integration.
First Acceptance
Command: python3 tools/run_business_acceptance.py --module Part --ids Part:desktop:Part_PointsFromMesh --reuse
Result: 1 requirement passed, 28 scenario records, 18.443 seconds.
The suite shares one DocumentProbe kernel for native cases and one browser workflow. Existing libraries were reused; only DocumentProbe was incrementally compiled/linked. TypeScript checking, production Vite build and the changed document source's whitespace check passed. Previously passed requirement suites were not run.
Verified results:
- A 2x2 planar face yields 9 points at distance 1 and 25 at distance 0.5, with analytic bounds and coordinates checked.
- A length-4 edge yields 5 points at distance 1; a native vertex yields one point.
- A 2x3x4 box yields 94 points at distance 1; a radius-2 sphere yields 338 points at distance 0.5, all checked against the sphere radius.
- A translated box mesh yields its 8 original vertices, with translated coordinates checked.
- Every case is compared point by point against the unmodified local
BasicShapes/Utils.pyimplementation. - Mixed selections, native defaults, preserved source state, document isolation, one-step undo/redo, malformed input, direct native validation, pending read/cancel, independent results, source deletion, native FCStd and browser storage restoration.
Two earlier attempts remain recorded. The first found that BasicShapes was not packaged into DocumentProbe; the acceptance harness now loads the actual local Utils.py source for its desktop reference without adding an unnecessary runtime dependency. The second found normal FCStd coordinate serialization differences around 1e-15. Reopened coordinates now use an explicit 1e-9 mm tolerance; point count, source, sampling distance and dependency assertions remain exact.
Visual Inspection
Playwright checked 1440x900 and 390x844 viewports, measured colored point pixels with source geometry hidden, verified camera rotation changes the canvas, and checked task overflow. Desktop and mobile screenshots were visually inspected.
Continuation
Snapshot: 202/1508 requirements declare executable coverage; 1306 remain uncovered. This is coverage, not a claim of 202 currently fresh full-project acceptances. All original requirements remain.
This evidence covers representative native Part and Mesh geometry. It does not certify all geometric module types, cross-worker document transfer, arbitrary model sizes, or an alternative sampling algorithm. Native duplicate points at shared boundaries are retained, as in the desktop utility.
Keep prioritizing missing functionality and executable coverage. Do not repeat this or historical IFC verification solely to refresh fingerprints. The full task remains unfinished. The scheduler was thawed, verified active/unfrozen, and advanced to cycle 9292 with a live child process (451760), selecting PartDesign Duplicate Selection, Migrate, Move Feature and Move Feature in Tree. Retain the deferred-validation policy.