All checks were successful
Build and Test / build (pull_request) Successful in 32m17s
Copy QuickNav and ZTools source trees into reference/ for developer reference during the UI/UX rework. These are plain directories (not submodules) and are not included in the build. - reference/quicknav/ — QuickNav addon source - reference/ztools/ — ZTools addon source Part of the UI/UX rework preparation. See #346.
2.1 KiB
2.1 KiB
Datum Attachment Work - In Progress
Context
Implementing proper FreeCAD attachment for datum objects to avoid "deactivated attachment mode" warnings.
The pattern is adding source_object and source_subname parameters to each datum function and using _setup_datum_attachment() with appropriate MapModes.
Completed Functions (in core.py)
Planes
plane_offset_from_face- MapMode='FlatFace'plane_midplane- MapMode='TwoFace'plane_from_3_points- MapMode='ThreePointPlane'plane_normal_to_edge- MapMode='NormalToPath'plane_angled- MapMode='FlatFace' with rotation offsetplane_tangent_to_cylinder- MapMode='Tangent'
Axes
axis_from_2_points- MapMode='TwoPointLine'axis_from_edge- MapMode='ObjectXY'axis_cylinder_center- MapMode='ObjectZ'axis_intersection_planes- MapMode='TwoFace'
Points
point_at_vertex- MapMode='Vertex'
Remaining Functions to Update (in core.py)
point_at_coordinates- No attachment needed (explicit coordinates), but could use 'Translate' modepoint_on_edge- Use MapMode='OnEdge' with MapPathParameter for positionpoint_center_of_face- Use MapMode='CenterOfCurvature' or similarpoint_center_of_circle- Use MapMode='CenterOfCurvature'
After core.py Updates
Update datum_commands.py to pass source references to the remaining point functions:
create_point_at_vertex- already donecreate_point_on_edge- needs updatecreate_point_center_face- needs updatecreate_point_center_circle- needs update
Pattern for Updates
-
Add parameters to function signature:
source_object: Optional[App.DocumentObject] = None, source_subname: Optional[str] = None, -
In the body section, use attachment instead of placement:
if source_object and source_subname: support = [(source_object, source_subname)] _setup_datum_attachment(point, support, "MapMode") else: _setup_datum_placement(point, App.Placement(...)) -
Update datum_commands.py to extract and pass source references from selection.