Commit Graph

1923 Commits

Author SHA1 Message Date
bitacovir
b6e81c1821 [UI] Replace Bitmap icon of Part_PointsFromMesh command 2021-03-25 17:42:26 +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
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
4561deb4fa Part: [skip ci] implement makeShellFromWires 2021-03-16 16:01:43 +01:00
tomate44
839b96385c Part: fixes and check input values for spiral and helix primitives 2021-03-10 14:24:01 +01:00
tomate44
97543396c5 Part primitives: add SegmentLength property to helix and spiral 2021-03-10 14:23:16 +01:00
tomate44
6f9856bd46 Part primitives: use makeSpiralHelix in spiral and helix primitives 2021-03-10 14:22:04 +01:00
tomate44
18f36c10da TopoShape: add a common function to build spirals and helixes 2021-03-10 14:18:12 +01:00
Benjamin Nauck
f6c9cc90ee [Base] Remove includes to StdStlTools.h as that's not needed anymore
std::make_unique was introduced in c++14, so no need to use the back
ported version
2021-03-06 21:20:32 +01:00
Benjamin Nauck
afb1d0fbc9 [Path] Switch from boost::tuple to std::tuple
It's better to use the standard lib when possible
2021-03-06 19:31:06 +01:00
wmayer
f85478155b Revert "[PartDesign] Add Material property to Body"
This reverts commit 4fcf8f199c.

There is no need to make this a static property because it can be added at runtime via Python or the GUI
2021-03-04 18:50:57 +01:00
howetuft
4fcf8f199c [PartDesign] Add Material property to Body 2021-03-04 12:19:50 +01:00
wmayer
89b094683f Gui: support to customize the font size of bounding boxes 2021-03-02 16:29:57 +01:00
David Osterberg
43bc30da84 Beautify xml step 1: These changes do not affect the uic output 2021-03-02 16:29:11 +01:00
Chris Hennes
a432480e8d [Part] Fix signature of TempoVis dummy function
If the import of TempoVis fails, TaskAttachmentEditor creates s dummy
function to replace the real TempoVis function. That function's
signature did not match the real TempoVis. Caught by LGTM.
2021-02-27 18:21:05 +01:00
Yorik van Havre
958009c2ca Merged crowdin translations 2021-02-25 13:27:48 +01:00
Yorik van Havre
5ba28fa7ff Merged crowdin translations 2021-02-24 18:07:59 +01:00
wmayer
1d412261d6 Part: [skip ci] Fix coverity warning
Coverity warnings fixed:

CID 316522 (#2 of 2): Uninitialized scalar variable (UNINIT)
5. uninit_use_in_call: Using uninitialized value newSelection. Field newSelection.shapeType is uninitialized when calling push_back
2021-02-21 16:06:59 +01:00
wmayer
d4333072a9 Part: [skip ci] add missing expression bindings to tube dialog 2021-02-21 15:20:12 +01:00
luz paz
110860fa47 Part: Part.CompoundTools.Explode.explodeCompound access a property of...
...a sometimes null object with an error

Python code, file `src/Mod/Part/CompoundTools/Explode.py`
The `explodeCompound` function can be called in a context without assigning the `ViewObject` property, for example from a command line script.

The error that is fixed by this patch. 
```
Traceback (most recent call last):
  ...
  File "/opt/freecad/Mod/Part/CompoundTools/Explode.py", line 23, in explodeCompound
    cf.ViewObject.DontUnhideOnDelete = True
AttributeError: 'NoneType' object has no attribute 'DontUnhideOnDelete']
```

Patch submitted by marioamb.  
Fix #004421  
https://tracker.freecadweb.org/view.php?id=4421
2021-02-21 11:40:20 +01:00
donovaly
9fb381b716 [Part] fix regression in location dialog layout
For some reason the horizontal alignment got broken. This PR replaces the different grids with each on grid per groupbox
2021-02-21 11:36:13 +01:00
wmayer
7405dd0ef9 PD: [skip ci] fixes #0004573: missing bindings to expressions in primitives location dialog 2021-02-20 20:04:37 +01:00
donovaly
dd4874d2b6 [Part] add missing bindings
For FC 0.19 we added bindings to the PD primitives but we forgot the Part primitives
2021-02-20 20:02:09 +01:00
Abdullah Tahiri
324f6d3e26 Part: Geometry - BSpline - fix weight assignment
================================================

If during assignment of weights (during the for loop iteratively setting the poles) all weights
become (temporarily) equal even though weights does not have equal values
OCCT will convert all the weights (the already assigned and those not yet assigned)
to 1.0 (nonrational b-splines have 1.0 weights). This may lead to the assignment of wrong
of weight values.

The work-around is to temporarily set the last weight to be assigned to a value different from
the current value and the to-be-assigned value for the weight at position last-to-be-assign but one.

Fixes:
https://forum.freecadweb.org/viewtopic.php?p=478701#p478702
2021-02-18 17:28:38 +01:00
David Osterberg
dac937ae35 Part: Allow helix primitive with negative Angle 2021-02-14 11:53:34 +01:00
Yorik van Havre
84b8282f48 Updated ts files 2021-02-12 14:47:37 +01:00
wmayer
d7ad20acdd Part: [skip ci] code-refactoring in DlgPrimitives class 2021-02-12 12:41:45 +01:00
Chris Hennes
3ef6e1c6d0 [OTHER] Catch only Exception, not BaseException 2021-02-11 11:52:45 +01:00
Chris Hennes
46a899c437 [Part] Coverity: dtors can't throw 2021-02-09 23:58:09 +01:00
Yorik van Havre
bcb5c8786f merged crowdin translations 2021-02-09 16:12:18 +01:00
Chris Hennes
15d4cac123 LGTM: Remove superfluous conditional 2021-02-08 16:39:40 +01:00
Zheng, Lei
ea2e46dccb Part: allow TaskAttachmentEditor to install attacher extension on demand 2021-02-07 15:39:12 +01:00
wmayer
99c686f061 Part: [skip ci] fix -Wreorder 2021-02-05 17:26:47 +01:00
donovaly
603cbdbfd5 [Part] make pointers to the UI std::unique_ptr
Same as PR #4293, just for Part

as noted in https://github.com/FreeCAD/FreeCAD/pull/4271#discussion_r554673632
the pointer to the UI should be a unique pointer.

This PR does this for all Part dialogs that don't already use a unique_ptr.
2021-02-05 17:16:20 +01:00
David Osterberg
59ec3cb141 PartDesign: New features AdditiveHelix and SubtractiveHelix
These features, based on the code for the Pipe class, allow the user
to simply create a helical sweep within PartDesign workbench.

Sample application is threads, springs, coils, augers, etc.

Also, remove needless requirement for positive cone angle on helixes.

Thanks to @bitacovir for helping with the icons
Thanks to @chennes for review
Thanks to @vosk for review
Thanks to @wwmayer for review

Enforce that links stay within scope for ProfileBased features
This also ensures that the Body itself is not used for creating features within
the body, causing a "Graph not a DAG" error.
2021-02-04 13:01:12 +01:00
wmayer
3ebd7d119b Part: [skip ci] rename methods in TopoShape that override non-virtual functions of base class 2021-02-03 16:10:38 +01:00
wmayer
7a83853535 Part: offer all supported STEP schemes by OCC in a combo box 2021-02-02 21:51:11 +01:00
wmayer
b896bb4f2a Part: [skip ci] fix path of attachment icon 2021-01-30 17:22:54 +01:00
Stefan Tröger
446ce21517 Remove ExtensionProxy and rely on default Python proxy for extensions. fixes #0004534 2021-01-30 16:00:48 +01:00
Zheng, Lei
1dddcd0b18 Part: fix ViewProviderExt::updateVisual() on incomplete mesh 2021-01-28 17:38:49 +01:00
vosk
4bd5c2669d [Part] - Fix memory leaks 2021-01-28 15:45:00 +01:00
bitacovir
9e1d7653b8 Add SVG icons for two Part commands 2021-01-19 19:26:10 +01:00
marioalexis
4c323a6325 Part: Crash when calling SubShapes of empty shape from Python 2021-01-18 19:47:35 +01:00
Abdullah Tahiri
c0d810a370 Part: Geometry trigger notifyAttach on extension addition 2021-01-09 20:08:05 +01:00
Abdullah Tahiri
e6af511f39 Part/Sketcher: Refactor Geometry Extensions copy/save/restore AND attachment notification
=========================================================================================

- Long overdue refactor to avoid repetition during save/restore and copy.
- New interface to notify an extension when it is attached. It also enables the extension to gain
a pointer to the geometry container. This is intended to extend the functionality already existing
in Part::Geometry.
2021-01-09 20:08:05 +01:00
Yorik van Havre
adc78f1e23 Merge pull request #4252 from donovaly/Part-angular-measure
[Part] fix angular measurement
2021-01-08 11:42:21 +01:00
Zheng, Lei
12defb11b6 Part/Sketcher: improve list property update efficiency 2021-01-07 10:27:21 +01:00
wmayer
5d9db07ddd Part: [skip ci] in TopoShape::getMemSize() handle edges or faces with no attached geometry 2021-01-06 15:39:25 +01:00
Abdullah Tahiri
87c9f83bd6 Gui: Colorful/Greyable overlay status in icons
===============================================

Before this implementation, specific status via former mergeOverlayIcon() was greyed out
with the visibility.

With this commit, the developer has two options:

a) override mergeGreyableOverlayIcons, in which case the overlay will
be greyed out when the item is greyed out as per former mergeOverlayIcon()

b) override mergeColorfulOverlayIcons, in which case the overlay will
be superimposed after the icon is greyed out as it is the case for stardard
error and recompute flags.
2021-01-06 13:54:00 +01:00
donovaly
c5b6e105f7 [Part] fix angular measurement
the arrow heads are much too large so that the feature use quite useless

The PR fixes this to make the arrow heads as large as for linear dimensions
It also slightly increase the arrow head size since.
2021-01-06 04:37:53 +01:00