Open CASCADE, the 3D modelling kernel
3D modeling & numerical simulation

Search the Forums
See All Topics
 

Forced DeviationCoefficient in AIS_Circle

Forced DeviationCoefficient in AIS_Circle
Marco Balen 2013/05/10 18:11
Hello,

I need to improve the drawing quality of AIS_Circle entities.
I have found the MyContext->SetDeviationCoefficient() method to do this, but in AIS_Circle that coefficient is forced to 1.e-5.
See the code below from AIS_circle.cxx

//=======================================================================
//function : ComputeCircle
//purpose :
//=======================================================================
void AIS_Circle::ComputeCircle( const Handle(Prs3d_Presentation)& aPresentation)
{

GeomAdaptor_Curve curv(myComponent);
Standard_Real prevdev = myDrawer->DeviationCoefficient();
myDrawer->SetDeviationCoefficient(1.e-5);
StdPrs_DeflectionCurve::Add(aPresentation,curv,myDrawer);
myDrawer->SetDeviationCoefficient(prevdev);

}

I see that this coefficient is shared between circle,arc,curve and surface.
With smaller values the rendering of surface slows down very much , but the circle works well.

I have temporarily modified the AIS_Circle code to use a new value from my application to set the coefficient, but I think it would be better to have an new standard method to do this.

Can I hope that a couple of methods will be inserted to manage separately the value for Cirlce/Arcs and curve/Surface ?



Forum supervisor 2013/05/12 22:53
Dear Marco,
Yes, you are right forcing the fixed deviation coefficient value (1e-5) in AIS_Circle methods looks strange and it makes sense to correct this by simply using the deviation coefficient provided by the application through the AIS_Drawer instance.
However, it doesn't seem to be of much use to introduce any extra API methods to set the deviation coefficient, as AIS_Drawer suits pretty well for this.
Regards
 
 
Latest news
  • OCCT Applications
  • Open CASCADE Technology 6.8.0 is available for download!
  • New features to enhance the development process

  • © OPEN CASCADE 2000 - 2014  |  Search  |  Contacts   |  Site map