Commit Graph

24473 Commits

Author SHA1 Message Date
Chris Hennes
ffcd0f5c65 [Draft] Enable Transform context menu item
The "Transform" and "Set Colors..." context menu items did not work on
most Draft objects because the View Provider has a setEdit() function,
which overrides any edit action provided at a higher level (e.g. by
Part). This commit checks the mode of the edit, and if it is not zero,
behaves as though the setEdit() function does not exist, allowing Part
to provide the required context menu behavior.
2021-03-23 09:12:56 -05:00
sliptonic
7d118f31b7 Merge pull request #4615 from Russ4262/fix_pocketshape_combine_shapes
[Path] Fix connected multi-face clearing bug
2021-03-22 13:53:55 -05:00
wmayer
1ac35d2b42 Import: [skip ci] handle utf-8 filepath when writing to dxf 2021-03-22 17:13:56 +01:00
wmayer
b4b1cbedb1 PD: fix several issues in pad:
* pass boolean instead of int to setValue of PropertyBool
* support of symmetric option for two-length mode
* fix bug in TaskPadParameters::updateUI()
* remove strange acronyms from method names
2021-03-22 16:40:15 +01:00
donovaly
cf11f38875 [PD] add along length option for pad
- as discussed here: https://forum.freecadweb.org/viewtopic.php?f=17&t=50466&start=10#p433327
this PR is the first step for new Pad features.
It implements 3 features requested by users:
1. an option to measure the pad length along its direction if there is a custom direction
2. when there are two lengths, the reverse feature should be active
3. the pad dialog shows now always the used pad direction, no matter if it is a custom one or the sketch's normal

- Furthermore there are some code improvements (avoid rounding and blocking signals)

- Also adapt TestPad.py because its test used the case two lengths + reversed but this was not possible before this PR - the reverse option was not take into account for two lengths in FeatureSketchBased.cpp)
Now it is and therefore the test must be updated:
In the test the second sketch has the normal vector 0, -1, 0. As the reverse option is set the pad direction is 0, 1, 0. So in y direction is the length (1mm) and in -y direction is length2 (2mm). This gives together with the other pad of volume 1, a total volume of 4.

- fix UI issue: either reversed or midplane
As noticed by @chennes, when the pad uses symmetric, reversed is not sensible and vice versa.
This commit fixes the missing Gui side for the case midplane is checked and the App side.

- the PR also fix two typos
2021-03-22 16:36:04 +01:00
donovaly
5e90c07375 [FEM] add material cards for gases
also add electrical conductivity for air and water
2021-03-22 10:15:20 +01:00
donovaly
804830d772 [FEM] fix specific heat of air
- also adjust values slightly according to various sources

Since a factor 1000 is a big mistake and air is the most common gas, please commit this also for FC 0.19
2021-03-22 10:11:13 +01:00
Bernd Hahnebach
011cef1e7b FEM: material task panel, fix unuseable Gui if material editor was canceled and material accepted 2021-03-21 23:18:44 +01:00
Abdullah Tahiri
28e40ffbee Sketcher:: Trim creator UI
==========================

* Enable to select any GeomTrimmedCurve (any arc supported by the Sketcher), as well as B-Splines.
* Use Edit Markers to provide visualisation of the cutting position and cut segment end point before trimming.
* Reject trimming Internal aligned geometry (internals of complex geometries such as ellipses or hyperbolas)
2021-03-21 06:56:23 +01:00
Abdullah Tahiri
2d817128d0 Sketcher: SketchObject - Trim refactor
======================================

* Refactor the code for all GeomTrimmedCurve and non-periodic BSplines in a single block, adding
support for arcs of hyperbola, parabola and B-Splines.

* Refactor the code for periodic curves (circle, ellipse) in a single block, adding support for
periodic B-Splines.

* Add support for trimming limited by external geometry

* Trim deletes a geometry if intersections are detected and nothing would be left after trimming

* Trim deletes a geometry if no intersection are detected

Bonus:
* Function addConstraint moving the constraint instead of cloning it again
* SketchObject::seekTrimPoints as a wrapper of Part2DObject::seekTrimPoints providing
a correct handling of GeoId indices.
* Helper functions addConstraint/createconstraint to create new constraints and move them
into the Constraint property
* New getGeometry with templated return type defaulting to Part::Geometry.
2021-03-21 06:56:23 +01:00
Abdullah Tahiri
2afcbff0d6 Part: Geometry - Add function to trim a B-Spline
================================================

Supports both non-periodic and periodic case
2021-03-21 06:56:23 +01:00
Abdullah Tahiri
8be50486af Sketcher: reset Marker Edit layer when exiting DrawSketchHandler 2021-03-21 06:56:23 +01:00
Abdullah Tahiri
010a2cbd41 Sketcher: ViewProvider - add marker information layer
=====================================================

New Coin Marker layer intended to temporarely highlight sections of the 3D View for information purposes.
Independent from the actual redrawing of the geometry and constraints.
2021-03-21 06:56:23 +01:00
Abdullah Tahiri
595fc118e3 Part: Part2DObject::seekTrimPoints rename parameters
====================================================

This function takes parameters named GeoId, which evoke the Sketcher GeoId and which
indeed are used by the sketcher. However, these indices are just indices of the provided
geometry list. Therefore:
1. The are never negative (no matter if a corresponding Sketcher GeoId is external or not).
2. They do not have reserved indices for axes.
3. Most importantly, not found GeoId1 and GeoId2 are coded as -1, which for the Sketcher has
a well defined meaning (axis), whereas the Sketcher uses Constraint::GeoUndef as undefined or
not present/ not found index, which currently is -2000.

For these reasons, it was judged appropriate to rename the parameters and documentation to
emphasise that this function is unrelated and dettached from any Sketcher knowledge, and that
indices are just normal indices of a vector.
2021-03-21 06:56:23 +01:00
wmayer
f4e3e8abd6 Mesh: [skip ci] refactor Mesh open/import functions 2021-03-20 21:54:30 +01:00
wmayer
182952a881 Mesh: [skip ci] do not make lower case read lines of OBJ file as otherwise it may fail to load the MTL file 2021-03-20 19:19:30 +01:00
Abdullah Tahiri
3a656d8597 Sketcher: UI Constraint Creation - PointOnObject + Tangency on edge constraint substitution
============================================================================================

On creation of a constraint from the UI (toolbar/menu):

1. if a PointOnObject constraint preexisted the addition of an
edge-to-edge tangency, substitute it with a point-to-edge tangency.

2. if an edge-to-edge tangency preexisted, addition of a PointOnObject
results in a substitution of the edge-to-edge tangency with an edge-to-curve
tangency.

Bonus:
- Refactor of this with preexisting coincident+tangent substitution.
- Activate both substitutions in continuous constraint addition mode.
2021-03-20 18:12:54 +01:00
wmayer
477e0d3982 Gui: [skip ci] avoid using const reference as member for several action classes to avoid memory corruption 2021-03-20 16:13:56 +01:00
Abdullah Tahiri
c08a19626f Sketcher: Use old NotifyConstraintSubstitution parameter in DlgCheackableMessageBox 2021-03-20 15:59:15 +01:00
Abdullah Tahiri
4bf6b19849 Gui: Extend DlgCheckableMessageBox to use specific preference path and parameter 2021-03-20 15:59:15 +01:00
David Osterberg
d759a8e43d Sketcher: Change constraint-conversion MessageBox to DlgCheckableMessageBox 2021-03-20 15:59:15 +01:00
wmayer
9c8685c20c Import: [skip ci] avoid conflicting class names in global namespace 2021-03-19 15:18:25 +01:00
turn211
b1ac7701e6 [Stylesheet] ProDark: major bugfix for add-ons
https://forum.freecadweb.org/viewtopic.php?f=34&t=55134&start=100
2021-03-19 06:31:27 -04:00
wmayer
371b089ea0 OpenSCAD: fix test_import_surface by changing currently working directory 2021-03-17 12:35:15 +01:00
Bernd Hahnebach
cf241d0c93 FEM: examples, elmer eigenvalues, add calculix solver for frequencies 2021-03-17 12:25:09 +01:00
wmayer
9a105e3405 OpenSCAD: fix utility_create_scad by changing currently working directory so that test_import_surface doesn't fail any more 2021-03-17 11:59:14 +01:00
wmayer
0581409fbe OpenSCAD: [skip ci] fix incorrect filename creation in unit tests 2021-03-17 11:56:58 +01:00
UR-0
0f12d6e9ec [FEM] improve get_gmsh_version 2021-03-17 11:28:23 +01:00
Bernd Hahnebach
5bf22ad4ac FEM: examples, elmer tut1, eigenvalues, fix some problems 2021-03-17 10:45:37 +01:00
Bernd Hahnebach
71141d0964 FEM: fix unit test because of denisty writing. See 3e1b16b198. This reverts 8ec3766b00 2021-03-17 09:33:21 +01:00
Bernd Hahnebach
3e1b16b198 FEM: elmer writer, only write denisty if really needed, partitially revert 2d73444a66, unit test fix in separate commit 2021-03-17 09:26:48 +01:00
wmayer
4561deb4fa Part: [skip ci] implement makeShellFromWires 2021-03-16 16:01:43 +01:00
Bernd Hahnebach
bfdeaf6af3 Update task_material_common.py 2021-03-16 11:55:19 +01:00
Bernd Hahnebach
b9f4576dba FEM: material task panel, small code improvements 2021-03-16 11:22:27 +01:00
Yorik van Havre
4bf8fd2e07 Merge pull request #4621 from marioalexis84/draft-gui_snaps
Draft: Fix regression in sync_snap_toolbar_button function
2021-03-15 14:06:05 +01:00
marioalexis
bc60c93266 Draft: Fix regression in sync_snap_toolbar_button function 2021-03-14 17:14:58 -03:00
Chrismettal
1233555826 [Stylesheet] increase behave-dark contrast on input boxes (#4619)
PR #4619
2021-03-14 14:38:12 -04:00
UR-0
381ce4a830 [FEM] get Gmsh version 2021-03-14 17:22:09 +01:00
Bernd Hahnebach
8ec3766b00 FEM: unit tests, fix denisty writing in existing unit tests 2021-03-13 22:38:56 +01:00
Bernd Hahnebach
69aacc2fc5 FEM: pep8 2021-03-13 21:47:50 +01:00
Bernd Hahnebach
a8c1624b94 FEM: elmer writer, add comment 2021-03-13 21:47:40 +01:00
UR-0
f11945d1c7 getPropertyOfGeometry() used to get BoundBox 2021-03-13 21:23:23 +01:00
UR-0
abf4fee6a4 upgrade getBoundBoxOfAllDocumentShapes to handle more objects 2021-03-13 21:23:23 +01:00
UR-0
65b9f8b43d [FEM]implement Gmsh mesh property "MeshSizeFromCurvature" 2021-03-13 21:13:30 +01:00
Bernd Hahnebach
9f2d1d76c8 FEM: examples, add elmer nongui tutorial 1, eigenvalue of a beam 2021-03-13 20:59:09 +01:00
Bernd Hahnebach
2d73444a66 FEM: elmer writer, do write density in any case 2021-03-13 20:58:56 +01:00
sliptonic
4092c97bac Merge pull request #4573 from Russ4262/fix_pocketshape_warning_msg
[Path] PocketShape: Remove 'verify final depth' warning
2021-03-13 11:54:05 -06:00
Russell Johnson
bd6c8324ab Path: Fix connected multi-face clearing bug
Identified by MLampert.  If multiple faces are selected at varying Z-heights, the `combineConnectedShapes()` method fails to connect them due to offset Z-heights.  This fix places all input faces for that method into the same working plane.
2021-03-13 11:34:35 -06:00
sliptonic
e6801d9c58 Merge pull request #4613 from sliptonic/bug/outputsplit
[PATH] Fix bug with spindle not restarting
2021-03-13 09:46:39 -06:00
Chris Hennes
6bf27e0ae1 [OpenSCAD] Reimplement surface() to match OpenSCAD
The original implementation of the surface() function used a simple
B-spline representation for the surface, which generated degenerate
surface with several of OpenSCAD's demo input files. This commit
modifies the algorithm to generate a discrete surface identical to the
one generated within OpenSCAD itself. It also adds several units tests
to identify future regressions.

Note that PNG input is not yet supported for the surface() function.
2021-03-13 16:11:16 +01:00