1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0032982: [Regression to 7.3.0] Mesh - Meshing the shape takes too long and visualization is bad

New formula to calculate number of points along V axis of a cone depending on ratio of its size along V and U.
This commit is contained in:
oan
2022-08-26 18:54:33 +03:00
committed by smoskvin
parent 8da2801496
commit dfb5aebd35
7 changed files with 50 additions and 7 deletions

View File

@@ -41,10 +41,13 @@ std::pair<Standard_Real, Standard_Real> BRepMesh_ConeRangeSplitter::GetSplitStep
const Standard_Real aDiffU = aRangeU.second - aRangeU.first;
const Standard_Real aDiffV = aRangeV.second - aRangeV.first;
Standard_Integer nbU = (Standard_Integer) (aDiffU / Du);
Standard_Integer nbV = (Standard_Integer) (nbU * (aDiffV) / (aDiffU * aRadius));
const Standard_Real aScale = (Du * aRadius);
const Standard_Real aRatio = Max(1., Log(aDiffV / aScale));
const Standard_Integer nbU = (Standard_Integer)(aDiffU / Du);
const Standard_Integer nbV = (Standard_Integer)(aDiffV / aScale / aRatio);
Du = aDiffU / (nbU + 1);
Dv = aDiffV / (nbV + 1);
Dv = aDiffV / (nbV + static_cast<Standard_Integer>(aRatio));
theStepsNb.first = nbU;
theStepsNb.second = nbV;