Commit Graph

231 Commits

Author SHA1 Message Date
Abdullah Tahiri
8b4acf11c2 Sketcher: Centered Rectangle Creation 2021-06-20 08:14:18 +02:00
Abdullah Tahiri
7c519689f0 Sketcher: Reorder rounded rectangle code next to normal rectangle code 2021-06-20 07:07:22 +02:00
donovaly
01d2f6298f [Sketch] add new sketch object rounded rectangle
while constructing I miss often that one cannot insert directly rounded rectangles. As it is, one needs first to insert a rectangle, then go to fillet mode, then click 4 times, then set equal constraint, then often also replace the vertical/horizontal constraints since a rectangle must not necessarily be parallel to a sketch axis

As solution this PR adds rounded rectangles in one step. This saves a lot of time since this object is e.g. often used for milled rectangular pockets, for 3D-printed pads etc.

As discussed I grouped the rectangle and rounded rectangle.
2021-06-20 06:14:24 +02:00
Tomas Pavlicek
4d6b1f3eb8 Sketcher - Add new Split Edge action 2021-04-24 14:30:35 +02: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
j
7b9d9fdcdb Sketcher: new fillet UI command 2021-02-04 08:10:28 +01:00
Abdullah Tahiri
395a0f19b4 Part/Sketcher - Construction Migration - step 3: Removal of Geometry construction data member
=============================================================================================

This commits removes the Geometry construction data member and adapts sketcher code to use
GeometryFacade to access construction information via the SketchGeometryExtension.
2020-12-10 18:34:06 +01:00
Abdullah Tahiri
95c1a262b7 Sketcher: Unit independent pole weight for B-Splines (Weight constraint)
========================================================================

Until now BSpline poles were circles relying on physical length units. This lead to several
problems:
- While the BSpline weight follows the circle size, weights do not have length units, but are adimensinal
- As representation of the BSpline depends on the physical size of the circle, the numerical value to be
  set to a pole circle differs from the numerical value of the weight.

The present commit:
1. Separates pole circle representation (physical size), from the numerical value used in the radius constraint,
so that the value in the constraint is the weight, the value representation is a factor of the weight value (in this
commit is getScaleFactor(), but this will change in the next commit). Dragging accounts for this scale factor too.
2. While Radius constraint button is used to constraint a B-Spline weight as before, this creates a Weight constraint,
which is a new type of constraint. This is done so that the value is truly adimensional and is so presented in all kind
of editors that rely on the units indicated by the constraint. It is obviously also shown as adimensional (thus without units),
in the 3D view and in the datum dialogs.
3. Because the circle of the pole of a B-Spline is not a geometric circle, but a graphical representation of the pole and how
it affects the corresponding B-Spline, constraint creation commands are limited so that no point on object, tangent, perpendicular
or SnellLaw constraints can be created on a B-Spline weight circle. This is also the case for the Diameter constraint, which won't
accept the circle. Equality constraints work either on only circles or only weights, but not on a mixture of them.

Bonus: This commit fixes a bug in master, that using the select equality constraint then click in two geometric elements mode, you
could make a circle equal to an ellipse resulting in malformed solver constraints.
2020-12-10 18:34:06 +01:00
luz paz
5effcc1983 Sketcher: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the Sketcher Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
Abdullah Tahiri
1f46b72491 Part: Geometry - encapsulate construction access 2020-10-25 03:52:51 +01:00
vocx-fc
7626accb59 Sketcher: move other icons into their subdirectories 2020-10-01 09:59:26 +02:00
vocx-fc
6b3691870e Sketcher: move icons to geometry subdirectory
Add the icon path to the workbench's `InitGui.py`.
2020-10-01 09:59:26 +02:00
vocx-fc
c6b6b314a1 Sketcher: small style changes to make the lines shorter 2020-10-01 09:59:26 +02:00
Vanuan
7a0aec1210 High DPI support: Convert sketcher cursors to SVG
Remove xpm
2020-08-19 19:59:13 +02:00
0penBrain
811a44643c [Sketcher] Local settings are correctly restored ; fixes #3952,#4058 2020-05-27 19:25:47 +02:00
0penBrain
6a6c34480a [Sketcher] 'Avoid redundant autoconstraint' is processed only if 'Autoconstraints' is active 2020-05-27 19:25:47 +02:00
0penBrain
9862670cf2 [Sketcher] Simplify general settings management 2020-05-27 19:25:47 +02:00
dulouie
e83dd0121c Sketcher: fix contraints cmd crosshair color 2020-03-16 09:34:21 +01:00
luz.paz
180805c55e Fix typos
Found via  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,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
```
2020-03-06 14:50:35 +01:00
wmayer
f22607a617 Sketcher: [skip ci] add create polygon command to sketcher menu 2020-02-07 15:28:07 +01:00
luz.paz
b2ffebf1c0 Sketcher: [skip ci] fix header uniformity
This PR fixes header uniformity across all Sketcher WB files
2019-12-22 01:00:29 +01:00
luz.paz
379d041664 Fix typos and some trailing whitespace
Found via:  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,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
```
2019-12-03 12:22:59 +01:00
wmayer
c0d58b8f3e [skip ci] fix more -Wgnu-zero-variadic-macro-arguments 2019-11-17 19:11:08 +01:00
luz.paz
1c981e8f14 Fix typos and misc. formatting [skip ci]
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,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`
2019-10-21 16:02:23 -03:00
wmayer
eb6a405c17 abort hyperbola creation when angles are NaN 2019-10-17 00:22:39 +02:00
luz.paz
c80ecc4a70 Source typo fix (includes file rename) 2019-10-05 13:19:32 -04:00
luz.paz
7b7797f4f3 Fix various (doxy) typos and whitespace issues
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,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`
2019-10-03 07:57:13 +02:00
wmayer
d0d92b0801 force strict ISO C++ (-Wpedantic)
for Fem, Import, PartDesign, Robot, Sketcher, TechDraw
2019-09-18 14:18:07 +02:00
wmayer
4f28941698 fix possible memory leak 2019-09-15 21:00:21 +02:00
wmayer
4631b26d42 fix crash in polyline tool 2019-09-15 11:03:21 +02:00
Zheng, Lei
f78f05adee Sketcher: fix external editing 2019-08-17 15:32:50 +02:00
Zheng, Lei
00bcef0619 Gui: support in-place editing
The link support means that an object can now appear in more than one
places, and even inside a document different from its own. This patch
adds support for in-place editing, meaning that the object can be edited
at correct place regardless where it is.

See [here](https://git.io/fjPIk) for more info about the relavent APIs.

This patch includes two example of modifications to support in-place
editing. One is the ViewProviderDragger, which simply adds the dragger
node to editing root node by calling
View3DInventorViewer::setupEditingRoot(dragger). The other much more
complex one is ViewProviderSketch which calls setupEditingRoot(0) to
transfer all its children node into editing root. ViewProviderSketch
also includes various modifications to command invocation, because we
can no longer assume the active document is the owner of the editing
object.

This patch also includes necessary modification of the 'Show' module to
support in-place editing.
2019-08-17 15:08:32 +02:00
Abdullah Tahiri
0635822415 Sketcher: Polyline snap arc to 45 degrees bug fix
=================================================

fixes #3974

Snapping to 45 degrees during arc creation (hold ctrl during an arc within a polyline), resulted in
reduced precision, because Gui::Command::doCommand %f defaults only to six decimal positions, which is
a poor representation in radians of, for example, 90 degrees.

A work-around could have been to hardcode a higher number of decimals, as in %0.Xf. However, I do not like
such magic numbers.

The solution chosen is to use an App.Quantity object using as units degrees, which leads to no loss of precision.
2019-06-22 17:22:40 +02:00
Abdullah Tahiri
dc32a0685b Sketcher: GUI PCH 2019-05-02 07:12:51 +02:00
wmayer
51811e4bf4 PVS: V688 A local variable possesses the same name as one of the class members, which can result in a confusion 2019-03-13 11:58:43 +01:00
triplus
43b081947f Improved icon themes support 2019-02-13 10:42:46 -02:00
luz.paz
d040a656b4 Typos cont. + whitespace 2019-02-08 11:01:24 -02:00
luz.paz
4cfda0c3a5 Misc. typos
Found via `codespell`
2019-02-08 11:01:24 -02:00
luz.paz
77102cae41 Crowdin: Sketcher/Gui/CommandCreateGeo.cpp fix typos 2019-01-30 11:08:03 -02:00
luz.paz
90841f72c1 Crowdin: Sketcher/Gui/CommandCreateGeo.cpp typo fix 2019-01-30 11:08:03 -02:00
wmayer
56db19824e Replace Base::Exception with appropriate subclass 2018-11-14 19:27:52 +01:00
Abdullah Tahiri
1d86a83b30 Sketcher: Fillet UI command Improved exception handling 2018-10-28 18:35:41 +01:00
Abdullah Tahiri
4b9d90321a Sketcher: GUI command updated to support filleting of bounded curves 2018-10-28 18:34:23 +01:00
Abdullah Tahiri
0aa3da513a Sketcher: filleting arcofconic-arcofconic command 2018-10-28 18:32:02 +01:00
mwganson
2c09277763 sketcher: clear selection after failed addExternal geometry to prevent crash 2018-10-05 11:26:07 +02:00
luz.paz
b214f606c4 Misc. typo and whitespace fixes
ref: https://forum.freecadweb.org/viewtopic.php?f=3&t=30988#p256964
along with other misc. fixes
2018-09-19 17:26:03 +02:00
Abdullah Tahiri
8505b0eff4 Sketcher: Automatic redundant removal mechanism
===============================================

It is a long felt need that redundant constraints are not generated while autoconstraining.

The solver sketcher in v0.17 is überpicky with redundants due to the new popularity contest algorithm. The former behaviour is exhacerbated.

This new mode enables automatic redundant constraint removal.

In UI operations IN EDIT MODE, upon detection of redundancy by the solver, the Sketcher will remove all redundant constraints detected by that solve.

This makes the sketcher much less annoying.

How to test this?

The easiest example is to create a vertical line. Then make the endpoints symmetric with respect to the horizontal axis. Without this mode,
the vertical constraint and the symmetry constraint are redundant. With this mode, the vertical constraint gets automatically removed by the Sketcher.
2018-08-26 20:54:01 +02:00
Abdullah Tahiri
ec6eaa509d Sketcher: Improved B-Spline creation 2018-05-31 14:33:58 +02:00
Abdullah Tahiri
c039bfb011 Sketcher: Snap polyline arcs to 45 degrees pressing ctrl fixes #3472 2018-05-21 10:45:13 -03:00
Abdullah Tahiri
dc79d4172d Sketcher: fix menu periodic bspline call 2018-04-22 07:39:15 +02:00