Commit Graph

2182 Commits

Author SHA1 Message Date
Ajinkya Dahale
3e7830c21b [Sketcher] Allow multiplicity change of B-Spline end knots
The first and last knots (which are often also poles) of a B-Spline are not
represented in sketcher as knots, but as end points of the curve. This creates a
problem when we want to change the multiplicities of those knots. As a
workaround, these points are treated differently.

NOTE: While it is technically possible to have end knots in a non-periodic
spline with degree <= degree of the curve, `Geom_BSplineCurve::RemoveKnot()`
fails for the first and last knots, so we are stuck with this. So, this commit
effectively only makes knot multiplicity change possible for periodic splines.
For non-periodic splines this commit just changes the confusing "no knot is
selected" message to an unhelpful "multiplicity modification failed".
2022-02-19 16:10:43 +01:00
Ajinkya Dahale
e8f7a58fc9 [Sketcher] Fix some strings in CommandConstraints.cpp 2022-02-19 16:10:43 +01:00
Ajinkya Dahale
3960325821 [Sketcher] Use knot insertion pointer when using that tool
Icon courtesy @bitacovir, adapted from https://forum.freecadweb.org/viewtopic.php?f=34&t=66262&p=572480#p572471.
2022-02-18 16:05:54 +01:00
Ajinkya Dahale
c912d5002f [Sketcher] Use point-and-click for knot insertion
Here, point and click means we can move the cursor around and select a point on
the curve, instead of having to enter a value in a dialog (just like we do for
geometry creation and constraints). Continuous mode is also supported, but these
only apply to one B-Spline which should selected before pressing the tool button.

A `DrawSketchHandlerBSplineInsertKnot` is created to handle all the graphical aspects.

Finer control may be desirable but that awaits tool settings task box or similar
changes where keyboard input can be used.

Made some changes as per comments by @abdullahtahiriyo. Also change `activated`
to follow recent NVI changes.
2022-02-18 16:05:54 +01:00
Uwe
5a3b1c4ebe [Sketch] ViewProviderSketch: add missing include 2022-02-18 03:27:53 +01:00
Uwe
87d293f404 [Sketch] ViewProviderSketch: remove unused includes
- also sort the includes
2022-02-18 03:15:27 +01:00
wmayer
c5dfa7fa01 Sketcher: fix warnings:
* fix -Winconsistent-missing-override
* fix -Woverloaded-virtual that is also a bug because the DrawSketchHandlerArcOfParabola didn't set the suitable mouse cursor
2022-02-17 21:14:37 +01:00
Abdullah Tahiri
d8c052c666 DrawSketchHandler: activation and deactivation via NVI pattern
==============================================================

With the introduction of overridable default behaviour for commands, it makes sense to keep control of the execution path of the activation and deactivation.

Non-virtual interface pattern enforces execution control of the virtual functions, while allowing the behaviour to be overriden in a case by case basis.
2022-02-17 19:37:48 +01:00
wmayer
c3511ba2f0 Sketch: make sure that Attachment editor shows up in the context-menu 2022-02-17 19:27:11 +01:00
0penBrain
3b1d8fd918 [Sketcher] Fix typo 2022-02-17 16:17:04 +01:00
0penBrain
a360829e9b [Sketcher] Disable constraint selectability on Shift press 2022-02-17 16:17:04 +01:00
0penBrain
34106f49e7 [Sketcher] Disable constraints selection when geometry/constraint handler is active 2022-02-17 16:17:04 +01:00
wmayer
6e012520d9 Sketcher: for Linux systems put definition of GeoElementId members back to header file to fix possible linker errors 2022-02-15 22:01:51 +01:00
0penBrain
30daaa66bc Sketcher: add GeoID on extended naming of geometries 2022-02-15 14:02:07 +01:00
0penBrain
6037553f3c Sketcher: add construction mode display for points in element list 2022-02-15 14:02:07 +01:00
Ajinkya Dahale
8888489aed [Sketcher] Add comment suggesting future segfault fixes
Apparently B-Spline knot insertion is challenging the sketcher update process
and spurious GUI updates sometimes occur in the intermediate step after the
knot is inserted but before the internal geometries are re-defined. This set of
comments points to a previous fix and related discussion as a suggestion.
2022-02-15 13:44:02 +01:00
Ajinkya Dahale
82edb612ad [Sketcher] Check constraint type before drawing icons
Change is in `EditModeConstraintCoinManager::drawConstraintIcon` on the lines of 247a9f0876.
2022-02-15 13:44:02 +01:00
Ajinkya Dahale
4ad0bdc5b2 [Sketcher] Reformat statements in EditModeConstraintCoinManager.cpp 2022-02-15 13:44:02 +01:00
wmayer
5e5e69013b Sketcher: fix linking errors with Conda builds 2022-02-14 12:41:07 +01:00
Yorik van Havre
19b89b1085 Merged crowdin translations 2022-02-14 12:31:57 +01:00
Ajinkya Dahale
4e0498c48e [Sketcher] Use proper formatting for knot list in dialog 2022-02-12 11:00:39 +01:00
Ajinkya Dahale
d53eabed07 [Sketcher] Make B-Spline curvature comb piecewise
This allows for better display of discontinuity in curvature and tangent
information.
2022-02-12 11:00:39 +01:00
wmayer
2e48c62c37 Sketcher: [skip ci] fix build failure with Qt 5.9 2022-02-09 17:45:24 +01:00
Ajinkya Dahale
588331515d [Sketcher] Fix some points mentioned in #6323
Knot insertions dialog uses decimal precision from preferences.

Sets the spinbox step for knot insertion dialog such that it goes from min to
max knot in 1000 steps.

Removes the mention of multiplicity option from the tooltip.
2022-02-09 13:53:46 +01:00
Abdullah Tahiri
faf60a5ed4 Sketcher: remove extra semicolon 2022-02-06 07:02:25 +01:00
Ajinkya Dahale
b7fb430e67 [Sketcher] Give knot information in insert knot command 2022-02-06 07:01:47 +01:00
0penBrain
6d890b75c6 [Sketcher] Fix section mode automation 2022-02-06 05:52:51 +01:00
0penBrain
2c2b9752fd [Sketcher] Fix check for fixed items in tangent+perpendicular 2022-02-06 05:12:15 +01:00
Abdullah Tahiri
91da38ada5 Sketcher: Correct comment
========================

6c019ac93f (r64179273)
2022-02-05 05:29:44 +01:00
Abdullah Tahiri
7aefd2366f Sketcher: Control Polygon incomplete for periodic BSplines
==========================================================

Bug fix:
https://forum.freecadweb.org/viewtopic.php?p=565127#p565127

Incorrect indexing of lineset fixed
2022-02-05 05:25:01 +01:00
Yorik van Havre
b0b1c0afbb Merged crowdin translations 2022-02-01 12:59:42 +01:00
wmayer
ad7ab573eb PD: PrefQuantitySpinBox now requires an explicit entry name for the parameter group 2022-01-31 16:47:08 +01:00
Yorik van Havre
b3e2c87530 Merged crowdin translations 2022-01-26 14:15:14 +01:00
0penBrain
b3e52226fe [Sketcher] set debug as cross platform 2022-01-20 13:03:16 +01:00
wmayer
31e2e95203 Base: Exception handling:
* Harmonize FreeCAD with Python exception types
* Implement AbortException::getPyExceptionType() to avoid handling it in client code
* Remove catch block for plain C strings
2022-01-19 18:00:04 +01:00
mwganson
e535204f8e Sketcher: prevent crash when accessing null pointer 2022-01-16 15:14:05 +01:00
luz paz
19e984f8c9 Fix various typos
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,bottome,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childrens,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oce,oder,ontop,orgin,orginx,orginy,ot,pard,parm,parms,pres,programm,que,rady,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/doc/SourceDocu`
2022-01-12 14:50:39 -06:00
Yorik van Havre
e33ef084ff Merged crowdin translations 2022-01-10 11:23:59 +01:00
luz paz
b0fcf45513 Fix various superfluous whitespace in *.dox files 2022-01-09 21:01:42 -06:00
Abdullah Tahiri
8923f50dce Sketcher: Remove unnecesary geometry touch 2022-01-09 11:40:49 +01:00
Abdullah Tahiri
247a9f0876 Sketcher: EditCoinManager - Check constraint types on updating constraint color
===============================================================================

Problem:
- While SketchObject inhibits intermediate updates during internal command execution, sometimes
a change in the selection (clear selection) in an intermediary step triggers an spurious update colour.

- There will be a final draw and this update colours at the end of the internal command.

- If the types of the constraints changed during the intermediary steps, it may happen that the constraint
coin nodes at a given position no longer correspond to the constraint type in the SketchObject property. This
may cause a attempt to access to a non-existing node or static casting a existing node to the wrong type.

Solution:
- Check the type of the constraint against the cached type. If not matching, cancel the color update.
2022-01-09 11:40:49 +01:00
Ajinkya Dahale
d920d73af4 [Sketcher] Add knot insertion command in Sketcher workbench 2022-01-09 11:33:53 +01:00
Ajinkya Dahale
d8c5801b95 [Sketcher] Add insertBSplineKnot to SketcherObject
[Sketcher] Workaround for segfault on knot insertion
2022-01-09 11:33:53 +01:00
wmayer
118b7aa0cc Sketcher: improve exception handling
* if determining the normal raises an exception then fall back to a default value
* when handling a Base::Exception then call its ReportException() function to get as much information as possible
2022-01-08 13:48:01 +01:00
Abdullah Tahiri
d76f3b3c0c Sketcher: ViewProvider parameter color subscription
===================================================

Bug:

Subscription/Unsubscription of outside of edit mode parameters was missing.

So changing the edge color from settings required to restart FreeCAD.

Fix:

Subscribe/Unsubscribe from the relevant parameter group
2022-01-07 10:19:22 +01:00
wmayer
0c0239571b Sketcher: avoid attaching to/detaching from the same parameter group twice 2022-01-06 00:35:36 +01:00
wmayer
ddbf8e0e2d Sketcher: avoid attaching to/detaching from the same parameter group twice 2022-01-05 14:05:05 +01:00
wmayer
6cab871678 Sketcher: fix build failures with MinGW 2021-12-30 15:12:56 +01:00
wmayer
5663651fd0 Sketcher: fix build failures with MSVC 2021-12-30 14:54:37 +01:00
Yorik van Havre
6cb3782c03 Merged crowdin translations 2021-12-29 12:20:12 +01:00