Commit Graph

11 Commits

Author SHA1 Message Date
Billy Huddleston
650ebf693e CAM: Add threshold for treating large-radius arcs as linear in simulator
Arc segments with extremely large radius compared to chord length can
cause floating-point precision issues in simulation. This change
introduces ARC_LINEARIZATION_THRESHOLD to treat such arcs as linear,
improving numerical stability in the simulator.

The following g-code was causing erractic behavior in the simulator due
to large-radius arcs:
```
G2 I88775.835760 J-1936991.545892 K0.000000 X102.063107 Y100.102815 Z12.700001
```

src/Mod/CAM/PathSimulator/AppGL/MillPathSegment.cpp:
- Added ARC_LINEARIZATION_THRESHOLD constant
- Updated arc motion detection to treat large-radius arcs as linear
- Improved handling of arc vs. linear segment classification
2026-01-12 10:52:06 -06:00
pre-commit-ci[bot]
25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
PhoneDroid
ba99bc5da4 [ CAM ]: Update SPDX License Identifiers 2025-10-31 17:00:32 -04:00
Chris Hennes
67435e22ca CAM(PathSimulator): Use single-precision pi
All of PathSimulator uses floats, rather than doubles: to prevent
compiler warnings about truncation, explicitly use the single-precision
version of the standard pi constant.
2025-05-31 17:57:24 -05:00
pre-commit-ci[bot]
b9c7f385a2 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2025-05-22 23:17:56 +00:00
Andrea
af0287e174 CAM: use std::numbers pi definition
se std::numbers pi definition
2025-05-23 01:11:37 +02:00
Adrian Insaurralde Avalos
7274dac185 CAM: apply precommit 2024-09-03 14:54:36 -04:00
Shai Seger
e15af16232 [CAM SIMULATOR] Bug fixes for Issues #16073 and #16052 (#16118)
* Bug fixes for Issues #16073 and #16052

* Fix tool rendering when tool position is not reset. Issue #16180

* Fix some lint warnings
2024-09-02 11:31:08 -05:00
Shai Seger
a750034490 Cam simulator feature update (#15597)
* remove redundant code

* Improve lighting, add ambient occlusion

* Add cleanup code. Dialog is now deleted when cloesd.

* change back to ambient occlusion

* Fix G8x drill sequence bug.  issue #14369

* fix bad simulation artifacts under Linux and QT. Issue #14369

* fix merge issue

* fix border artifact on buttons

* support showing path lines. revise the gui.

* add option for arbitrary solids. wip

* use vectors instead of mallocs

* Handle arbitrary stock shapes + show base shape.

* Complete the base shape display feature. eliminate co-planar artifacts.

* support window scaling. upstream issue #14334

* Apply lint fixes

* some missing lints.

* Attend pylint issues

* Apply code fixes based on @kadet1090 review

* fix some clang-tidy warnings.

* CAM: Linter cleanup round 1

---------

Co-authored-by: Chris Hennes <chennes@gmail.com>
2024-08-21 15:18:52 -05:00
wmayer
68889f05ec PathSimulator: Fix many compiler warnings 2024-05-23 10:12:13 +02:00
Shai Seger
ff40ef3586 New Cam simulator based on low level OpenGL functions (faster and more precise) (#13884)
* Initial opengl test window

* added core files

* some fixes for code comparability with other platforms

* more compatibility cleanup

* add missing opengl libraries

* Basic simulation window works!

* try using different define

* fix wrapper for better compatibility

* Gui is now operational

* Finally SIM works on actual freecad models

* support drill commands

* cleanup python script and add tool profile generation

* Now using actual tools specified in the operation.

* support mouse wheel and freecad-style 3d navigation

* Support accuracy gauge

* remove endsimulation reference

* show simulation speed indicator

* apply clang-format

* apply changes suggested by code review

* gui items are loaded via QT resource system instead of hard coded

* use vector instead of pointer to pass tool profile points

* Fix some more formatting errors.
2024-05-22 10:16:34 -05:00