[Sketcher] Any suggestions on improving B-Spline knot insertion?

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

[Sketcher] Any suggestions on improving B-Spline knot insertion?

Post by jnxd »

In PR #5311 I introduced a new "knot insertion" command for B-Splines so that we have more tools to manipulate them without creating fresh B-Splines. However, the feature is still pretty bare and I would like interested and more knowledgeable users to suggest some improvements that would make working with it (and splines in general) more feature complete and useful.

One major step that I want to take is to give the user some sort of feedback over where the new point corresponding to the new knot will lie. Currently we only see the new knot after it's created, but it doesn't sound like a difficult task to show the new point on the viewport. Unfortunately the dialog box obstructs this viewport (see https://github.com/FreeCAD/FreeCAD/pull ... 1008352439). I am looking for alternative ways to show this dialog so that the viewport is visible. My first instinct is to start a Taskview for knot insertion, but if we are editing a sketcher object, we already are in sketch TaskView, and I don't know of a taskview providing k

Any suggestions for how to implement this would be greatly appreciated
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?

Post by jnxd »

uwestoehr wrote: Ping
Tagging you since @chennes suggested in a PM, and since we've been discussing this on Github.
User avatar
adrianinsaval
Veteran
Posts: 5553
Joined: Thu Apr 05, 2018 5:15 pm

Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?

Post by adrianinsaval »

paddle has been working on adding a widget to the task view to input stuff for sketcher commands, perhaps you could use that while on sketcher?
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?

Post by jnxd »

adrianinsaval wrote: Thu Feb 10, 2022 3:58 pm paddle has been working on adding a widget to the task view to input stuff for sketcher commands, perhaps you could use that while on sketcher?
If it is what I think it is, it will be useful.
paddle wrote: Ping
Hello @paddle I'm not aware of what feature you're working but it sounds interesting. Any sneak peek?
User avatar
paddle
Veteran
Posts: 1415
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?

Post by paddle »

jnxd wrote: Thu Feb 10, 2022 5:49 pm Hello @paddle I'm not aware of what feature you're working but it sounds interesting. Any sneak peek?
Hello!
You can see a video showing Tool Setting widget :
https://forum.freecadweb.org/viewtopic.php?f=9&t=65279
I think it's possibly something that will help you indeed. But it hasn't merge yet.

If you want to check the latest version of ToolSetting it's on this branch :
https://github.com/PaddleStroke/FreeCAD ... Contextual
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?

Post by jnxd »

paddle wrote: Thu Feb 10, 2022 7:28 pm I think it's possibly something that will help you indeed. But it hasn't merge yet.
It is indeed exactly what I need. Do you have an ETA for this?
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?

Post by jnxd »

paddle wrote: Thu Feb 10, 2022 7:28 pm If you want to check the latest version of ToolSetting it's on this branch :
https://github.com/PaddleStroke/FreeCAD ... Contextual
From reading the forum post it appears you are done with coding the tool settings task box and are now just making the different settings for different sketch features? If you could rebase on the latest master with knot insertion I can work on the settings for that tool.
User avatar
paddle
Veteran
Posts: 1415
Joined: Mon Feb 03, 2020 4:47 pm

Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?

Post by paddle »

jnxd wrote: Thu Feb 10, 2022 11:31 pm From reading the forum post it appears you are done with coding the tool settings task box and are now just making the different settings for different sketch features? If you could rebase on the latest master with knot insertion I can work on the settings for that tool.
You're right, the tool settings is working and I'm just improving it, fixing bad hacks as per Abdullah recommendations and making new settings for new tools.

Basically the idea is that when your tool launches it calls

Code: Select all

toolSettings->widget->setSettings(x); 
where x is your tool. This way you can customize how many spinboxes appear and set their names and so on.
You might need to add other components depending on what you need.

I'll rebase on master now. Edit: Git is driving me crazy again. I just can't rebase and I can't find why.
I'm trying simple "git pull --rebase origin master" and he's throwing me conflicts that makes no sens.

Code: Select all

Freecad-Src (ConstraintContextual)
$ git pull --rebase origin master
From https://github.com/PaddleStroke/FreeCAD
 * branch                  master     -> FETCH_HEAD
Auto-merging src/Mod/Sketcher/Gui/CommandCreateGeo.cpp
CONFLICT (content): Merge conflict in src/Mod/Sketcher/Gui/CommandCreateGeo.cpp
Auto-merging src/Mod/Sketcher/Gui/TaskSketcherTool.cpp
CONFLICT (add/add): Merge conflict in src/Mod/Sketcher/Gui/TaskSketcherTool.cpp
Auto-merging src/Mod/Sketcher/Gui/TaskSketcherTool.h
CONFLICT (add/add): Merge conflict in src/Mod/Sketcher/Gui/TaskSketcherTool.h
Auto-merging src/Mod/Sketcher/Gui/TaskSketcherTool.ui
CONFLICT (add/add): Merge conflict in src/Mod/Sketcher/Gui/TaskSketcherTool.ui
Auto-merging src/Mod/Sketcher/Gui/ViewProviderSketch.h
error: could not apply 1b0258351f... Sketcher tool setting implementation. Only for rectangle tool for now.
hint: Resolve all conflicts manually, mark them as resolved with
hint: "git add/rm <conflicted_files>", then run "git rebase --continue".
hint: You can instead skip this commit: run "git rebase --skip".
hint: To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 1b0258351f... Sketcher tool setting implementation. Only for rectangle tool for now. (Solved conflict)
"1b0258351f... Sketcher tool setting implementation. Only for rectangle tool" is one of the first commit that is INSIDE this ConstraintContextual branch.
I don't understand, why it's trying to apply a commit of itself to itself?
Edit2: It appeared that I had duplicates of commits because the remote branch was merged in the local branch at some point. I hate git. On the bright side it's rebased
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?

Post by jnxd »

paddle wrote: Fri Feb 11, 2022 9:18 am You're right, the tool settings is working and I'm just improving it, fixing bad hacks as per Abdullah recommendations and making new settings for new tools.
Great. Please try to squash the commits if possible as you rebase them as well. I'm pretty sure people will have a hard time handling forty eight of them in one PR. I would also suggest making the PR itself when you are confident enough for a few constraints.
paddle wrote: Fri Feb 11, 2022 9:18 am I'll rebase on master now. Edit: Git is driving me crazy again. I just can't rebase and I can't find why.
...
Edit2: It appeared that I had duplicates of commits because the remote branch was merged in the local branch at some point. I hate git. On the bright side it's rebased
Glad you found out the issue and it's resolved!
User avatar
jnxd
Posts: 952
Joined: Mon Mar 30, 2015 2:30 pm
Contact:

Re: [Sketcher] Any suggestions on improving B-Spline knot insertion?

Post by jnxd »

Meanwhile, I set out to set up drawing the representative point in parallel, but I'm having issues going forward with it. See https://github.com/FreeCAD/FreeCAD/pull/6348.
Post Reply