Commit Graph

2198 Commits

Author SHA1 Message Date
Ajinkya Dahale
ec132dc2e4 [Sketcher] Remove "incomplete" from insert knot command
I had kept the qualifier there when developing the tool and forgot to remove it. At this time the tool is fairly well-developed.
2022-03-06 16:25:08 +01:00
Ajinkya Dahale
ec2522130b [Sketcher] Allow deleting last knot during B-Spline creation 2022-03-06 16:14:07 +01:00
Ajinkya Dahale
c6f19758d1 [Sketcher] Reduce duplicate code in DrawSketchHandlerBSpline 2022-03-06 16:14:07 +01:00
wmayer
5e0cfc64ee App: use forward declarations 2022-03-04 21:09:46 +01:00
wmayer
1cbecdf122 App: use forward declaration to reduce compile time 2022-03-04 17:27:53 +01:00
Abdullah Tahiri
79f52556f4 Sketcher: Clean up old crosshair code
====================================

- Remove old unconnected code
- Move member functions to correct cpp file
2022-03-04 06:26:46 +01:00
Abdullah Tahiri
8de93cfaf7 Sketcher: GeoElementId VAxis fix - windows 2022-03-02 15:00:40 +01:00
Abdullah Tahiri
5d0e40a2ca Sketcher: Fix GeoElementId VAxis 2022-03-02 07:54:24 +01:00
Abdullah Tahiri
261efeb5e8 Sketcher: GeoElementId - isCurve and PosIdAsInt members 2022-03-02 07:53:07 +01:00
mosfet80
0b3bb1d365 Update SketchObject.cpp
Initialize variable
2022-03-01 17:42:23 +01:00
0penBrain
430166b7fc Sketch: Fix algorithm seeking for missing coincidences in Validate 2022-02-28 14:52:55 +01:00
wmayer
947f9cfbaa Sketch: [skip ci] add unit test to detect missing point-on-point constraints 2022-02-28 14:50:35 +01:00
Ajinkya Dahale
06f290e311 [Sketcher] Allow setting B-Spline degree at creation 2022-02-27 16:48:23 +01:00
Ajinkya Dahale
35373434bc [Sketcher] Create internal geometry after converting to NURBS
The control points are needed to edit the converted B-Spline
2022-02-25 18:45:12 +01:00
Ajinkya Dahale
a4955a27bf [Sketcher] Correct NURB to NURBS
The S in NURBS stands for Spline
2022-02-25 18:22:01 +01:00
wmayer
8302883843 Sketcher: fix crash in function 'Convert to B-Spline'
See also the forum thread: https://forum.freecadweb.org/viewtopic.php?f=19&t=66470
2022-02-24 12:54:11 +01:00
Ajinkya Dahale
61a7654094 [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
0a02853bb7 [Sketcher] Fix some strings in CommandConstraints.cpp 2022-02-19 16:10:43 +01:00
Ajinkya Dahale
cc8ec6dbd3 [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
054f99d5bc [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
fe44ae7ae5 [Sketch] ViewProviderSketch: add missing include 2022-02-18 03:27:53 +01:00
Uwe
4e974190bf [Sketch] ViewProviderSketch: remove unused includes
- also sort the includes
2022-02-18 03:15:27 +01:00
wmayer
f7392d47b9 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
f7741d4399 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
bb2872d5de Sketch: make sure that Attachment editor shows up in the context-menu 2022-02-17 19:27:11 +01:00
0penBrain
3eb233dc37 [Sketcher] Fix typo 2022-02-17 16:17:04 +01:00
0penBrain
6bb1fb6732 [Sketcher] Disable constraint selectability on Shift press 2022-02-17 16:17:04 +01:00
0penBrain
a12f5f2691 [Sketcher] Disable constraints selection when geometry/constraint handler is active 2022-02-17 16:17:04 +01:00
wmayer
39261d2c6b 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
44edfa37c7 Sketcher: add GeoID on extended naming of geometries 2022-02-15 14:02:07 +01:00
0penBrain
9eb6ac2c4d Sketcher: add construction mode display for points in element list 2022-02-15 14:02:07 +01:00
Ajinkya Dahale
3d452d9396 [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
5c817bf5e4 [Sketcher] Check constraint type before drawing icons
Change is in `EditModeConstraintCoinManager::drawConstraintIcon` on the lines of 16a28614c86d01e2d70eeaf376861e25af579304.
2022-02-15 13:44:02 +01:00
Ajinkya Dahale
654d7c7b20 [Sketcher] Reformat statements in EditModeConstraintCoinManager.cpp 2022-02-15 13:44:02 +01:00
wmayer
7acad0a043 Sketcher: fix linking errors with Conda builds 2022-02-14 12:41:07 +01:00
Yorik van Havre
e1028eb65e Merged crowdin translations 2022-02-14 12:31:57 +01:00
Ajinkya Dahale
6f7df343db [Sketcher] Use proper formatting for knot list in dialog 2022-02-12 11:00:39 +01:00
Ajinkya Dahale
64224aa618 [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
4bc4997680 Sketcher: [skip ci] fix build failure with Qt 5.9 2022-02-09 17:45:24 +01:00
Ajinkya Dahale
f712461c8f [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
faf8b8e6a6 Sketcher: remove extra semicolon 2022-02-06 07:02:25 +01:00
Ajinkya Dahale
0eb03ef734 [Sketcher] Give knot information in insert knot command 2022-02-06 07:01:47 +01:00
0penBrain
d6a314c4b9 [Sketcher] Fix section mode automation 2022-02-06 05:52:51 +01:00
0penBrain
d25a3e566c [Sketcher] Fix check for fixed items in tangent+perpendicular 2022-02-06 05:12:15 +01:00
Abdullah Tahiri
ebe788129a Sketcher: Correct comment
========================

e9e68d3d9d (r64179273)
2022-02-05 05:29:44 +01:00
Abdullah Tahiri
53d80b69f0 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
d7c5800da2 Merged crowdin translations 2022-02-01 12:59:42 +01:00
wmayer
62734ca415 PD: PrefQuantitySpinBox now requires an explicit entry name for the parameter group 2022-01-31 16:47:08 +01:00
Yorik van Havre
233182dcd6 Merged crowdin translations 2022-01-26 14:15:14 +01:00
0penBrain
2a1f2588ec [Sketcher] set debug as cross platform 2022-01-20 13:03:16 +01:00