0030442: Mesh - broken triangulation on pipe shape
Scale down min size parameter for NURBS taking into account its U and V resolution in order to prevent comparison of 2d parameters with 3d value involved in filtering process.
1. Check whether the mesh satisfies the required angular deflection has been amended. Namely normals (to the surface) in the ends of any not "frontier" link are made collinear (with the given angular tolerance).
2. New parameters AngleInterior and DeflectionInterior have been added in IMeshTools_Parameters structure.
3. In case of thin long faces with internal edges, add points of internal edges to control parameters using grabParamsOfInternalEdges() in order to avoid aberrations on its ends. Disable addition of parameters from boundary edges in case of BSpline surface. Deviation can be controlled through the deflection parameter.
4. Grab parameters from edges in case if there is just a single interval on BSpline surface along U and V direction.
Removed tight connections between data structures, auxiliary tools and algorithms in order to create extensible solution, easy for maintenance and improvements;
Code is separated on several functional units responsible for specific operation for the sake of simplification of debugging and readability;
Introduced new data structures enabling possibility to manipulate discrete model of particular entity (edge, wire, face) in order to perform computations locally instead of processing an entire model.
The workflow of updated component can be divided on six parts:
* Creation of model data structure: source TopoDS_Shape passed to algorithm is analyzed and exploded on faces and edges. For each topological entity corresponding reflection is created in data model. Note that underlying algorithms use data model as input and access it via common interface which allows user to create custom data model with necessary dependencies between particular entities;
* Discretize edges 3D & 2D curves: 3D curve as well as associated set of 2D curves of each model edge is discretized in order to create coherent skeleton used as a base in faces meshing process. In case if some edge of source shape already contains polygonal data which suites specified parameters, it is extracted from shape and stored to the model as is. Each edge is processed separately, adjacency is not taken into account;
* Heal discrete model: source TopoDS_Shape can contain problems, such as open-wire or self-intersections, introduced during design, exchange or modification of model. In addition, some problems like self-intersections can be introduced by roughly discretized edges. This stage is responsible for analysis of discrete model in order to detect and repair faced problems or refuse model’s part for further processing in case if problem cannot be solved;
* Preprocess discrete model: defines actions specific for implemented approach to be performed before meshing of faces. By default, iterates over model faces and checks consistency of existing triangulations. Cleans topological faces and its adjacent edges from polygonal data in case of inconsistency or marks face of discrete model as not required for computation;
* Discretize faces: represents core part performing mesh generation for particular face based on 2D discrete data related to processing face. Caches polygonal data associated with face’s edges in data model for further processing and stores generated mesh to TopoDS_Face;
* Postprocess discrete model: defines actions specific for implemented approach to be performed after meshing of faces. By default, stores polygonal data obtained on previous stage to TopoDS_Edge objects of source model.
Component is now spread over IMeshData, IMeshTools, BRepMeshData and BRepMesh units.
<!break>
1. Extend "tricheck" DRAW-command in order to find degenerated triangles.
2. Class BRepMesh_FastDiscret::Parameters has been declared as deprecated.
3. NURBS range splitter: do not split intervals without necessity. Intervals are split only in case if it is impossible to compute normals directly on intervals.
4. Default value of IMeshTools_Parameters::MinSize has been changed. New value is equal to 0.1*Deflection.
5. Correction of test scripts:
1) perf mesh bug27119: requested deflection is increased from 1e-6 to 1e-5 to keep reasonable performance (but still reproducing original issue)
2) bugs mesh bug26692_1, 2: make snapshot of triangulation instead of wireframe (irrelevant)
Correction in upgrade guide.
1) BRepMesh_FastDiscretFace.cxx:
- exclude planes from procedure of inserting internal points.
- localize declaration of the container aNewVertices in each method where it is needed.
- correct the logic of the method insertInternalVerticesOther, so that to separate the processes of removing extra points and addition of new points in different cycles, thus making the code more clear and in addition stable.
- insert useful output of intermediate mesh to a file in control() method for debug purposes (with definition DEBUG_MESH).
2) Add global functions MeshTest_DrawTriangles and MeshTest_DrawLinks to draw mesh data in debug session.
3) BRepMesh_FastDiscret:
- in the method Add calculations of deflections have been simplified for non-relative mode.
- replace the attribute MinDist with Deflection in EdgeAttributes structure. Correct its computation so that later to store this value as deflection of the polygon.
4) Make protection against exception in the method BRepMesh_Delaun::addTriangle() when an added triangle creates a third connection of a mesh edge.
5) BRepMesh_EdgeTessellator.cxx, BRepMesh_EdgeTessellationExtractor.cxx: use Geom2dAdaptor_Curve in order to use b-spline cache while computing value on a curve.
6) In BndLib_Box2dCurve::PerformBSpline, avoid creating new b-spline in case of requested parameter range differ from natural bounds insignificantly.
7) In GeomAdaptor classes, postpone building of cache till the time of its actual usage. So, creation of an adapter to compute intervals of continuity does not lead to creation of internal cache.
8) In the methods BRepAdaptor_Curve::Bezier and BSpline do not call Transformed() if transformation is identity.
9) In the classes Geom_BSplineCurve, Geom_BSplineSurface, Geom_BezierCurve, Geom_BezierSurface, Geom2d_BSplineCurve, Geom2d_BezierCurve change the method Pole() to return the point by const reference.
10) In CPnts_AbscissaPoint.cxx, compute derivative by D1 instead of DN to make use of b-spline cache.
11) Change test cases to actual state:
- Number of triangles/nodes can grow due to more accurate work with deflection of edges. Now the edge is tessellated using its own tolerance instead of maximal tolerance of all shapes in the face.
- Accept new numbers of mesh errors (free links, free nodes) for really bad shapes.
- Correct the test "bugs/mesh/bug25612" to produce stable result.
- Disable redundant checks in test cases bug25378* (lower limit for computation time).
- Speed up iso-lines computation for offset of bspline surfaces. For that use adaptor instead of original surface in evaluator of approximation.
- Add output of polylines for debug of insertInternalVerticesOther().
Reference data in test case bugs\moddata_2\bug453_3 have been changed to be close to expected theoretical values. This makes the test give stable result on different platforms.
Modification of algorithm in order to prevent violation of angular and curvature deflection condition for smooth intervals of curve.
Modification of algorithm for calculation of maximal deflection in command crvtpoints, crvpoints (CR25649)
Elementary bug fixing in algorithm GCPnts_UniformDeflection.gxx
Modification of test cases in order to set new reference parameters of shape triangulations
Some tests:
bugs modalg_2 bug397
mesh standard_incmesh C7, V3
mesh standard_incmesh_parallel C7, V3
mesh standard_mesh C7, V3
mesh standard_shading V3
were modified by TODO with reference bug 27226, because some problems in meshing algorithm (package BRepMesh) were discovered when tessellation of edges was changed. These problems cannot be solved by modification of GCPnts_TangentialDeflection algorithm. New issue #27226 was created, see bugtracker for details.
Correction of test data
Test case for issue #27108
Modification of algorithm for improving performance
Correction of test cases
Check deviation of normals at vertices of triangles for complex surface types different from Bezier and BSpline.
Modified test cased according to changes in BRepMesh.
Do not remove more intermediate parameters than N - 3 in order to have at least one parameter related to surface internals.
Check angle for angular deflection before removement of intermediate parameters.
Unify computation of internal vertices for complex surfaces.
Discretization points of edges are taken into account during computation of step of mesh grid.
Remove parameters only if they fit the constrains along the whole surface.
Do not add random internal parameters in case if their number is just 2.
Force freezing parameters both for U and V in case of significant control point.
Modified test cases
Warnings elimination in vc14.