Commit Graph

26290 Commits

Author SHA1 Message Date
Roy-043
5f072c9fa4 Draft: Import DXF: handle arc angles larger than 360 degrees
See #10985.
2023-10-12 10:52:30 +02:00
Yorik van Havre
3359f6e152 Import: Support DXF text rotation (#11001)
* Import: Support DXF text rotation - fixes #10882

- Reads and supports text rotation in builtin DXF import
- Makes the builtin DXF import produce Draft texts instead of App::Annotations
- Extends the arguments of Draft make_text()

* [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>
2023-10-11 17:05:31 +02:00
wmayer
f0d350f60d TD: fix -Wsign-compare 2023-10-11 15:12:42 +02:00
wmayer
e9cbdd208c Import: fix -Wunused-private-field 2023-10-11 15:12:42 +02:00
wmayer
80d8bfd4b8 Material: remove several unreferenced variables 2023-10-11 12:04:26 +02:00
Roy-043
7222cf575f Draft: Use DXF OCS when importing circles and arcs to Part shapes
See #10985.
2023-10-11 10:08:58 +02:00
Zheng, Lei
1dd0a9afaa Gui/TechDraw: declare 'panning' capability in views
OverlayManager queries this capability to determin whether to auto hide
the overlay docking widgets
2023-10-11 09:58:53 +02:00
Roy-043
ddf2a3723b Arch: Fix multiple issues with ImportOBJ.py
Fixes #6187.

Other fixes:
* Made handling of shapes and global placement more consistent.
* Shapes without curves were also triangulated.
* Polygonal faces could have flipped normals and duplicate points.
2023-10-10 16:44:57 +02:00
marioalexis
eb73a9bce0 Fem: Remove callback added by filters task box and rework marker classes 2023-10-10 13:58:34 +02:00
Paddle
019bd50bbc Fix typo making Sketcher_Dimension fails for angles. 2023-10-10 13:48:07 +02:00
wmayer
4388246c01 Import: fixes #10983: Crash when trying to import a DXF file with Polish letters in the name 2023-10-10 12:58:47 +02:00
wmayer
d305f306df Core: Revert superfluous changes made with PR #9521 2023-10-09 15:06:45 +02:00
Roy-043
3e45d030cf Draft: Fix cursor scaling issue
Fixes #6793
2023-10-09 14:01:21 +02:00
Roy-043
1e4e58477e Arch: ArchFrame typos when checking enum values 2023-10-09 13:55:46 +02:00
wmayer
41ccf4f0c7 Start: fixes #10221: /tmp/FreeCADStartThumbnails* directories are not removed when FreeCAD terminates
The commit adds some new functions:

* getThumbnailDir()
  Returns the path to the thumbnail directory which is a sub-directory of the Cache directory.
  There is no need to always create a unique directory after each restart because it doesn't harm
  if the thumbnail directoy contains deprecated files.

* createThumbnailDir()
  Creates the thumbnail directoy if it doesn't exist yet.

* getSha1Hash
  Helper function to compute a SHA-1 hash of a given path. If the same path is passed
  then the hash value will be the same.
  This way it can be avoided to create a different image file from a project file
  after each restart.

* getUniquePNG
  Computes the path of a PNG image file for a given project file. It's also possible
  to pass an arbitrary string as argument.

* useCachedPNG
  If the PNG image exists and if it's newer than the project file True is returned
  and False otherwise.

The changes in detail are:
1. For a given project file it is checked if the thumbnail directory already contains
   a cached image. If it's newer than the project file it will used, otherwise it will
   be re-created.

2. For the system icon to a given file format it is only checked if the icon already exists.
   If yes, it will be used.
2023-10-09 13:54:11 +02:00
Roy-043
017d431720 Arch: Read and write object.Label on Wavefront OBJ import and export
Fixes #5635.
Fixes #5636.
2023-10-09 13:28:55 +02:00
Roy-043
3395b2e2f6 Draft: fix multiline offset for rotated SVG texts
Forum topic:
https://forum.freecad.org/viewtopic.php?p=711184#p711184
2023-10-09 13:27:54 +02:00
Abdullah Tahiri
ead8a9a5d1 Sketcher: Example new type checking template function usage
===========================================================

Just two small refactor examples of how to use the type checking template functions.
2023-10-07 23:12:46 +02:00
David Carter
b724c39c4d Material: Update Python tests to work with other locales
Update Python tests to work with other locales

This fixes issues #10917 and #10924

Numeric values were beign compared to strings that did not take into account localizations. The test was modified to work regardless of localization.

There is still a known issue when working with pt_BR.UTF8. The default encoder for this localization is not UTF8 resulting in an error working with a parameter that returned the UTF character for the Greek letter mu in its units.
2023-10-07 19:44:13 +02:00
marioalexis
32c34fd34a Fem: Remove markers from scenegraph - fixes #10438 2023-10-07 14:09:20 +02:00
Abdullah Tahiri
c7b99b9fbb Sketcher: Fix segfault when activating a tool in a different view
=================================================================

When in Sketcher edit mode, a tool button is activated, while the view has been changing to view of a different type, it segfaults.

This commit checks the pointer of the view to ensure correct type before activation, and refusing to activate if not of the correct type.

fixes #10809
2023-10-07 09:00:06 +02:00
Paddle
2ea27064d5 Create makeAngleBetweenTwoLines and Create Create calculateAngle to remove duplicates 2023-10-07 07:43:39 +02:00
wandererfan
16dd8fc239 [TD]fix fail on unmeshed shape 2023-10-06 20:39:38 -04:00
sliptonic
747c2b86f8 Merge pull request #9521 from AgCaliva/User/Document/Feature_level_units_selection_#7746
Adding "ProjectUnitSystem" support to project files.
2023-10-06 07:56:59 -05:00
sliptonic
06809beb60 Merge pull request #10935 from marioalexis84/Fem-force
Fem: Force constraint overhaul
2023-10-05 12:12:06 -05:00
wmayer
a7a9923e04 Part: add unit tests for empty face 2023-10-05 08:15:33 +02:00
wmayer
607add75d9 Part: add unit tests for empty edge 2023-10-05 08:15:33 +02:00
Florian Foinant-Willig
a922be727f Part: fix crash with null face 2023-10-05 08:14:50 +02:00
Florian Foinant-Willig
bd2898725a Part: fix #10868 crash with null edge 2023-10-05 08:14:50 +02:00
wandererfan
06460ef171 [TD]upgrade WeldSymbol icone 2023-10-04 20:27:46 -04:00
marioalexis
6f0986757f Fem: Set default force to 1 N in FEM_ConstraintForce command 2023-10-04 17:09:53 -03:00
Uwe
edf3367346 Fem: Update force values in test .inp files 2023-10-04 17:06:47 -03:00
Uwe
a4bf3ef80a Fem: Fix force values in examples 2023-10-04 17:03:28 -03:00
Uwe
af684644ab Fem: Change ConstraintPressure::Force property to App::PropertyForce 2023-10-04 17:03:28 -03:00
sliptonic
bb97f4e4f3 Merge pull request #10923 from marioalexis84/FEM-pressure
FEM: pressure constraint overhaul
2023-10-04 14:30:05 -05:00
AgCaliva
3ac69993c0 merge master via cli 2023-10-04 13:28:48 -03:00
AgCaliva
f431a02534 solving new error related to cmake 2023-10-04 13:18:20 -03:00
Roy-043
02a088466c Draft: Update the Plane class (step 2)
Related issue:
#5603.

Previous PRs:
#10766
#10838

The remaining Plane class functions have been processed (some are unchanged):

`setup`
* Updated to use new functions.
* The `direction` etc. arguments are never used AFAICT.
* Added `from draftutils import gui_utils`.

`reset`
* Unchanged.

`setTop`
* Calls `super().set_to_top()`. That function does not use `align_to_point_and_axis` but specifies exact vectors for improved accuracy.
* `import FreeCADGui` already happens at the top of the file.
* The code block after `if FreeCAD.GuiUp:` was kept for now.

`setFront`
* Idem.

`setSide`
* This function sets the WP to the left side position, and not to the right side postion as in the Draft_SelectPlane command.
* Idem.

`getRotation`
* Revised.
* The function has an akward name as it returns a Placement.
* The special code for Arch active container is obsolete (was already commented out in other functions).

`getPlacement`
* The `rotated argument` is ignored now. It was only used in the context of the old `placement_from_face` algorithm. See `DraftGeomUtils.placement_from_face` for the new implementation.
* Calls `super().get_placement()`.

`getNormal`
* Basically unchanged.

`setFromPlacement`
* Revised to call `super()` functions.

`inverse`
* Unchanged.

`save`
* Unchanged.

`restore`
* More compact code, but basically unchanged.

`getLocalCoords`
* Calls `super().get_local_coords()` which does not rely on Draft code, but creates a matrix and returns `mtx.inverse().multVec(point)`.

`getGlobalCoords`
* Calls `super().get_global_coords()` which creates a matrix and returns `mtx.multVec(point)`.

`getLocalRot`
* Calls `super().get_local_coords()`.

`getGlobalRot`
* Calls `super().get_global_coords()`.

`getClosestAxis`
* Calls `super().get_closest_axis(vec)` which translates the vector to the WP coordinate system and then finds the closest axis by comparing the absolute coordinates of the vector.

`isGlobal`
* Not used anywhere AFAICT.
* Calls `super().is_global()` which also checks the `position` attribute.
* As before the function works without any tolerance.

`isOrtho`
* Not used anywhere AFAICT.
* The original algorithm did not work properly (there was a comment). All angles were measured relative to the global Y axis. If the WP was randomly rotated around that axis the function would still return `True`. The new algorithm, `super().is_ortho()`, uses rounded Yaw, Pitch and Roll angles to check for orthogonality.

`getDeviation`
* Not used anywhere AFAICT.
* Unchanged.

`getParameters`
* Calls `super().get_parameters()` which uses the local `_get_prop_list` function.

`setFromParameters`
* Calls `super().set_parameters()` which uses the local `_get_prop_list` function.

`_get_prop_list`
* Function used internally. Returns a list of attribute.
2023-10-04 14:40:33 +02:00
Roy-043
44e01fac12 Draft: importSVG: handle viewBox in mm
Forum topic:
https://forum.freecad.org/viewtopic.php?t=81696
2023-10-04 11:03:36 +02:00
marioalexis
ef0865ebaa Fem: Use lower camel case in TaskFemConstraintPressure methods 2023-10-03 17:45:51 -03:00
Uwe
e932134c1f Fem: Update pressure values in test .inp files 2023-10-03 17:45:46 -03:00
Uwe
be34b52d30 Fem: Fix pressure values in examples 2023-10-03 17:45:17 -03:00
Uwe
d115018b94 Fem: Change ConstraintPressure::Pressure property to App::PropertyPressure 2023-10-03 17:44:31 -03:00
wandererfan
5b65757404 [TD]fix sketch location in view 2023-10-03 13:35:36 -04:00
wmayer
c4f355ad8d Part: move CmdSelectFilter and friends from core to Part module 2023-10-03 19:26:28 +02:00
wmayer
3c8f245e67 Part: handle Part_SectionCut in WorkbenchManipulator 2023-10-03 19:26:28 +02:00
wmayer
09148fa617 Part: handle Part_SectionCut in WorkbenchManipulator 2023-10-03 19:26:28 +02:00
wmayer
6e12bbf79a Part: add WorkbenchManipulator to Part module 2023-10-03 19:26:28 +02:00
wmayer
dc771fca63 Import: Extend OCAF browser 2023-10-03 15:55:22 +02:00
wmayer
b2be356609 Import: Support of colors of the glTF format 2023-10-03 15:42:30 +02:00