FreeCAD/FreeCAD

Expressions: `_math.pi` and `_math.e` are broken

Offen

#15.302 geöffnet am 08.07.2024

 (8 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C++ (5.550 Forks)batch import
Help wantedMod: CoreStatus: ConfirmedTopic: ExpressionsType: Bug

Repository-Metriken

Stars
 (30.913 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 24T 7h) (217 gemergte PRs in 30 T)

Beschreibung

Is there an existing issue for this?

  • I have searched the existing issues

Problem description

FreeCAD provides limited access to the Python math module via expressions using the pseudoproperty _math. _math.pi and _math.e don't seem to work, presumably because of the builtin pi and e constants (which are hardcoded and not related to the Python math ones at all) confusing the expression parser.

For correctly working examples, try any of these in an expression:

_math.inf
_math.nan
_math.tau

Full version info

OS: Gentoo Linux (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.38043 (Git) AppImage
Build type: Release
Branch: main
Hash: 561e521817034ea7660de987d8ab7183ad583595
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: English/United States (en_US)
Installed mods: 
  * parts_library
  * Curves 0.6.40
  * A2plus 0.4.65
  * DynamicData 2.62.0
  * Assembly4 0.50.14
  * dodo 1.0.1
  * Alternate_OpenSCAD 1.0.0 (Disabled)
  * CurvedShapes 1.0.9
  * Design456 0.0.1
  * fasteners 0.5.24
  * SearchBar 1.0.2
  * Nodes 0.1.36 (Disabled)
  * 3D_Printing_Tools
  * Pyramids-and-Polyhedrons
  * workfeature (Disabled)
  * MnesarcoUtils 0.2.5
  * OpenTheme 2024.7.3
  * Manipulator 1.5.7
  * Assembly3 0.12.2
  * lattice2 1.0.0
  * ThreadProfile 1.90.0
  * freecad.gears 1.2.0
  * Launcher
  * CommandPanel
  * CubeMenu
  * Reinforcement
  * PieMenu 1.7.5
  * MeshRemodel 1.9.23

Subproject(s) affected?

Expressions

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributor Guide