* Fix Linux SpaceMouse jerkiness: coalesce spnav events and batch camera updates
On Linux, pollSpacenav() posts every spnav motion event individually
(125-250Hz from spacenavd), each triggering a full scene redraw. Combined
with camera->orientation and camera->position each triggering separate
Coin3D notifications, this results in up to 500 redraws/sec.
Fix 1 - Event coalescing (GuiNativeEventLinux.cpp):
The drain loop now keeps only the latest motion state and posts once after
all pending events are consumed. SpaceMouse events are absolute deflection
(current puck position), not deltas, so the latest event always contains
the complete state.
Fix 2 - Batched camera updates (NavigationStyle.cpp):
Wrap camera property changes in enableNotify(false/true) + touch() so
Coin3D fires a single redraw instead of two per event.
Together this reduces redraws from ~500/sec to ~60/sec (display refresh),
eliminating the jerky navigation that Linux users experience with complex
models.
Fixes#25926
* Add per-axis deadzone filtering for Linux SpaceMouse
Each SpaceMouse axis has different sensitivity and noise characteristics.
A single global deadzone is too coarse — rotation axes may need different
thresholds than translation axes.
Read per-axis deadzone values from user.cfg (BaseApp/Spaceball/Motion)
using keys PanLRDeadzone, PanUDDeadzone, ZoomDeadzone, TiltDeadzone,
RollDeadzone, SpinDeadzone. Values default to 0 (no filtering).
Axis values below their individual threshold are zeroed before posting
the motion event, preventing unintended drift from sensor noise while
preserving intentional small movements.
This is the Linux equivalent of deadzone handling that NavLib provides
on Windows/macOS.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Use std::array for axisDeadzoneKeys to avoid magic number
Replace C-style array with std::array and use .size() instead of
hardcoded loop bound, as suggested in code review.
* Cache deadzone values with ParameterGrp Observer instead of polling
Replace per-event GetParameterGroupByPath + GetInt calls with a static
DeadzoneCache that loads values once and updates them via
ParameterGrp::ObserverType when user.cfg changes. Also use
static constexpr for the keys array and std::abs for readability.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Move DeadzoneCache from static local to member variable
Replace the static local DeadzoneCache in pollSpacenav() with a
std::unique_ptr<DeadzoneCache> member of GuiNativeEvent, initialized
in initSpaceball() after the spnav connection is established.
Forward-declare in the header to keep includes minimal.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Maik-0000FF <Maik-0000FF@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Base: Added Quantities for Optic/Chemical mechanics
* [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>
Remove the TestSketcherGui file entirely, it contained only commented
lines. Delete commented out debugging output. Remove other commented-out
code that didn't have any explanation or justification for leaving it
in.
This method aims to solve the problem of untranslatable description
strings on file types. Some, but not all, file format description
strings contain translatable elements. For example, some languages
may translate "FEM mesh formats". Many format descriptions include
the words "file," "format," or "mesh" -- these could potentially be
replaced with localized versions.
This commit prevents unhandled exceptions to be thrown in the Add
Property dialog. When the user provides a valid name, for example 'Abc'
and then an invalid name, for example 'Abc^', an exception is thrown
that is caught by Qt's notify which may lead to a crash. This is caused
by the fact that the editor is still bound to the old property that has
been removed. The main idea was to preserve values that were provided
by the user as long as possible, also when a property name changes.
This design goal tried to preserve the user provided value even if the
property name is not valid. Although the underlying property item is
explicitly unbound in that situation, the editor is not.
The solution is to also explicitly unbind the editor if there is an
editor that can have bindings. Unbinding an editor does not
automatically hide the f(x) symbol in the editor (leading to errors on
unbound editors), so this commit also adds a bit of logic to hide
the f(x) symbol when an editor is unbound.
The memory is allocated using new() with alignment requirements, and
should be deleted using the same alignment requirement. See
issue #27781 for the valgrind error.
* Sketcher: Fix crash on external deletion
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update SketchObject.pyi
* Update SketchObjectPyImp.cpp
* Update ViewProviderSketch.cpp
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update SketchObjectPyImp.cpp
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Sketcher: Fix last external not being removed from ref 27719
* Update SketchObject.cpp
* Update SketchObject.cpp
* Update SketchObject.h
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* rename fixMissingAxisInExternalGeo
* Update SketchObject.cpp
* Update SketchObjectPyImp.cpp
* [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>
* App: add PropertyListsT::removeIf()
For convenient list value filtering.
Co-authored-by: Zheng Lei <realthunder.dev@gmail.com>
* Update Property.h
* Update Property.h
* Assembly: Fix JCS position if assembly is transformed
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* redrawJointPlacement & showPreviewJCS Refactor to avoid duplicate code
* Assembly: JointObject: Simplify setJCSPosition
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
* Update JointObject.py
* Update src/Mod/Assembly/JointObject.py
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Benjamin Nauck <benjamin@nauck.se>
Adjusted G code output to include FreeCAD body and job information.
The first comment in the G code is shown on the machine controller,
and should contain useful information for operators to to identify
jobs. Fetch the body and job label using findParentJob and insert it
into the G code. For some reason the body and job information is not
available when called from TestFanucPost.py, so handle case where it
is undefined as earlier. This new use of findParentJob exposes error
in mock code used in code tests. This is fixed in a different pull
request to make this patch easily backportable to the 1.1 branch.
Fixed issues with Fanuc post processor discovered by lint. Made sure
global variables used are declared. This fixes issue updating the
postamble and preamble introduced in
ef794c31bd
Added docstrings, adjusted import statements and wrapped long line to
keep linter happy.
Reformatted code with black for consistent formatting.
Also reverted obsolete setText() workaround from commit
9c78ced00c now
that https://github.com/FreeCAD/FreeCAD/pull/26008 is merged.