Allow user to define a custom minimum deviation for the tessellation
This commit is contained in:
@@ -46,6 +46,10 @@ DlgSettings3DViewPart::DlgSettings3DViewPart(QWidget* parent)
|
||||
: PreferencePage(parent), ui(new Ui_DlgSettings3DViewPart), checkValue(false)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ParameterGrp::handle hPart = App::GetApplication().GetParameterGroupByPath
|
||||
("User parameter:BaseApp/Preferences/Mod/Part");
|
||||
double lowerLimit = hPart->GetFloat("MinimumDeviation", ui->maxDeviation->minimum());
|
||||
ui->maxDeviation->setMinimum(lowerLimit);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -241,6 +241,12 @@ ViewProviderPartExt::ViewProviderPartExt()
|
||||
("User parameter:BaseApp/Preferences/Mod/Part");
|
||||
NormalsFromUV = hPart->GetBool("NormalsFromUVNodes", NormalsFromUV);
|
||||
|
||||
// Let the user define a custom lower limit but a value less than
|
||||
// OCCT's epsilon is not allowed
|
||||
double lowerLimit = hPart->GetFloat("MinimumDeviation", tessRange.LowerBound);
|
||||
lowerLimit = std::max(lowerLimit, Precision::Confusion());
|
||||
tessRange.LowerBound = lowerLimit;
|
||||
|
||||
App::Material mat;
|
||||
mat.ambientColor.set(0.2f,0.2f,0.2f);
|
||||
mat.diffuseColor.set(r,g,b);
|
||||
|
||||
Reference in New Issue
Block a user