Commit Graph

3666 Commits

Author SHA1 Message Date
Benjamin Nauck
fb48707ef3 Sketcher: Add support for more than 3 points
While this adds a new way, it keeps the old to make it easier to merge.
This will allow other work to be merge before without rebase issues
2025-07-21 18:02:23 +02:00
Benjamin Nauck
7e8a65b82b Sketcher: Initialize constraint members in class declaration 2025-07-21 18:02:23 +02:00
wmayer
9cc45f5efe Sketcher: fix for issue 12925 2025-07-21 10:55:06 -05:00
PaddleStroke
64c8ec77f8 Sketcher: Dimension: Offset the label when moving mouse (#22387)
* Sketcher: Dimension: Offset the label when moving mouse

* Sketcher: Create dedicated enum for offset boolean

This improves readability because the intent must be stated explicitly.

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-07-20 19:47:21 +02:00
matthiasdanner
d3887d09a4 Sketcher: Add second arc helper on diameter constraint (#22579)
* add second arc helper on diameter constraint

* fix linter warnings

---------

Co-authored-by: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com>
2025-07-20 19:46:49 +02:00
Chris Hennes
fd14f657e6 Merge pull request #22227 from kadet1090/refactor-tool-hints
Sketcher: Refactor Tool Hints
2025-07-20 12:05:15 -05:00
PaddleStroke
15f2bb741e Sketcher: Fix random gray icon (#22502)
* Sketcher Fix #10027
2025-07-20 00:17:58 +02:00
Kacper Donat
139871dad9 Sketcher: Declare tr function for DrawSketchHandler 2025-07-19 10:05:09 +02:00
Kacper Donat
919ca877bc Sketcher: Use generic tool hints table for DrawSketchHandlerBSpline 2025-07-19 10:05:09 +02:00
Kacper Donat
403540ce66 Sketcher: Use generic tool hints table for DrawSketchHandlerTranslate 2025-07-19 10:05:09 +02:00
Kacper Donat
dc77ed7830 Sketcher: Use generic tool hints table for DrawSketchHandlerSlot 2025-07-19 10:05:09 +02:00
Kacper Donat
a019ae871d Sketcher: Use generic tool hints table for DrawSketchHandlerScale 2025-07-19 10:05:08 +02:00
Kacper Donat
ee3261482c Sketcher: Use generic tool hints table for DrawSketchHandlerRotate 2025-07-19 10:05:08 +02:00
Kacper Donat
f1eb315f20 Sketcher: Use generic tool hints table for DrawSketchHandlerRectangle 2025-07-19 10:05:08 +02:00
Kacper Donat
ec6ef0c43a Sketcher: Use generic tool hints table for DrawSketchHandlerPolygon 2025-07-19 10:05:08 +02:00
Kacper Donat
14f25dc4b3 Sketcher: Use generic tool hints table for DrawSketchHandlerLineSet 2025-07-19 10:05:08 +02:00
Kacper Donat
8824646d27 Sketcher: Use generic tool hints table for DrawSketchHandlerLine 2025-07-19 10:05:08 +02:00
Kacper Donat
fd6c654561 Sketcher: Use generic tool hints table for DrawSketchHandlerFillet 2025-07-19 10:05:08 +02:00
Kacper Donat
d3e823d5e0 Sketcher: Use generic tool hints table for DrawSketchHandlerExtend 2025-07-19 10:05:08 +02:00
Kacper Donat
817fd9e638 Sketcher: Use generic tool hints table for DrawSketchHandlerEllipse 2025-07-19 10:05:08 +02:00
Kacper Donat
f595ee5e07 Sketcher: Use generic tool hints table for DrawSketchHandlerCircle 2025-07-19 10:05:08 +02:00
Kacper Donat
bfb9d47ec6 Sketcher: Use generic tool hints table for DrawSketchHandlerBSpline 2025-07-19 10:05:08 +02:00
Kacper Donat
c4f4f89100 Sketcher: Use generic tool hints table for DrawSketchHandlerArcSlot 2025-07-19 10:05:08 +02:00
Kacper Donat
dea79014ef Sketcher: Use generic tool hints table for DrawSketchHandlerArcOfParabola 2025-07-19 10:05:08 +02:00
Kacper Donat
43208d2d2e Sketcher: Use generic tool hints table for DrawSketchHandlerArcOfHyperbola 2025-07-19 10:05:08 +02:00
Kacper Donat
5184c1008c Sketcher: Use generic tool hints table for DrawSketchHandlerArcOfEllipse 2025-07-19 10:05:08 +02:00
Kacper Donat
d385a21847 Sketcher: Use generic tool hints table for DrawSketchHandlerArc 2025-07-19 10:05:08 +02:00
theo-vt
41f539dbaf Sketcher: Only autoscale if the datum being edited is the scale defining datum (#22419) 2025-07-18 09:58:30 -05:00
Florian Foinant-Willig
311108a3ab Sketcher: manage legacy negative circle-line distance (#22203)
* manage legacy negative circle-line distance

* Add test for legacy negative circle-line distance
2025-07-17 23:00:38 -05:00
matthiasdanner
870f1266f9 Sketcher: Fix Constraint Filter Handling (#22072)
* Fix SpecialFilter Handling for selected and associated constraints
Fix show constraints in 3d view if no constraints in list and filter to only show selected is disabled

---------

Co-authored-by: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-07-17 07:51:44 +00:00
PaddleStroke
905d73b00d Sketcher: add ConstraintLineByAngle helper. (#22273)
* Sketcher: add ConstraintLineByAngle helper.

* Update src/Mod/Sketcher/Gui/Utils.cpp

* Update src/Mod/Sketcher/Gui/Utils.cpp

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-07-14 19:44:32 +00:00
Florian Foinant-Willig
0ad55281ad Sketcher: clean planegcs/Geo (#22378)
* Sketcher: clean planegcs/Geo
2025-07-14 10:56:25 -05:00
theo-vt
076ea9b162 Sketcher: assign the old geometries' GeometryId[s] to new geometries after scaling (#22263)
* Reassign facade ids after scale operation if deleting geometries

* Fix failing CI
2025-07-14 17:39:03 +02:00
Fermín Olaiz
7fec747d90 Fix crash on out-of-bound vector access (#22397) 2025-07-09 19:07:11 +02:00
FEA-eng
8cc90069eb Sketcher: Add tooltip for autoscale feature (#22252)
* Sketcher: Update SketcherSettings.ui

* Sketcher: Update SketcherSettings.ui
2025-07-07 18:31:55 +02:00
Max Wilfinger
e6d74e6316 Sketcher: Update missed UI strings (#22363) 2025-07-07 10:16:07 +02:00
theo-vt
16fa3ad094 Sketcher: Autoscale: do not scale dimension's position if it is a radius or diameter (#22308)
* Do not scale dimension's position if it is a radius or diameter

* Update src/Mod/Sketcher/Gui/EditDatumDialog.cpp

Sketcher: spell checking

---------

Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
2025-07-06 23:25:24 +00:00
Luz Paz
059619cc28 Fix various typos
Found via codespell
2025-07-04 21:24:09 +02:00
Max Wilfinger
36659f0176 Sketcher: Update UI strings for consistency (#22167)
* Sketcher: Update UI strings for consistency

* Update src/Mod/Sketcher/App/Sketch.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/App/SketchObject.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Update src/Mod/Sketcher/Gui/Command.cpp

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>

* Apply suggestions from code review

* Apply suggestions from code review

---------

Co-authored-by: Ryan K <114723629+ryankembrey@users.noreply.github.com>
2025-06-30 22:51:46 +00:00
Karliss
d152bda853 Sketcher: fix Esc can leave setting synchronization 2025-06-30 09:51:08 -05:00
George Peden
2c1d23e4e5 Sketcher: Add contextual input hints to constraint commands (InputHints Phase 2) (#21751)
* Sketcher: Extend InputHints infrastructure to constraint tools

- Implement DrawSketchHandler::getToolHints() for constraint workflows
- Add centralized hint table mapping constraint commands to step-specific InputHints
- Integrate hint lookup in DrawSketchHandlerGenConstraint and dimension handler
- Provide step-by-step user guidance for:
  - Coincident, PointOnObject, Distance (X/Y)
  - Horizontal, Vertical, HorVer, Lock, Block
  - Equal, Symmetric, Radius, Diameter, Angle
  - Tangent, Perpendicular, Parallel

This continues the InputHints work started for drawing tools by enabling consistent, contextual guidance for constraint creation, including multi-step workflows like tangent-via-point.

* Call updateHint() after selection reset to re-arm the first-step prompt
when the tool stays active after apply.

* Add comments to hints table structure

* Sketcher: Update constraint hint text to use "pick" instead of "Select"

Change constraint hint text from "Select" to "pick" to maintain consistency
with existing FreeCAD UI style. This affects the DrawSketchHandlerGenConstraint
hint system for various constraint operations including coincident, distance,
horizontal/vertical, block, lock, symmetry, tangent, perpendicular, parallel,
and distance constraints.

The hints now follow the pattern:
- "%1 pick first point or edge"
- "%1 pick second point or edge"
- "%1 pick line or two points"
etc.

This provides consistent terminology throughout the sketcher constraint
creation workflow.

* - Remove redundant 'first' from initial selection hints
- Improve consistency in hint text formatting per Developer Guidelines
- Add consistent spacing in comment sections"

* Per PR feedback for DrawSketchHandlerDimension hints:
* Change 'Click to' to "pick"
* Simplify hint wording
* Combine redundant else
* Use direct return pattern instead of building hints list

* Update lookupConstraintHints() to use C++20 std:ranges::find_if form per PR review feedback

* Sketcher: Refine constraint hints per PR feedback

- Use consistent 'point or edge' phrasing in Distance and DistanceX/Y tools
- Reword Horizontal/Vertical step 0 to avoid misleading 'two points'
- Generalize Tangent and Perpendicular hints to 'edge' with optional point
- Simplify legacy Distance to 'point or edge'

* Add dynamic hint handling for PointOnObject constraint
- Implemented contextual hints in getToolHints() to generate an appropriate step 2 hint based on step 1 selection type
- Preserved static lookupConstraintHints() for all other tools

* Sketcher: Convert constraint hint table to C++20 designated initializer syntax

- Refactored static constraint hint table to follow Sketcher hint development guidelines
- Uses C++20 designated initializers for clarity and maintainability
- No changes to hint logic or behavior; content is identical to previous version
2025-06-23 21:24:33 +02:00
Benjamin Nauck
1ef1a53679 Merge pull request #21943 from tetektoza/fix/21927_change_enter_ovp_accepting_dim
Sketcher: Change enter behavior on OVP to put OVP in lock state only
2025-06-23 21:18:41 +02:00
George Peden
565190fa9d Sketcher: Add contextual input hints to transform tools (InputHints Phase 4) (#21840)
* Add hints to symettry tool

* Add hint system for transform tools
- Design decision: Keep hints simple and focused on primary mouse actions
- Avoid redundancy with dialog UI which already shows keyboard shortcuts clearly
- Implements progressive hints for multi-state tools (Rotate, Scale, Translate)
  using declarative hint tables, and focused hints for single-state tools
  (Symmetry, Offset) using direct return implementations.

* Cleanup unused declarative hint decls

* Change hint to 'pick axis, edge, or point" per PR feedback
2025-06-23 11:09:59 -05:00
Karliss
8db55284cc Sketcher: Implement related constraint command for non edges 2025-06-23 11:01:33 -05:00
Florian Foinant-Willig
b749db373d Sketcher: Fix circle-line negative distance 2025-06-23 10:56:45 -05:00
Florian Foinant-Willig
59f67812a7 Sketcher: refactor planecgs/Constraints (#21988)
* Sketcher: refactor planecgs/Constraints

Remove code duplication

* Clarify param push with `Copy()`
2025-06-23 10:39:34 -05:00
matthiasdanner
b9b57f8c02 Sketcher: 3 Point Symmetry fixed if root is selected first (and simplify and fix the selection logic) (#21612) 2025-06-22 19:54:39 -05:00
tetektoza
d553e21e53 Sketcher: Add QLabel header for newly added locked icon 2025-06-21 12:46:37 +02:00
tetektoza
9642ce0170 Sketcher: Force cycling back to first labels on OVP if they are not set 2025-06-21 12:46:27 +02:00
tetektoza
a00980cc25 Sketcher: Adjust P&D mode to new enter behavior 2025-06-21 12:46:27 +02:00