Commit Graph

39818 Commits

Author SHA1 Message Date
WandererFan
e9c30cf370 [TD]Dimension font clipping (fix #11452) (#18771)
* [TD]separate alignment and rendering bounding rectangles

* [TD]use alignment rectangle (fix #11452)
2025-01-13 11:13:59 -06:00
Jonas Bähr
382d13ee77 PD: Make GearTests independent of "single solid" setting
When enabling the experimental "Allow multiple solids in Part Design Body
by default" some involute gear tests broke. As a quick measure,
`AllowCompound` was disabled for the respective body. This commit now
makes the tests independent of this setting and removes the workaround.
2025-01-13 11:05:31 -06:00
Pascal de Bruijn
c4116daf99 TechDraw: Component Drawing as default document type (#18827)
Presumably Component Drawings are more common as opposed to Assembly Drawing's
therefore FreeCAD's default should reflect this.

find src/Mod/TechDraw/Templates -iname "*.svg" -exec sed -i 's#Assembly Drawing#Component Drawing#g' "{}" \;
2025-01-13 11:59:57 -05:00
Kevin Martin
6c6904453d Address the poor performance of the existing unique-name generation (part 1) (#18589)
* Change Address the poor performance of the existing unique-name generation

As described in Issue 16849, the existing Tools::getUniqueName method
requires calling code to form a vector of existing names to be avoided.

This leads to poor performance both in the O(n) cost of building such a
vector and also getUniqueName's O(n) algorithm for actually generating
the unique name (where 'n' is the number of pre-existing names).

This has  particularly noticeable cost in documents with large numbers
of DocumentObjects because generating both Names and Labels for each new
object incurs this cost. During an operation such as importing this
results in an O(n^2) time spent generating names.

The other major cost is in the saving of the temporary backup file,
which uses name generation for the "files" embedded in the Zip file.
Documents can easily need several such "files" for each object in the
document.

This is the first part of the correction, adding an efficient class for
managing sets of unique names.

New class UniqueNameManager keeps a list of existing names organized in
a manner that eases unique-name generation. This class essentially acts
as a set of names, with the ability to add and remove names and check if
a name is already there, with the added ability to take a prototype name
and generate a unique form for it which is not already in the set.

a new unit test for UniqueNameManager has been added as well.

There is a small regression, compared to the existing unique-name code,
insofar as passing a prototype name like "xyz1234" to the old code would
yield "xyz1235" whether or not "xyz1234" already existed, while the new
code will return the next name above the currently-highest name on the
"xyz" model, which could be "xyz" or "xyz1" or "xyz0042"..
2025-01-13 10:57:53 -06:00
Chris Hennes
9459b85081 Merge pull request #18704 from wwmayer/fix_line_dir
App: Add methods to get base and direction of datum element
2025-01-13 10:56:55 -06:00
wwmayer
f43339ad23 Fix issues in ellipse creation (#18800)
* Sketcher: Handle exceptions in onViewValueChanged

Because the method onViewValueChanged is used as a Qt slot it must handle all possibly raised exceptions as otherwise
they will slip through GUIApplication::notify() that usually results into a crash on some platforms like macOS

* Sketch: Handle undefined values in calculateThroughPointMinorAxisParameters

* The argument of acos() must be in the range [-1, +1], otherwise it returns nan (not a number)
* The value of sin(0) = 0. So, it cannot be used in the denominator of a fraction
2025-01-13 17:42:40 +01:00
PaddleStroke
f6e15f15ad Extend branding options (#18804) 2025-01-13 10:37:14 -06:00
Roy-043
326d1eb70b BIM: improve roof getSubVolume function
Fixes #19013.

* Check direction of plane axis with a tolerance.
* Check the produced solids. Notably check for a min. volume. Required for solids created from non-planar faces.
* Apply placement to created compound.
2025-01-13 10:07:13 +01:00
Roy-043
7829fcc488 Merge pull request #18988 from Roy-043/Draft-Bim-Layer-manager-transp-zero
Draft and BIM: Layer manager did not accept zero transparency
2025-01-10 23:40:27 +01:00
Roy-043
27ac5c4277 Draft and BIM: Layer manager did not accept zero transparency 2025-01-10 22:29:03 +01:00
Paul Lee
73f0e165be [ArchSpace] Improve Space Creation and ensureBase
Refer to discussion at -
https://github.com/FreeCAD/FreeCAD/issues/18917

Like Wall and Stairs, Space should do without Base. Base validity tested in execute() prevented the desired and documented behaviour.

EnsureBase() is remarked out in execute() and to be run in getShape(). With this improvement, if there is no Base, or Base is not valid, Space would be created if it could be defined by obj.Boundaries.
2025-01-10 10:44:48 +01:00
Gaël Écorchard
fe597c1933 BIM: Colors in DAE import + code improvements (#18965)
* BIM: Fix color support for DAE import

There was some mention of color in the original code but it was not
working on my system.

Signed-off-by: Gaël Écorchard <gael@km-robotics.cz>

* BIM: Use `BIM` rather than `Arch` for translation context

* BIM: remove Python 2 compatibility

* BIM: improve style of importDAE.py

Signed-off-by: Gaël Écorchard <gael@km-robotics.cz>

---------

Signed-off-by: Gaël Écorchard <gael@km-robotics.cz>
Co-authored-by: Gaël Écorchard <gael@km-robotics.cz>
2025-01-10 09:15:43 +01:00
Roy-043
558eb19103 Merge pull request #18949 from Roy-043/Draft-and-Pref-Packs-fix-snapcolor
Draft (and Pref Packs): fix snapcolor
2025-01-09 11:31:22 +01:00
Roy-043
09573f4ad4 Merge pull request #18959 from Roy-043/Core-fix-sWhatsThis-for-Std_LinkActions
Core: fix sWhatsThis for Std_LinkActions
2025-01-09 11:29:56 +01:00
Roy-043
89101ff4cc Merge pull request #18905 from Roy-043/Part-Rename-new-datum-commands
Part: Rename new datum commands
2025-01-09 11:27:14 +01:00
Roy-043
38ef33e272 Merge pull request #18942 from Roy-043/Draft-fix-selection-for-FacebinderTaskPanel
Draft: fix selection for FacebinderTaskPanel
2025-01-09 11:25:46 +01:00
Roy-043
3b258b6178 Draft: fix axis calculation in make_sketch
Fixes #18713.

The code follows the suggestion by imm/webmite:
https://forum.freecad.org/viewtopic.php?p=799014#p799014

@webmite Thank you.
2025-01-09 09:40:33 +01:00
Roy-043
bee46bca68 Core: fix sWhatsThis for Std_LinkActions 2025-01-08 22:25:25 +01:00
Roy-043
f6f11ac429 Draft (and Pref Packs): fix snapcolor
Fixes #17978.
2025-01-08 18:11:42 +01:00
Roy-043
89b95fc938 Draft: fix selection for FacebinderTaskPanel
See:
https://forum.freecad.org/viewtopic.php?t=93682
2025-01-08 14:36:07 +01:00
Yury Shvedov
c420316903 about: handle additional modules in clipboard
We are able to pass extra modules path with command line arguments.
Handle such modules when copying about information to clipboard.

Change-Id: I158b6ea021cc0a5dfd27693d22f6c56a6bdcd239
2025-01-07 15:40:23 +01:00
je-cook
278ce80390 BIM: Speedup and refactor WebGL exporting (#18843)
* Stylistic changes and slight refactor

* speed up compression algorithm
2025-01-07 10:43:50 +01:00
Yorik van Havre
b5e2e8c007 BIM: Added classifications support to nativeifc (#18444)
* BIM: Added classifications support to nativeifc

* BIM: Fixed lint warnings
2025-01-07 10:35:37 +01:00
Roy-043
6deb424539 Draft: Closed corners for extruded Facebinders (#18901)
* Draft: props_changed_placement_only should ignore material props

The new material related properties (Density, Volume and Mass) must be ignored by the `props_changed_placement_only` function.

Without this moving a Draft_Point will fail for example.

* Draft: Closed corners for extruded Facebinders

Fixes #13816.

The `makeOffsetShape` method that creates the extruded shape is quite picky. For example, it will work for a pyramidal shell (4 triangles) with a square floorplan, but not if the floorplan is slightly rectangular. To get closed corners the `Sew` property of the Facebinder must be set to `True`. If extruding does not work properly, the code will retry with `Sew` disabled.

There is also some code that tries to convert flat B-spline faces created between the main offset faces into planar faces. In some cases that code will fail (the results of `makeOffsetShape` can already contain errors). If that is the case the original shape created by `makeOffsetShape` is used.

* Rebase to restore base.py
2025-01-07 10:23:33 +01:00
JULIEN MASNADA
049f42c887 SH3DImporter: Fix walls Length attribute (#18854)
* Make IFC project optional

* make sure wall.Length is properly set

---------

Co-authored-by: Yorik van Havre <yorik@uncreated.net>
2025-01-07 10:03:02 +01:00
Roy-043
f34a8b5bfd Merge pull request #18899 from Roy-043/Draft-props_changed_placement_only-should-ignore-material-props
Draft: props_changed_placement_only should ignore material props
2025-01-06 20:33:41 +01:00
Roy-043
8c5a87e894 Part: Rename new datum commands
Fixes #18853.
2025-01-06 20:28:00 +01:00
lorenz
013eb6e635 pixi: update to py3.13 (#18832)
* pixi: update to py3.13

* pixi: Update gh-action to use pixi v0.39.4

* Pixi: add dep. xorg-xproto for linux

* update lock-file
2025-01-06 14:34:17 -03:00
Syres916
b86e1adb22 [Techdraw] Import SVG files with UTF-8 encoding (#18816)
* [Techdraw] Fix importing SVG files with UTF-8 encoding

* [Techdraw] fix Lint feedback
2025-01-06 18:32:56 +01:00
FEA-eng
5236541045 FEM: Add accuracy parameter for CalculiX buckling analysis (#18790)
* FEM: Update solver.py

* FEM: Update write_step_equation.py

* [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-01-06 18:24:56 +01:00
FEA-eng
73ce3b15d6 FEM: Update magnetodynamic_writer.py 2025-01-06 18:24:05 +01:00
Roy-043
af667d6fd8 Part: copy_visual_attributes did not handle Draft Link arrays
Fixes #16541.
Fixes #18760.
2025-01-06 18:16:46 +01:00
Benjamin Nauck
af1aa403e2 Spreadsheet: Center text (v+h) vertical headers 2025-01-06 18:15:30 +01:00
Yury Shvedov
f48ccba2d9 Macro: allow to specify extra system paths for macro
This introduce new option `-E [ --macro-path]` to specify extra system
paths of macros. The macro found in this paths will appear in `Macros`
dialog at `System macros` tab.

Change-Id: Ic21631ec0ebe8af5c7f42b4fe95400cfb67807d5
2025-01-06 18:14:15 +01:00
WandererFan
93aa3b312f [TD]Fix RichText parent in scene (fix #18283) (#18768)
* [TD]allow DrawViewAnno to be attached to another view

* [TD]allow image and spreadsheet attach to view

* [TD]ensure correct parent in scene

* [TD]refactor command helpers to separate file

- gathering the helpers in one place
- helper redundancy to be address in another change

* [TD]create symbol, spreadsheet, image with parent

* [TD]fix claimChildren for some views

- also includes many lint fixes
2025-01-06 18:11:25 +01:00
wmayer
b1d6a82178 Gui: Check for exising layout before accessing it
It still must be checked if the crash in #18747 will be fixed.
2025-01-06 18:09:46 +01:00
David Carter
3576640691 Materials: Physical properties reversion
Reverts PR #17438

The PR experienced sever performance issues when the file contained
objects with errors. This PR removes the physical properties attributes
and its associated calculations.

It retains changes to the material filter funtions which were not
affected by the errors.
2025-01-06 18:07:59 +01:00
mosfet80
d8794b3a14 Clean OpenSCAD2Dgeom.py 2025-01-06 18:04:07 +01:00
wmayer
d0eb91c4cc Part: Fix doc string of TopoShape.inTolerance 2025-01-06 18:03:10 +01:00
WandererFan
a3e49023d1 [TD]Symbol scaling (fix #14400) (#18757)
* [TD]add legacy/new svg scaling pref

* [TD]Change Svg scaling logic (fix 14400)
2025-01-06 18:02:37 +01:00
marioalexis
9e6f3660e5 Fem: Add suppressible extension to mesh element objects 2025-01-06 17:56:30 +01:00
marioalexis
3d830b5b2e Fem: Add suppressible extension to objects - fixes #12115 2025-01-06 17:56:30 +01:00
Yorik van Havre
6edd0daa1e BIM: Quantities support for nativeIFC objects (#18689)
* BIM: Quantities support for nativeIFC objects

* BIM: Added nativeIFC support for schedules
2025-01-06 11:55:50 -05:00
MisterMaker
6acd1fe3d0 Stylesheets spreadsheets visual fix. (#18719)
* this fixes the spreadsheet alignment and the corner button

* missed a line
2025-01-06 17:55:13 +01:00
wmayer
d979235a48 Gui: Remove code duplication in PythonConsole class 2025-01-06 17:53:59 +01:00
wmayer
0dba0a3b31 Gui: Hide line marker and do not highlight current line in Python console 2025-01-06 17:53:59 +01:00
wmayer
35700db40e Sketcher: Add an option to always add ext. geometry as reference 2025-01-06 17:48:00 +01:00
wmayer
7566200f0a Fix German translation
until the next download from crowdin
2025-01-06 17:25:44 +01:00
Roy-043
f773dfad91 Draft: props_changed_placement_only should ignore material props
The new material related properties (Density, Volume and Mass) must be ignored by the `props_changed_placement_only` function.

Without this moving a Draft_Point will fail for example.
2025-01-06 17:23:37 +01:00
Roy-043
b359a2c46c Draft: make_sketch.py: Use sketcher methods to add constraints (#18805)
* Draft: make_sketch.py: Use sketcher methods to add constraints

A sketch object has its own methods to add coincident, horizontal and vertical constraints. Using those methods allows to simplify the make_sketch.py code. The new code applies the mentioned constraints to the whole sketch,  instead of per object. The old code would not add coincident constraints between seperate, but connected, objects. the new code does.

Note that the code for point objects (not changed in this PR) does not work properly.

* Fix 2 issues

* The Sketcher detect functions need a tolerance argument.
* obj.Shape.copy() does not work properly for a Draft_Point. As a workaround a Part Vertex is created instead.
2025-01-06 14:56:53 +01:00