Commit Graph

27813 Commits

Author SHA1 Message Date
wmayer
12ef38e66f Fix handling of transparency / Restore colour per face
The Materials module does a conversion from float to double when saving the transparency and again a conversion from double to float to double
when restoring it. This causes a considerable loss of accuracy so that the representation in percent leads to different numbers.

Using consistently some helper functions to do a proper conversion from float to long and back fixes the problem.

The new property ShapeAppearance is a PropertyMaterialList and always read after the DiffuseColor property when restoring a document.
Thus, the  method onChanged() doesn't override DiffuseColor when restoring a document. Additionally, the method finishRestoring() is re-implemented
to set the colours per face in case DiffuseColor has defined multiple colors.
2024-04-10 13:32:58 +02:00
wmayer
e87180b245 Part: fix import of STEP files with colors per face 2024-04-09 22:15:51 +02:00
wmayer
9d4757b301 Part: fix some further regressions:
* Correctly load a file if colors are set per face
* Result of boolean operation is correctly colored if source objects have different colors
* Result of compound is correctly colored if source objects have different colors
2024-04-09 22:15:51 +02:00
wmayer
5d451b1486 PD: fix shape appearance of datum features, shape binder and sub-shape binder 2024-04-09 22:15:51 +02:00
wmayer
15dcd1e9be Gui: add security checks to view provider extensions because they can be accessed if a document objects is not yet attached 2024-04-09 22:15:51 +02:00
wmayer
262a218b6b Part: fix Part_RefineShape and Part_Section 2024-04-09 22:15:51 +02:00
wmayer
4aa140d066 Mod: code cleanup 2024-04-09 22:15:51 +02:00
wmayer
2d1153d72e Mod: Adjust parent class for Python wrappers 2024-04-09 22:15:51 +02:00
wmayer
92b1e77744 Gui: fix ViewProviderGeometryObject
* fix several linter warnings
* remove code that cannot be executed: inside the constructor it cannot ever happen that getObject()
  returns a valid object
* in ViewProviderGeometryObject::handleChangedPropertyName call the method of the direct base class
  as otherwise this may break the mechanism in the future
* Shape is a property of an extension module -> move its handling to ViewProviderPartExt
2024-04-09 22:15:51 +02:00
wmayer
f84224bb43 Mod: Show regressions in shape colouring
This PR demonstrates the known regressions of the recently merged material branch:
* Changing the transparency after setting color per face will reset them
* The result of boolean operations or compound doesn't inherit the colour of its input objects
* If colour is set per face to a boolean operaton object then saving and restoring the file causes weird rendering behaviour
  because material binding is set to PER_PART but only a single colour is defined
* If a shape inside a part container has set colour per face then saving and restoring as STEP file causes weird rendering
behaviour for the same reason
* Shape binder or datum objects don't show the correct default shape colour
2024-04-09 22:13:42 +02:00
marioalexis84
2c593b67b4 Fem: Fix display modes order - fixes #13326 (#13358) 2024-04-08 18:15:12 +02:00
FEA-eng
b4c37e4d97 Add uncoupled temp-disp and heat transfer CalculiX FEM analysis types (#13296)
* FEM: Update solver.py

* FEM: Update write_step_equation.py

* FEM: fix temperature only analysis

---------

Co-authored-by: lyphrowny <strukov.as@edu.spbstu.ru>
2024-04-08 18:08:16 +02:00
lyphrowny
725d70ff55 FEM: add tests directory for function tests; add tests for parse_diff 2024-04-08 18:06:17 +02:00
lyphrowny
4e54d436fc FEM: add floating point comparison for tests 2024-04-08 18:06:17 +02:00
Yorik van Havre
3f0bd5501e Arch: Upgraded reference tool
* Fixed translations
* Reference objects can now use whole file contents instead of having to choose a part
* Support for DXF files
* Support for IFC files (if NativeIFC is available)
* General code cleanup
2024-04-08 18:04:37 +02:00
paullee
f87782d860 [ArchWall] Fix regression make block from DraftWire
See FC Forum Discussion
- https://forum.freecad.org/viewtopic.php?t=86365
2024-04-08 12:03:40 -04:00
lyphrowny
d2e355c836 FEM: migrate calculix tests to ccxtools tests 2024-04-08 18:02:33 +02:00
wmayer
1d2bd837c1 Sketch: add command to context-menu to change value of constraint
The edit datum dialog is opened by double-clicking on a dimensional constraint in a sketch. However, the double-clicking event doesn't work realiably on
some systems. As a workaround this PR adds the command to the context-menu.

For more details see the forum thread: https://forum.freecad.org/viewtopic.php?t=71137
2024-04-08 18:01:44 +02:00
Jiří Mácha
69898555c6 Assembly: fix segfault when Part property of Joint Connector is missing
FreeCAD is crashing during 'Solve Assembly' call if the Part property
(Assembly/Joints/Fixed/Joint Connector 1/Part1 or Assembly/Joints/Fixed/Joint
Connector 2/Part2) of fixed Joint is unset.

Steps to reproduce:

 - make simple Assembly e.g. of two cubes with Fixed joint
 - Select Fixed joint in the tree and go-to property 'Data' tab
 - Select Part1 or Part2 of 'Joint Connector 1' or 'Joint Connector 2'
   and remove this reference
 - call 'Solve Assembly' now

The FreeCAD will crash here because the call
App::DocumentObject* part = getLinkObjFromProp(joint, propPartName);
will return NULL pointer.

The property Part1 or Part2 can get empty (unset) during usual
construction operations - during changing construction history
and it can be very hard to find the cause of FreeCAD crash on a big
model.

This patch tries to fix the crash in such situation.
2024-04-08 18:00:40 +02:00
Max Wilfinger
7c9546fdb1 Update Sketcher context menu.
Refine poposed constraints on point selection.
Add symmetry constraint to context menu.
Rearrange commands to be consistent with the toolbar.
2024-04-08 17:58:28 +02:00
PaddleStroke
494e91948f Sketcher: Rectangle DSH Fixes #12297 2024-04-08 17:52:18 +02:00
PaddleStroke
4e6966bbd6 Sketcher: Make coincident points the same color as constraints. 2024-04-08 17:49:46 +02:00
PaddleStroke
c6bf546b7a Sketcher: Points color reflect their construction state. Remove Vertex color. 2024-04-08 17:49:46 +02:00
PaddleStroke
8c1b69e3c6 Sketcher: Point DSH: take construction mode into account. 2024-04-08 17:49:46 +02:00
Florian Foinant-Willig
d46f424a6a FEM: allow to Suppress the constraints (#12359)
* FEM: Introduce suppressible constraints

* fix public inheritance
2024-04-08 10:43:54 -05:00
wandererfan
ebdc3c255d [TD]fix templated autofill for sheet 2024-04-07 14:32:02 -04:00
wandererfan
701fcc3624 [TD]create BrokenView from base view 2024-04-06 15:25:23 -04:00
wandererfan
7b71b5d9b5 [TD]add guards for null shape 2024-04-06 15:25:23 -04:00
wandererfan
cdb4075340 [TD]adjust breakline position 2024-04-06 15:25:23 -04:00
wandererfan
43fc04309a [TD]implement BrokenView 2024-04-06 15:25:23 -04:00
Chris Hennes
efa3a7e6ef Merge pull request #13304 from chennes/updateBlack
Precommit: Update black
2024-04-05 08:51:58 -05:00
wmayer
dfc74591cc Material: add workbench manipulator
Implement a workbench manipulator to inject Std_Material and Std_Appearance to (context) menu.
2024-04-05 10:08:06 +02:00
wmayer
384902c26c Gui: Fix broken toolbars layout due to MaterialWorkbench
The explicit activation of the MaterialWorkbench breaks the toolbars layout for every start. When fixing it manually it will be broken
again after the next start.

Because the core doesn't depend on the Material module it's a no-go to add an explicit runtime dependency to the corresponding workbench.

Since the Part module depends on the Materials module and the PartGui on MatGui the correct way is to let Part an PartGui load their
dependencies.
2024-04-05 10:08:06 +02:00
wmayer
f254baa65f Material: fixes several issues
* fix warning -Wunused-variable
* fix warning -Wreorder-ctor
* fix warning -Wunused-but-set-variable
* fix uic warning for DlgDisplayProperties.ui
* rename the target MateriaTestLib ALL (note the typo and the already existing MaterialTestLib ALL) to MaterialTest ALL
  drop the hard dependency to the Part module: The document is checked for a property ShapeMaterial of type Materials::PropertyMaterial.
  An alternative could be to cast to GeoFeature and use the methods getMaterialAppearance() and setMaterialAppearance()
2024-04-05 10:08:06 +02:00
FEA-eng
8440586550 MATERIAL: Update cardutils.py 2024-04-04 23:29:12 -05:00
Chris Hennes
0f6ef9571f Precommit: formatting fixes after Black update 2024-04-04 23:24:37 -05:00
PaddleStroke
27b72398b1 Sketcher: Translate Fixes #13189 horizontal/vertical lost. 2024-04-04 22:46:00 -05:00
David Carter
ba20441935 Material: Material appearance
Uses new material system for appearance

Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.

The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.

A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.
2024-04-04 07:39:58 -05:00
bgbsww
37c38acd19 Add an initial test to show TNP (#13233)
* Add an initial test to show TNP

* Add documentation, make review tweaks

* Quiet Lint
2024-04-03 16:53:58 -05:00
FEA-eng
c3f3e47d59 TECHDRAW: Update DimensionValidators.h 2024-04-03 22:42:59 +02:00
FEA-eng
523ad14309 TECHDRAW: Update DimensionValidators.cpp 2024-04-03 22:42:59 +02:00
FEA-eng
437c125bab ARCH: Update importIFCHelper.py 2024-04-03 18:48:45 +02:00
FEA-eng
d459a9cb40 FEM: Update constraint_contact_solid_solid.py 2024-04-03 18:48:45 +02:00
FEA-eng
5d394ba2e8 FEM: Update exportNastranMesh.py 2024-04-03 18:48:45 +02:00
FEA-eng
7cdfb95a6b FEM: Update ccxtools.py 2024-04-03 18:48:45 +02:00
FEA-eng
09e9bc4168 FEM: Update ccx_cantilever_beam_rect.py 2024-04-03 18:48:45 +02:00
FEA-eng
f28bab977b SPREADSHEET: Update importXLSX.py 2024-04-03 18:47:23 +02:00
wmayer
64e7ae60e8 RE: Add function to approximate B-Spline from points 2024-04-03 18:06:00 +02:00
wmayer
7a7c0081c3 Part: Add overloaded methods of GeomBSplineCurve::approximate 2024-04-03 18:06:00 +02:00
wandererfan
e64af14325 [TD]fix fail on corrupt dimension reference 2024-04-03 08:48:39 -04:00