Files
FreeCADWasmDev/docs/current/PART_HELIX_SPIRAL_PROGRESS.md

97 lines
5.3 KiB
Markdown

# Helix and Spiral Primitive Progress
Continuation: [manual placement and rotation](PART_PRIMITIVE_PLACEMENT_PROGRESS.md) now implements the position/axis-angle controls with native transaction and persistence evidence. The remaining container and desktop task interactions are listed there; do not repeat the manual placement or type-creation work below.
Updated 2026-09-17. Requirement `Part:desktop:Part_Primitives` remains incomplete.
This increment covers the two previously missing native curve types only. It
does not revalidate the previously exercised fourteen primitive types or IFC.
## Implementation
- The native `setPrimitive` route now creates and edits `Part::Helix` and
`Part::Spiral`, preserving their native properties, OCCT curves, transactions,
unique object names and FCStd serialization. The task panel now lists all
sixteen desktop primitive types.
- Helix exposes Pitch, Height, Radius, taper Angle and the LocalCoord enum as
a handedness menu. New objects receive Style=1, matching the desktop creator;
editing an existing object preserves its style. Spiral exposes Growth,
Radius and fractional Rotations. The task's 1000-rotation limit matches the
desktop control. Native guards reject invalid pitch, excessive helix turns,
degenerate curves, invalid handedness and a taper crossing the axis.
- Enum serialization is explicit; it is not treated as a floating point field.
Facade and native callers both validate before changing the document.
- Visual inspection found that the existing whole-edge deflection sampler
skipped complete turns of a planar spiral. Native topology and length were
correct but the displayed line showed only the final quarter turn. For the
two spiral feature types, sampling now seeds quarter-turn intervals before
calling OCCT's deflection algorithm. It retains the actual native curve and
its placement. The acceptance helper now checks rendered polyline length
and unwrapped winding in addition to native analytic geometry and pixels.
Desktop references: `DlgPrimitives.cpp` HelixPrimitive::create and
SpiralPrimitive::create; `PrimitiveFeature.cpp` Helix/Spiral constructors and
execute methods; `TopoShape.cpp` makeSpiralHelix; `DlgPrimitives.ui` rotation
control. All sources were already available locally.
## Focused Evidence
`tools/part-helix-spiral-business-cases.mjs` is now the active primitive
increment in `tools/part-primitive-business-cases.mjs`. Earlier helpers remain
on disk, but are not invoked. One native runtime and one browser are loaded
for the two new types together.
Command:
```
python3 tools/run_business_acceptance.py --module Part --ids Part:desktop:Part_Primitives --reuse
```
Final evidence:
`docs/current/business-evidence/13fb362e5bcf598a7f1f90a6-20260917T092342683238.json`.
Duration: 12.766 seconds. All 13 new scenario groups completed without an
assertion error. The helper deliberately returns `not_implemented`, and the
runner returns `acceptance_incomplete`, passed=0, because the complete command
still has the interaction gaps below. Scenario groups are not requirements.
Covered in this increment: analytic curve length, endpoints, left/right
handedness, positive and negative taper, zero start radius, fractional turns,
rendered winding/length, creation and editing history, duplicate names,
second-document isolation, invalid native/facade input rollback, FCStd reopen
and further editing, browser OPFS reload, enum undo/redo, canvas orbit, and
1440x900/390x844 layout and pixel checks. Desktop and mobile images were
visually inspected after the sampling repair.
Detailed result and screenshots:
`docs/current/part-helix-spiral-business/2026-09-17T09-23-30-232Z/`.
The earlier `20260917T091832233789` report completed weaker assertions but its
Spiral images revealed missing turns. It is preserved as diagnostic history;
use the final report above for this increment. Reexecution occurred only after
fixing the newly discovered rendering defect and strengthening its assertions.
Native DocumentProbe build, TypeScript checking, production Vite build, and
scoped native whitespace checks completed. Existing server:
`http://127.0.0.1:5180/workbench.html?module=Part&command=Part_Primitives`.
## Next Gaps
Do not recreate or replay Plane, Box, Cylinder, Cone, Sphere, Torus, Ellipsoid,
Prism, RegularPolygon, Circle, Ellipse, Line, Vertex, Wedge, Helix or Spiral
type-creation cases unchanged. The previous six-type work is documented in
`PART_ADDITIONAL_PRIMITIVES_PROGRESS.md`; Wedge evidence is in
`part-wedge-business/2026-09-17T09-02-54-877Z/result.json`.
Implement and add only new scenarios for:
1. Placement/orientation controls and active-container membership, including
native history and persistence. Consult the common DlgPrimitives placement
and active-part creation code before extending the task.
2. Cylinder skew controls and circle-from-three-points interaction.
3. Any remaining full desktop task-lifecycle semantics identified from those
source paths. Current type availability is not full command acceptance.
The other selected requirement, Part_ProjectionOnSurface, is being developed
by the existing unattended service. This increment does not claim its linked
projection, preview transaction or selection-gate behavior is complete.
All original 1507 requirements and the supplemental IFC requirement remain.