Skip to content

sketch UX, planar-face pick, extrude distance, dimensions #88

@trailcode

Description

@trailcode

sketch UX, planar-face pick, extrude distance, dimensions

Summary

Branch Trailcode/b6 bundles reliability fixes for sketch-from-face picking, length-dimension presentation, face extrude with typed distance, permanent node markers, and consistent shape display modes. It also renames the edge-length dimension mode to Sketch_dim_anno for clearer naming.

Suggested branch for follow-up PR: merge Trailcode/b6 into main, or open a PR titled e.g. Sketch: planar face pick, dim_anno rename, extrude finalize, display mode.

Bug fixes

  • Planar face sketch — LMB picking (src/occt_view.cpp, src/occt_view.h): Run create_sketch_from_planar_face_() on LMB press before AIS_ViewController::PressMouseButton, and skip the paired controller ReleaseMouseButton so detection state is not altered in a way that blocks face hits on solids.
  • Length dimensions — vertex spheres (src/geom.cpp): Build PrsDim_LengthDimension from gp_Pnt instead of temporary TopoDS_Vertex, so OCCT does not draw vertex attachment spheres at dimension endpoints.
  • Face extrude + numeric distance (src/shp_extrude.cpp, src/shp_extrude.h, src/occt_view.cpp): Enter only refreshes preview; finalize runs when the distance editor commits (finalize_sketch_extrude_()). Track Plane_side m_extrude_side so extrude direction matches the last valid cursor side relative to the sketch plane.
  • Extrude preview (src/shp_extrude.cpp): Centralize in _update_extrude_preview_(dist, side) with EZY_ASSERT(side != Plane_side::On) and guard near-zero distance.
  • Permanent “+” node marks (src/sketch.cpp): Show only in Mode::Sketch_add_node; call sync_permanent_node_annos_() from on_mode() so markers update when leaving add-node or switching tools.

Improvements / refactors

  • Mode rename: Sketch_toggle_edge_dimSketch_dim_anno; toggle_edge_dimtoggle_edge_dim_anno (modes.h, modes.cpp, gui.cpp, gui_mode.cpp, occt_view.cpp, sketch.cpp, sketch.h). Toolbar string shortened; usage-sketch.md step label updated.
  • modes.h: Tidier EZY_MODE_LIST formatting (enum order unchanged — persistence).
  • Display mode: New primitives and JSON-loaded shapes use shp->get_disp_mode() instead of hardcoded AIS_Shaded (src/occt_view.cpp); extruded preview body uses the same.

Acceptance criteria

  1. Sketch from planar face: On a solid, LMB reliably selects the intended planar face and creates the sketch without requiring workarounds.
  2. Length dimensions: New dimensions show clean geometry (no extra spheres at endpoints) in typical views.
  3. Extrude: Typing a distance and committing completes extrusion with preview matching final direction; Enter does not prematurely finalize in a way that conflicts with distance edit (per current design: refresh only on Enter for extrude mode).
  4. Permanent nodes: “+” markers appear only while adding nodes, not in inspection or other sketch modes.
  5. New shapes / load: Display respects each shape’s configured display mode where applicable.

Technical notes (files touched)

Area Files
Picking / modes / display occt_view.cpp, occt_view.h
Dimensions geom.cpp
Extrude shp_extrude.cpp, shp_extrude.h
Sketch / modes sketch.cpp, sketch.h, modes.h, modes.cpp, gui.cpp, gui_mode.cpp
Docs usage-sketch.md

Related

  • Oblique-view visibility for Sketch_dim_anno is tracked separately: issue-sketch-dim-anno-oblique.md.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions