Commit Graph

699 Commits

Author SHA1 Message Date
Ajinkya Dahale
0b812405a0 [Sketcher] Fix issue in replaceGeometries when more old than new 2026-01-06 05:42:44 +05:30
ᴩʜᴏɴᴇᴅʀᴏɪᴅ
d2c3486ff0 SPDX [ 41 ][ Src / Mod / Sketcher ] (#25135) 2025-12-25 12:00:22 -06:00
marbocub
b9e8370404 Sketcher: add reverse mapping correction to Carbon Copy (#25745)
* Sketcher: add reverse mapping correction to Carbon Copy

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Replace M_PI with std::numbers::pi

* Replace vector initialization with Base::Vector3d::UnitX/UnitY, apply suggestions from code review

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Fix guard clause logic, apply suggestions from code review

* Replace std::numbers::pi with pi via `using std::numbers`

* Fix issues reported by the linter

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-12-22 15:00:49 +01:00
Chris Hennes
3118469338 Merge pull request #25914 from AjinkyaDahale/sk-fix-25281
Sketcher: Handle angle constraint on sketchobject changes
2025-12-15 10:15:13 -06:00
theo-vt
e5946a624a Sketcher: Do not autoscale if there are blocked geometries 2025-12-15 09:20:20 -06:00
Ajinkya Dahale
d91bd7015a Sketcher: Only transfer angle to relevant segment on trim etc. 2025-12-12 11:23:00 +05:30
Ajinkya Dahale
f8aaeb2262 Sketcher: Handle angle constraint on sketchobject changes
Primarily trim, but also expected to affect split, extend etc.
2025-12-12 09:17:05 +05:30
PaddleStroke
7a75405249 Sketcher: Fix errors message when selecting circle seam point. (#25953) 2025-12-05 07:17:30 +00:00
PaddleStroke
018981eeec Sketcher: fix new external always construction (#25733) 2025-12-01 21:49:24 -06:00
PaddleStroke
fda6998b33 Sketcher: External Face: decide between defining and construction (#25390) 2025-11-24 10:47:12 -06:00
theo-vt
63c0ec02b9 Sketcher: Proceed to chamfer/fillet on a vertex if there are more than 2 lines but only two non-construction lines 2025-11-15 10:08:22 -06:00
pre-commit-ci[bot]
9fe130cd73 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Ajinkya Dahale
971f1bd59b Sketcher: Only transfer equality in specific cases in trim
The transfer on should apply to (arcs of) conics.

Fixes #25008.
2025-11-05 12:48:05 -06:00
matthiasdanner
54c2470027 Sketcher: Fix Angle Constraint jumping to opposite side on movement (#24150)
* Sketcher: Fix Angle Constraint jumping to opposite side on movement

* implement way to dynamically disable snapping where not needed

---------

Co-authored-by: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com>
2025-10-13 18:07:09 +02:00
PaddleStroke
a327c4a522 Sketcher: Fix toggle construction not undoable (#24539)
* Sketcher: Fix toggle construction not undoable

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-10-09 12:31:50 -05:00
theo-vt
5ab4080cf1 Sketcher: fix split breaking sketch (#23711)
* Sketcher: Scale: Reorder operations and delete original modified constraints to ensure validity

* Sketcher: replace boolean parameters for deletion with enum and expose solver override on some deletion functions in the python API

* Use correct flag in ::delGeometry

* Set default value of false to noSolve

* Sketcher: autoscale: use deleteAllGeometry

* Sketcher: Scale: revert to checking constraints for geoId validity and handle horizontal&vertical

* Sketcher.Split: Avoid early solve that can break sketch

* Avoid reintroducing a typo

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-09-23 12:00:36 -05:00
Markus Reitböck
45c02f7978 Sketcher: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
 should be considered an optimization, not a requirement. In particular, do not explicitly include a
 precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
 generated precompile header on the compiler command line instead. This is more portable across
 the major compilers and is likely to be easier to maintain. It will also avoid warnings being
 generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-23 00:51:00 +02:00
matthiasdanner
5f52aa5901 Fix "Show only Visible Constraints" option (#23187)
Co-authored-by: Matthias Danner <28687794+matthiasdanner@users.noreply.github.com>
2025-09-22 10:54:24 -05:00
Furgo
15adc6f2c8 Sketcher: improve Make Internals property tooltip (#23636)
* Sketcher: improve Make Internals property tooltip

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Sketcher: reword final MakeInternals tooltip

* Sketcher: apply final code review suggestion

Co-authored-by: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com>

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Max Wilfinger <6246609+maxwxyz@users.noreply.github.com>
2025-09-21 08:24:30 +00:00
theo-vt
22b2a7cd56 Sketcher: Use the right delete flag for delConstraints 2025-09-17 16:42:40 -05:00
theo-vt
57f4987ce3 Sketcher: fix invalid constraint on first dimension (#23024)
* Sketcher: Scale: Reorder operations and delete original modified constraints to ensure validity

* Sketcher: replace boolean parameters for deletion with enum and expose solver override on some deletion functions in the python API

* Use correct flag in ::delGeometry

* Set default value of false to noSolve

* Sketcher: autoscale: use deleteAllGeometry

* Sketcher: Scale: revert to checking constraints for geoId validity and handle horizontal&vertical
2025-09-07 18:03:15 +02:00
Valentin Rusu
fd1855268a Fix segfault where DatumLine does not have a refSubSHape 2025-08-19 11:54:32 +02:00
Johannes Wüller
1e42193ca6 Sketcher: Fix external geometry out-of-bounds vector access (#22181)
* Sketcher: Fix external geometry out-of-bounds vector access

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
Co-authored-by: Ajinkya Dahale <AjinkyaDahale@users.noreply.github.com>
Co-authored-by: Benjamin Bræstrup Sayoc <benj5378@outlook.com>
2025-07-29 18:36:17 +00:00
Chris Hennes
71a9a3af25 Sketcher: Clean up some old commented out code 2025-07-25 19:12:30 -05:00
Chris Hennes
359542df67 Sketcher: Extract "processFace" function
Tool-aided refactor, no functional changes.
2025-07-25 10:08:29 -05:00
Chris Hennes
06a8685990 Sketcher: Resolve "Declaration hides variable"
Reduce some code duplication via helper method.
2025-07-25 09:48:34 -05:00
Chris Hennes
70811ee630 Sketcher: Resolve "Type confusion" CodeQL critical warning 2025-07-25 09:21:43 -05:00
Ajinkya Dahale
1ff83fcf23 Sketcher: Improve constraint transfer in SketchObject::trim()
Provide new geos to `deriveConstraintsForPieces` manually, since they are
not (and likely cannot be at time of calling) added to the sketch. This will
make sure that the method has sufficient information to properly transfer/create
new constraints.
2025-07-19 03:25:38 +05:30
Ajinkya Dahale
095d905a86 Sketcher: Skip checks in deriveConstraintsForPieces when risky
Possibly fixes #22352.

It is possible to call the method when new geos are not yet created or added to
the sketch. In such cases, the values obtained can be "dirty", and is likely a
seg-fault.
2025-07-19 03:25:38 +05:30
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
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
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
Chris Hennes
ec86e2a440 Sketcher: Remove redundant checks
Also cleanup missing curly braces.
2025-06-20 22:48:31 +02:00
Chris Hennes
bb1760546b Sketcher: Remove dead code 2025-06-20 22:41:59 +02:00
paddle
24efbf4234 Part: FaceMakerRing from RealThunder's branch.
Co-authored-by: Zheng Lei <realthunder.dev@gmail.com>
Co-authored-by: Pierre-Louis Boyer <pierrelouis.boyer@gmail.com>
2025-06-16 10:33:35 -05:00
theo-vt
be24c6bbf3 Sketcher: Sketch autoscale (#21084)
* Working scale prototype

* Call viewAll to fit geometries in the viewport post-scaling

* Exclude angle dimensions

* Scale the viewport rather than calling viewAll

* Scale dimension annotation along geometries

* Early return when counting more than one dimensional constraint

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Disable sketch autoscale if there are external geometries in the sketch

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Add a setting to disable the feature _ and eventually parametrize

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Check for objects in the viewport in the sketch's ancestry to decide wheter or not to autoscale

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* More consistent camera scaling

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Check for visual indicator in the whole document

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Find visible items in nested assemblies

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Check visual elements in assemblies nested in assemblies

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Set the dimension even if the scaling fails

* Allow constraints that interact with the origin axis/root

* Remove unused variable

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Misc fixes from review

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-06-09 18:31:44 +02:00
theo-vt
1a0a68ae69 PartDesign: Fix hole centered on point edge case (#21257)
* Light refactor of getTopoShape function

* Fix hole edge case

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update src/Mod/Part/App/PartFeature.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Refactor simplifyCompound()

* Use Base::Flags<GetShapeOption>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Shorten enum name and move it from class scope to namespace scope

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-05-29 22:37:54 +02:00
mosfet80
68aaa50100 Sketcher: Remove unused variables (#21504)
removed unused variables
2025-05-25 00:19:46 +02:00
jffmichi
7c4b0b4d4b Sketcher: remove surplus push_back to shapes (fixes #21499) 2025-05-22 06:24:47 +02:00
Ajinkya Dahale
ecb3ede295 Sketcher: Incorporate comments from #20589
See https://github.com/FreeCAD/FreeCAD/pull/20589#pullrequestreview-2830404892.
2025-05-19 20:24:17 +02:00
Ajinkya Dahale
845c187675 Sketcher: clean up import 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
1d5ab2b57f Sketcher: Remove some unused lambda captures 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
e4fa90e3b6 [Sketcher] Refactor SketchObject::delAllExternal()
Trivial changes.
2025-05-19 20:24:17 +02:00
Ajinkya Dahale
9aba1d6a3f [Sketcher][WIP] Refactor SketchObject::buildShape() 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
1235db0e8f [Sketcher] Use std::ranges in SketchObject where possible 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
964db8e5b5 [Sketcher] Refactor SketchObject::split() 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
9cfd93d8bc [Sketcher][WIP] Refactor SketchObject::addExternal() 2025-05-19 20:24:17 +02:00
Ajinkya Dahale
650ccb8b4e [Sketcher] Refactor SketchObject::toggleExternalGeometryFlag()
Doesn't seem to be used anywhere. Remove?
2025-05-19 20:24:17 +02:00
Ajinkya Dahale
3b19a1b2ac [Sketcher][WIP] Refactor SketchObject::generateId()
Should be just the same old loop and conditional rearrangement. However, not
confident that this behaves exactly the same as previously.
2025-05-19 20:24:17 +02:00