Jelle Feringa a écrit :
>
>>             - added SetQuality method in Display3d class
>
> I'm assuming this sets the approximation of the meshes in the viewer ( 
> the deflection of the mesh ) ?
> Cool, I noticed the meshes we're very precise, but heavy too, so this 
> is a welcome addition ( that is, if my assumption is correct ;')
>
> -jelle
Jelle,

Your asumption is absolutely correct! Here is the source code of the 
SetQuality method:

void Display3d::SetQuality(Standard_Real factor)
{
    /*
    Extracted from OCC forum thread 
http://www.opencascade.org/org/forum/thread_13256/
    */
    myAISContext->SetDeviationAngle(myAISContext->DeviationAngle() / 
factor);
    
myAISContext->SetDeviationCoefficient(myAISContext->DeviationCoefficient() 
/ factor);
    
myAISContext->SetHLRDeviationCoefficient(myAISContext->HLRDeviationCoefficient()
 
/ factor);
    myAISContext->SetHLRAngle(myAISContext->HLRAngle() / factor);
}

As you can see, SetQuality takes a 'factor'parameter. When you call the 
SetQuality method, the 'quality' is relative to the current settings:

- SetQuality(factor), factor>1: better precision, big meshes
- SetQuality(factor), factor=1: no change
- SetQuality(factor), factor<1: less precision, light meshes

For example, if you call SetQuality(2) 3 times, it's the same as if you 
call SetQuality(8) once (since 2^3 = 8). Maybe I should rename this 
function with the name 'SetRelativeQuality' and add another 
SetAbsoluteQuality method.

In the previous release, the viewer was initialized with factor=5. 
That's why meshes were so big. I dropped this code to a new method to 
allow anyone to set his own quality, reduce default memory footprint and 
also make the 'Init' method easier to debug (Linux port).

Thomas

_______________________________________________
Minerva-pythonocc mailing list
Minerva-pythonocc@gna.org
https://mail.gna.org/listinfo/minerva-pythonocc

Reply via email to