
Thu, 09/09/2010 - 10:45
Forums:
Please, refer attached file "Curve-Smooth.bmp" where curve is NOT smooth. How can we make that curve as smooth? I have already tried using API's from link: http://www.opencascade.org/org/forum/thread_17938/ but without any effect.
theContext->SetDeviationCoefficient(0.00001);
theContext->SetDeviationAngle(theContext->DeviationAngle() / 10.0 );
theContext->SetHLRDeviationCoefficient(0.0001);
theContext->SetHLRAngle(theContext->HLRAngle() / 10.0);
Attachments:
Thu, 09/09/2010 - 18:41
Hi Komal,
From your message is not clear what kind of smoothing do you mean?
The referred API is dedicated just to tune a shape presentation (what you see on the screen) without any impact on the shape itself built by Geom_BsplineCurve.
So, we may speak about two different types of "smoothness":
1) Curve Presentation (any curve on the screen is presented by set of small straight lines which highlighted on the attached picture)
2) Curve geometrical model (presented by continuity of curve: C0, C1, C2 and etc)
So, could you specify your problem more exactly.
sergey
Thu, 09/09/2010 - 18:51
Hi Sergey,
I am expecting the curve same as attached image. Please, refer attached image. I do NOT want curve on screen to be set of small straight lines. So, i mean Curve Presentation. How can curve be shown smooth on screen?
-Komal
Fri, 09/10/2010 - 14:58
Hi,
I would recommend'd trying the following code(it should be applied before displaying a curve):
Handle(AIS_Shape) anIO = getShapeAISFromSomewhere();
Handle(Prs3d_Drawer) aDrawer = anIO->Attributes();
aDrawer->SetTypeOfDeflection( Aspect_TOD_RELATIVE ); // just to ensure relative deflection is used
aDrawer->SetDeviationCoefficient( 1e-6 );
theContext->Display( anIO );
And play with values.
Good luck.
Sergey
Fri, 09/10/2010 - 16:45
Thanks Sergey for immediate response.
But, I cannot see much effect. Please, refer the attached screen-shot for SetDeviationCoefficient( 1e-12 ). If i make input parameter value more than 1e-15, PC gets hang.
How can i fix the issue?
-Komal
Fri, 09/10/2010 - 16:53
Your confusion geometry approximation with anti aliasing.
A good thing that OCC can take care of that.
Standard_EXPORT void V3d_View::SetAntialiasingOn()
See doxygen: YOUR_OCC_DOCS/Visualization/html/classV3d__View.html#a125
Also, I'm not surprised that OCC gives up on 1e-15.
More than Sergey's suggested value is *definitely* overkill!
Fri, 09/10/2010 - 17:21
Jelle,
upto some extend but NOT fully smooth. Pls, refer attached screen-shot. Can you please, advice further on this? Thanks in advance.
-Komal
Fri, 09/10/2010 - 17:24
Well, its simply not going to bet any better than this ;)
There are some artefacts in your view, so maybe its your graphics card.
Fri, 09/10/2010 - 18:09
Thanks a lot jelle.
Finally i got what i need with function suggested by YOU.
-Komal
Fri, 09/10/2010 - 18:20
Terrific! Happy to hear that.
Thu, 03/24/2011 - 19:47
Hi Sergey,
Can you but can you say the answer on the second question : about curve geometrical model ?
-Dima