Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Sketcher] Fixing some issues with "Convert to NURBS" #6403

Closed

Conversation

AjinkyaDahale
Copy link
Contributor

Fixes include:

  1. Rename CmdSketcherConvertToNURB to CmdSketcherConvertToNURBS.
  2. TODO: Make sure internal geometries (knots, poles) are created in the tool.

@github-actions github-actions bot added the WB Sketcher Related to the Sketcher Workbench label Feb 20, 2022
@AjinkyaDahale
Copy link
Contributor Author

@luzpaz @abdullahtahiriyo need some input on the renaming commit. When I just made changes in CommandSketcherBSpline.cpp, it'd compile but the button disappears. I ran sed to rename it everywhere and only kept the "main" translation file which seems to work. Also, if there's a reason to keep the name to NURB, let me know.

@luzpaz
Copy link
Contributor

luzpaz commented Feb 20, 2022

So https://wiki.freecad.org/Sketcher_BSplineConvertToNURB redirects to Sketcher_BSplineApproximate on the wiki.

@AjinkyaDahale
Copy link
Contributor Author

So https://wiki.freecad.org/Sketcher_BSplineConvertToNURB redirects to Sketcher_BSplineApproximate on the wiki.

Sketcher_BSplineApproximate name is only used for the icon name in file.


CmdSketcherConvertToNURB::CmdSketcherConvertToNURB()
CmdSketcherConvertToNURBS::CmdSketcherConvertToNURBS()
: Command("Sketcher_BSplineConvertToNURB")
Copy link
Contributor

@luzpaz luzpaz Feb 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edited: you missed this one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about that. But possibly. That is the name we use in code, and NURBS is more common than NURB. This was in reply to the unedited comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see. Should be fixed now.

@luzpaz
Copy link
Contributor

luzpaz commented Feb 20, 2022

Sketcher_BSplineApproximate name is only used for the icon name in file.

See line 407,
the WhatsThis entry points to Sketcher_BSplineConvertToNURB which auto-redirects to Sketcher_BSplineApproximate

So you're proposing the wiki page Sketcher_BSplineConvertToNURB should be un-redirected and renamed to Sketcher_BSplineConvertToNURBS ?

Edit: the GH UI wasn't cooperating with me. Sorry for all the noise.

@AjinkyaDahale
Copy link
Contributor Author

So you're proposing the wiki page Sketcher_BSplineConvertToNURB should be un-redirected and renamed to Sketcher_BSplineConvertToNURBS ?

As I said in the review line, that's possibly what needs to be done. Alternatively if we want to use BSplineApproximate we could rename the methods that way.

@abdullahtahiriyo
Copy link
Contributor

@AjinkyaDahale

I have browse the code. I think you no longer need my input. Am I right?

@AjinkyaDahale
Copy link
Contributor Author

AjinkyaDahale commented Feb 20, 2022

@AjinkyaDahale

I have browse the code. I think you no longer need my input. Am I right?

Actually I kind of do. @luzpaz resolved point 1 but I'm having some annoying segfault/core dump when trying point 2. I will update in a while.

@AjinkyaDahale
Copy link
Contributor Author

@abdullahtahiriyo take a look at https://forum.freecadweb.org/viewtopic.php?f=19&t=66470&p=573113#p573113. That thread talks about a crash in master but a similar issue happens with a second commit I am trying to push to this PR.

@AjinkyaDahale AjinkyaDahale force-pushed the sketcher-cv-to-nurbs-fix branch 2 times, most recently from c4b3030 to cd53803 Compare February 20, 2022 23:57
@freecadci
Copy link

pipeline status for feature branch PR_6403. Pipeline 475352064 was triggered at c4b3030. All CI branches and pipelines.

@freecadci
Copy link

pipeline status for feature branch PR_6403. Pipeline 475439144 was triggered at cd53803. All CI branches and pipelines.

@AjinkyaDahale AjinkyaDahale marked this pull request as ready for review February 21, 2022 17:14
@AjinkyaDahale
Copy link
Contributor Author

I think the crash I described is fixed with some changes and this PR is ready for review.

@abdullahtahiriyo this still needs your input. Apart from the code review, we should decide between ConvertToNURBS and BSplineApproximation as a name for this tool. Right now it's mixed: the method and command go for the former, but the icon and wiki page are named the latter. This caused some confusion already.

@freecadci
Copy link

pipeline status for feature branch PR_6403. Pipeline 476342470 was triggered at 2e8198a. All CI branches and pipelines.

@freecadci
Copy link

pipeline status for feature branch PR_6403. Pipeline 476917256 was triggered at 17eb6b5. All CI branches and pipelines.

The S in NURBS stands for Spline
The control points are needed to edit the converted B-Spline
@freecadci
Copy link

pipeline status for feature branch PR_6403. Pipeline 478983776 was triggered at 7393b55. All CI branches and pipelines.

@wwmayer
Copy link
Contributor

wwmayer commented Feb 25, 2022

690a7b4
f90a987

@wwmayer wwmayer closed this Feb 25, 2022
@AjinkyaDahale AjinkyaDahale deleted the sketcher-cv-to-nurbs-fix branch February 25, 2022 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WB Sketcher Related to the Sketcher Workbench
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Sketcher] Crash when using "Convert Geometry to B-spline" on drag select.
5 participants