Skip to content

[Sketcher] Tool Parameter widget + Offset tool#11174

Merged
abdullahtahiriyo merged 12 commits intoFreeCAD:mainfrom
Ondsel-Development:pw_tmp
Nov 3, 2023
Merged

[Sketcher] Tool Parameter widget + Offset tool#11174
abdullahtahiriyo merged 12 commits intoFreeCAD:mainfrom
Ondsel-Development:pw_tmp

Conversation

@PaddleStroke
Copy link
Contributor

@PaddleStroke PaddleStroke commented Oct 25, 2023

Fixes #10436
Fixes #7221
Fixes #5839

This PR adds parameters to sketcher tools. Some settings on the 3d view directly. Some settings in a taskbox widget on the taskview.

This PR include :

  • Tool Parameter framework.
  • Point tool
  • Line tool
  • Rectangle tool
  • Offset tool
  • Polygon tool

@github-actions github-actions bot added the Mod: Sketcher Related to the Sketcher Workbench label Oct 25, 2023
@PaddleStroke
Copy link
Contributor Author

PaddleStroke commented Oct 25, 2023

@abdullahtahiriyo Lint error for which I am not sure what to do :

DrawSketchControllableHandler :

"virtual" is redundant since function is already declared as "override"
I am not sure what should be done (supress or remove virtual) because for some functions Lint doesn't show this message.

DrawSketchDefaultHandler :

member access into incomplete type 'SketcherGui::ViewProviderSketch'

Does this need to include ViewProviderSketch.h in DrawSketchDefaultHandler.h ?

abdullahtahiriyo and others added 5 commits October 27, 2023 10:38
========================================================

Architecture to support multiple input from a widget and a mouse.
=======================================

Rewrite of the architecture to accomodate on-view parameters and to enable code reuse
between the default widget and custom widgets.
=====================================================

Enforce strong typing to avoid all kinds of abusive implicit conversionsm, the corresponding associated bugs and make code more readable.
@PaddleStroke PaddleStroke reopened this Oct 27, 2023
@PaddleStroke PaddleStroke marked this pull request as ready for review October 27, 2023 12:53
@PaddleStroke PaddleStroke changed the title [Sketcher] Tool Settings DRAFT to look at Lint warnings. [Sketcher] Tool Parameter widget Oct 27, 2023
@abdullahtahiriyo
Copy link
Contributor

I guess it adds the polygon tool too. You may want to update the PR description (for testers to know what to expect).

@PaddleStroke
Copy link
Contributor Author

@abdullahtahiriyo There is something we did not cleaned up its the toolbar UI of rectangle tool.
Currently I have left the toolbar as it was, which means 3 tools : rectangle, rectangle by center and oblong.
But Oblong just opens the rectangle tool (without checkbox checked) !
Rectangle by center opens the rectangle tool on the correct mode so that's OK.

  • My consensual suggestion is to remove Oblong from the toolbar.
  • What I think would be best is to put a single rectangle tool (remove oblong and rectangle by center).

@PaddleStroke
Copy link
Contributor Author

Ah yes I forgot about polygon. I added it to the description.

To update my UI preference, I would rather do this :

  • Remove rect by center, remove oblong, remove the polygon comp.
  • Make a single 'shape' comp in which we put : rectangle, slot, polygon.
    Would that be acceptable for you?

@PaddleStroke PaddleStroke changed the title [Sketcher] Tool Parameter widget [Sketcher] Tool Parameter widget + Offset tool Oct 27, 2023
@PaddleStroke
Copy link
Contributor Author

PaddleStroke commented Oct 27, 2023

@abdullahtahiriyo I have pushed a commit to remove the rectangle command group and replace by the single rectangle tool. So oblong and rectangle by center removed from the toolbar.

Let me know if this is ok like this. And also if you prefer that we create a 'shape' command group with slot and polygon.
The shape command group could be a good idea because it's reducing the toolbar size. Especially since we have more DSH coming in later (arc slot ...)

@abdullahtahiriyo
Copy link
Contributor

Currently I have left the toolbar as it was, which means 3 tools : rectangle, rectangle by center and oblong.

It sounds as a feature rather than an oversight when we look into merging this PR fast. The last we want is to start a toolbar discussion at this point.

Of course, the result is suboptimal after this PR is merged and needs to be addressed.

But Oblong just opens the rectangle tool (without checkbox checked) !

Oblong = rounded corners rectangle.

This sounds as a bug and needs to be fixed (it needs open with the checkbox checked).

To update my UI preference, I would rather do this :

* Remove rect by center, remove oblong, remove the polygon comp.

* Make a single 'shape' comp in which we put : rectangle, slot, polygon.
  Would that be acceptable for you?

I have no big problems.

From a practical point of view I do not make polygons extremely often and I could leave with having a polygon in a comp in which the representative is a rectangle. I could also leave with slot under rectangle and polygons separately. I would not cry either if I end up keeping slot and polygons separated. However, others might not be so forthcoming (rectangle not being a regular polygon, slot not even being an irregular polygon... being some of the arguments).

At least in the past, this caused very heated discussions. We deliver functionality first. When everybody can play with it, we discuss in the forum and see how it goes. This is a kind of community decision.

@PaddleStroke
Copy link
Contributor Author

Ok so maybe its best to merge as it is now (ie rectangle comp replaced by single rectangle tool and the rest is unchanged.) Then we can discuss the UI in deeper discussion

@abdullahtahiriyo
Copy link
Contributor

I would not dare to remove the center and rounded rectangle without a UI discussion.

Is it a problem to just fix the oblong?

@PaddleStroke
Copy link
Contributor Author

PaddleStroke commented Oct 27, 2023 via email

@PaddleStroke
Copy link
Contributor Author

I have just forced push to rollback previous commit, and instead just fixed the oblong tool so that it opens diagonal + round corner. Such that the ui is not changed. After this PR, people can play a little bit with it and we can discuss the UI at this point.

I am not sure it is worth waiting until after the weekend, we will have more people who will feedback if it merges. But waiting is fine for me as well.

@maxwxyz
Copy link
Collaborator

maxwxyz commented Oct 28, 2023

@PaddleStroke is it possible to group the horizontal and vertical constraints into a drop down and the new dropdown icon would invoke a new "straight" command (setting either a horizontal or vertical constraint, depending if the line is closer to horizontal or vertical).
This would clean up the toolbar and help find the right command when the view is rotated or you look from another side onto the sketch. Horizontal currently has nothing to do with the view.

@abdullahtahiriyo
Copy link
Contributor

@PaddleStroke

Please, add those changes. I will handle the incomplete type lints that compile fine in a separate PR, while I make myself acquainted with qtcreator. Then, we can merge.

@PaddleStroke
Copy link
Contributor Author

I will fix those asap.

@PaddleStroke
Copy link
Contributor Author

I have just done the small fixes and squashed the commits.
Do you want me to squash 48be53c ? If yes to which commit ?

@abdullahtahiriyo
Copy link
Contributor

@PaddleStroke

Thank you and sorry for the delay.

@abdullahtahiriyo abdullahtahiriyo merged commit aef0134 into FreeCAD:main Nov 3, 2023
@PaddleStroke
Copy link
Contributor Author

Thanks for handling this large project :)
By the way, I'm already working on the other DSH and have a few ready already. I'll open PRs very soon so don't go too far 😄

@abdullahtahiriyo
Copy link
Contributor

abdullahtahiriyo commented Nov 4, 2023

@PaddleStroke

I am currently doing some fixing of issues with lack of headers and other code issues from static tools.

I would like to handle the feedback in the forum thread with a certain degree of priority. Not only the one we have now, but also the one that should arrive over the weekend and the next week.

My biggest concern for this work was the framework. You have also gained substantial ability to use it (and even adapt it). I do not expect major issues with PRs porting existing tools to it.

I think the single most important issue warranting merit at this point is in making all users comfortable with the introduction of the framework. Not necessarily by catering all their requests, but by actively listening and discussing what can be done to improve.

@PaddleStroke
Copy link
Contributor Author

I do not expect major issues with PRs porting existing tools to it.

No but the tools still need to be tested to make sure I didn't missed any bugs. There are many cases so its easy to forget one.

Not necessarily by catering all their requests, but by actively listening and discussing what can be done to improve.

Of course!

@maxwxyz
Copy link
Collaborator

maxwxyz commented Nov 5, 2023

@PaddleStroke thank you for your work! Do you also have a plan to implement this in the Polyline tool?

@PaddleStroke
Copy link
Contributor Author

@maxwxyz Thanks !
Polyline tool is a tough one. I actually did it in my very early version of tool settings, and I remember it was very hard as the tool is already very complex. It's not in my imediate priority but one day I may come to it. Or if someone wants to do it, I think it's a nice project for a new developper. As its only one file its not so complex programatically. But the logic is complex. I would suggest that you open an issue for it.

@maxwxyz
Copy link
Collaborator

maxwxyz commented Nov 6, 2023

OK If I finally am able to build FC, maybe I can dive in (total newbie).
Is the on view parameter overlay going to replace the normal dimension window (double clicking on dimensions or using contextual dimension tool)? Currently there are the two forms now.

@PaddleStroke
Copy link
Contributor Author

Is the on view parameter overlay going to replace the normal dimension window (double clicking on dimensions or using contextual dimension tool)? Currently there are the two forms now.

This is something I actually worked on before. It probably won't be a simple spinbox as we have in on View Parameters because of the additional features. But my prototype was looking good. There was one issue with the expression dialog that got this feature stuck. I haven't been back to it yet.

https://www.youtube.com/watch?v=W5sP93yWt8c&ab_channel=FreeCADDevDiary

@PaddleStroke PaddleStroke deleted the pw_tmp branch May 2, 2024 16:13
Reqrefusion pushed a commit to Reqrefusion/FreeCAD-Documentation-Project that referenced this pull request Apr 6, 2025
…g|384px]] | В инструмент [[Sketcher_CreateArcSlot/ru|Создать дуговой слот (Паз по дуге)]] добавлено два режима (дуговые торцы и плоские торцы), позволяющие создавать изогнутые пазы [FreeCAD/FreeCAD#11174 Запрос на изменение #11174] |}"
Reqrefusion pushed a commit to Reqrefusion/FreeCAD-Documentation-html that referenced this pull request Apr 6, 2025
…g|384px]] | В инструмент [[Sketcher_CreateArcSlot/ru|Создать дуговой слот (Паз по дуге)]] добавлено два режима (дуговые торцы и плоские торцы), позволяющие создавать изогнутые пазы [FreeCAD/FreeCAD#11174 Запрос на изменение #11174] |}"
Reqrefusion pushed a commit to Reqrefusion/FreeCAD-Documentation-Project that referenced this pull request Apr 8, 2025
…амки. [FreeCAD/FreeCAD#11174 Запрос на изменение #11174] * Для инструмента «Отрезок» добавлено два новых режима: «Точка, длина, угол» и «Точка, ширина, высота». [FreeCAD/FreeCAD#11174 Запрос на изменение #11174] *..."
Reqrefusion pushed a commit to Reqrefusion/FreeCAD-Documentation-html that referenced this pull request Apr 8, 2025
…амки. [FreeCAD/FreeCAD#11174 Запрос на изменение #11174] * Для инструмента «Отрезок» добавлено два новых режима: «Точка, длина, угол» и «Точка, ширина, высота». [FreeCAD/FreeCAD#11174 Запрос на изменение #11174] *..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mod: Sketcher Related to the Sketcher Workbench

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Problem] Sketcher tools should be able to have a taskbox [Feature Request] Sketcher rectangle from 3 corners Add an Offset tool to the Sketcher

4 participants