It would be interesting to have an answer directly from the OCC team.why do these people take such a hard work to apply approximations to specific shapes (conics) instead of the exact NURBS representation, that is existing?
Sketcher: Bezier curves
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Sketcher: Bezier curves
Re: Sketcher: Bezier curves
Thanks for sharing this thought. It actually is the only thing that makes sense so far.wmayer wrote: I don't know why they do it this way but maybe other algorithms have problems with rational splines. For example with boolean operations you often run into problems just with normal B-spline surfaces and maybe this becomes worse with real NURBS.
Definitely! Feel free to ask them and let us knowjean.thil wrote: why do these people take such a hard work to apply approximations to specific shapes (conics) instead of the exact NURBS representation, that is existing?
It would be interesting to have an answer directly from the OCC team.
Re: Sketcher: Bezier curves
Today I have rebased to master and changed the convert-to-NURBS functionality to use Werner's newly commited functionality. Funny enough, the approximation was indeed different (Top are the approx I used yesterday, bottom the approx by wmayer):
Ok, for circle we know why it is different, it is Werner's own implementation , but for example for the Ellipse, the OCC approx I used is substantially different from the OCC approx Werner uses (6 poles vs 14 poles). I think that the algo I used produces at least rational bsplines, while the algo Werner uses produces polynomic bsplines (at least for the Ellipse). Why I say that? Well I tried to show the poles:
The ellipse nurbs-ized by Werner's OCC does not deform when enforcing equal weights, whereas the one nurbs-ized using my OCC algo deforms at enforcing equal weights...
STREAMLINING:
To close this deliverable I need to:
1. Fix normal calculation of Nurbs containing straight segments (OCC's Normal fails miserably when the curvature is zero), or at least the effect (crash).
2. Include the icons Alex is doing for the Sketcher... I have to ask him one for the NURBS-ize a shape.
Next one has to do in principle with knots...
EDIT: The branch
https://github.com/abdullahtahiriyo/Fre ... iverable_2
Ok, for circle we know why it is different, it is Werner's own implementation , but for example for the Ellipse, the OCC approx I used is substantially different from the OCC approx Werner uses (6 poles vs 14 poles). I think that the algo I used produces at least rational bsplines, while the algo Werner uses produces polynomic bsplines (at least for the Ellipse). Why I say that? Well I tried to show the poles:
The ellipse nurbs-ized by Werner's OCC does not deform when enforcing equal weights, whereas the one nurbs-ized using my OCC algo deforms at enforcing equal weights...
STREAMLINING:
To close this deliverable I need to:
1. Fix normal calculation of Nurbs containing straight segments (OCC's Normal fails miserably when the curvature is zero), or at least the effect (crash).
2. Include the icons Alex is doing for the Sketcher... I have to ask him one for the NURBS-ize a shape.
Next one has to do in principle with knots...
EDIT: The branch
https://github.com/abdullahtahiriyo/Fre ... iverable_2
Re: Sketcher: Bezier curves
I like this new feature a lot! Very impressive and very useful.
Just wondering if this should work with occt7.0.0. With python3 and occt7 I always get an exception on right click:
Just wondering if this should work with occt7.0.0. With python3 and occt7 I always get an exception on right click:
<class 'Part.BSplineCurve'> returned a result with an error set
Re: Sketcher: Bezier curves
Could you specify where are you right-clicking so as to get that?looo wrote:I like this new feature a lot! Very impressive and very useful.
Just wondering if this should work with occt7.0.0. With python3 and occt7 I always get an exception on right click:<class 'Part.BSplineCurve'> returned a result with an error set
Re: Sketcher: Bezier curves
It's with two day old build of master + python3 branch:abdullah wrote:Could you specify where are you right-clicking so as to get that?
sketcher wb -> new sketch -> create bspline -> some left click for pole creation -> right click to finish bspline. If your implementation should work with occt7 this is most likely a problem with the python3 branch I am using.
Re: Sketcher: Bezier curves
Ah! That right-clicking! Well, I do not have OCCT7 installed, so I cannot compile against it, but I would not expect that to be the problem (but you never know). That "returning a result with an error set" sounds to me like Python speaking, but I cannot know if OCCT7 returned some error that python simply complains about... If you happen to compile main+OCCT7-python3 and the error is still there, we might come closer to a diagnosis...looo wrote:It's with two day old build of master + python3 branch:abdullah wrote:Could you specify where are you right-clicking so as to get that?
sketcher wb -> new sketch -> create bspline -> some left click for pole creation -> right click to finish bspline. If your implementation should work with occt7 this is most likely a problem with the python3 branch I am using.
Re: Sketcher: Bezier curves
Today's take, is the functionality for increasing the degree of the bspline. I have currently a button that when triggered increases by one the degree of the polynom. The code, even if it works, it is not yet of my liking and I won't be publishing this commit today. However, you get to have your daily teaser:
So basically I created one bspline, I made copies and increased their degree.
So now yes, to close this deliverable I need to:
1. Fix normal calculation of Nurbs containing straight segments (OCC's Normal fails miserably when the curvature is zero), or at least the effect (crash).
2. Include the icons Alex is doing for the Sketcher... I have to ask him one for the NURBS-ize a shape.
3. Make the increase degree code of my liking.
So basically I created one bspline, I made copies and increased their degree.
So now yes, to close this deliverable I need to:
1. Fix normal calculation of Nurbs containing straight segments (OCC's Normal fails miserably when the curvature is zero), or at least the effect (crash).
2. Include the icons Alex is doing for the Sketcher... I have to ask him one for the NURBS-ize a shape.
3. Make the increase degree code of my liking.
Re: Sketcher: Bezier curves
If you happen to compile main+OCCT7-python3 and the error is still there, we might come closer to a diagnosis...
no problems with occt7 and python2...good job
Re: Sketcher: Bezier curves
Thanks! Good to know. You may want to report the issue to the one doing the python3 integration...looo wrote:no problems with occt7 and python2...good job