mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-07-10 12:28:17 +08:00
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.
148 lines
6.4 KiB
C++
148 lines
6.4 KiB
C++
// Copyright (c) 2013 OPEN CASCADE SAS
|
|
//
|
|
// This file is part of Open CASCADE Technology software library.
|
|
//
|
|
// This library is free software; you can redistribute it and/or modify it under
|
|
// the terms of the GNU Lesser General Public License version 2.1 as published
|
|
// by the Free Software Foundation, with special exception defined in the file
|
|
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
|
// distribution for complete text of the license and disclaimer of any warranty.
|
|
//
|
|
// Alternatively, this file may be used under the terms of Open CASCADE
|
|
// commercial license or contractual agreement.
|
|
|
|
|
|
#ifndef _BRepMesh_ShapeTool_HeaderFile
|
|
#define _BRepMesh_ShapeTool_HeaderFile
|
|
|
|
#include <Standard.hxx>
|
|
#include <Standard_DefineAlloc.hxx>
|
|
#include <Standard_Macro.hxx>
|
|
#include <BRepAdaptor_HSurface.hxx>
|
|
#include <BRepMesh_FaceAttribute.hxx>
|
|
#include <BRepMesh.hxx>
|
|
|
|
class Poly_Triangulation;
|
|
class TopoDS_Face;
|
|
class TopoDS_Edge;
|
|
class Bnd_Box;
|
|
class TopoDS_Vertex;
|
|
class gp_XY;
|
|
class gp_Pnt2d;
|
|
|
|
class BRepMesh_ShapeTool
|
|
{
|
|
public:
|
|
|
|
DEFINE_STANDARD_ALLOC
|
|
|
|
//! Returns maximum tolerance of the given face.
|
|
//! Considers tolerances of edges and vertices contained in the given face.
|
|
Standard_EXPORT static Standard_Real MaxFaceTolerance(
|
|
const TopoDS_Face& theFace);
|
|
|
|
//! Gets the maximum dimension of the given bounding box.
|
|
//! If the given bounding box is void leaves the resulting value unchanged.
|
|
//! @param theBox bounding box to be processed.
|
|
//! @param theMaxDimension maximum dimension of the given box.
|
|
Standard_EXPORT static void BoxMaxDimension(const Bnd_Box& theBox,
|
|
Standard_Real& theMaxDimension);
|
|
|
|
//! Returns relative deflection for edge with respect to shape size.
|
|
//! @param theEdge edge for which relative deflection should be computed.
|
|
//! @param theDeflection absolute deflection.
|
|
//! @param theMaxShapeSize maximum size of a shape.
|
|
//! @param theAdjustmentCoefficient coefficient of adjustment between maximum
|
|
//! size of shape and calculated relative deflection.
|
|
//! @return relative deflection for the edge.
|
|
Standard_EXPORT static Standard_Real RelativeEdgeDeflection(
|
|
const TopoDS_Edge& theEdge,
|
|
const Standard_Real theDeflection,
|
|
const Standard_Real theMaxShapeSize,
|
|
Standard_Real& theAdjustmentCoefficient);
|
|
|
|
//! Checks 2d representations of 3d point with the
|
|
//! given index for equality to avoid duplications.
|
|
//! @param theIndexOfPnt3d index of 3d point with which 2d
|
|
//! representation should be associated.
|
|
//! @param thePnt2d 2d representation of the point with the
|
|
//! given index.
|
|
//! @param theMinDistance minimum distance between vertices
|
|
//! regarding which they could be treated as distinct ones.
|
|
//! @param theFaceAttribute attributes contining data calculated
|
|
//! according to face geomtry and define limits of face in parametric
|
|
//! space. If defined, will be used instead of surface parameter.
|
|
//! @param theLocation2dMap map of 2d representations of 3d points.
|
|
//! @return given 2d point in case if 3d poind does not alredy have
|
|
//! the similar representation, otherwice 2d point corresponding to
|
|
//! existing representation will be returned.
|
|
Standard_EXPORT static gp_XY FindUV(
|
|
const Standard_Integer theIndexOfPnt3d,
|
|
const gp_Pnt2d& thePnt2d,
|
|
const Standard_Real theMinDistance,
|
|
const Handle(BRepMesh_FaceAttribute)& theFaceAttribute);
|
|
|
|
//! Stores the given triangulation into the given face.
|
|
//! @param theFace face to be updated by triangulation.
|
|
//! @param theTriangulation triangulation to be stored into the face.
|
|
Standard_EXPORT static void AddInFace(
|
|
const TopoDS_Face& theFace,
|
|
Handle(Poly_Triangulation)& theTriangulation);
|
|
|
|
//! Nullifies triangulation stored in the face.
|
|
//! @param theFace face to be updated by null triangulation.
|
|
Standard_EXPORT static void NullifyFace(const TopoDS_Face& theFace);
|
|
|
|
//! Nullifies polygon on triangulation stored in the edge.
|
|
//! @param theEdge edge to be updated by null polygon.
|
|
//! @param theTriangulation triangulation the given edge is associated to.
|
|
//! @param theLocation face location.
|
|
Standard_EXPORT static void NullifyEdge(
|
|
const TopoDS_Edge& theEdge,
|
|
const Handle(Poly_Triangulation)& theTriangulation,
|
|
const TopLoc_Location& theLocation);
|
|
|
|
//! Updates the given edge by the given tessellated representation.
|
|
//! @param theEdge edge to be updated.
|
|
//! @param thePolygon tessellated representation of the edge to be stored.
|
|
//! @param theTriangulation triangulation the given edge is associated to.
|
|
//! @param theLocation face location.
|
|
Standard_EXPORT static void UpdateEdge(
|
|
const TopoDS_Edge& theEdge,
|
|
const Handle(Poly_PolygonOnTriangulation)& thePolygon,
|
|
const Handle(Poly_Triangulation)& theTriangulation,
|
|
const TopLoc_Location& theLocation);
|
|
|
|
//! Updates the given seam edge by the given tessellated representations.
|
|
//! @param theEdge edge to be updated.
|
|
//! @param thePolygon1 tessellated representation corresponding to
|
|
//! forward direction of the seam edge.
|
|
//! @param thePolygon2 tessellated representation corresponding to
|
|
//! reversed direction of the seam edge.
|
|
//! @param theTriangulation triangulation the given edge is associated to.
|
|
//! @param theLocation face location.
|
|
Standard_EXPORT static void UpdateEdge(
|
|
const TopoDS_Edge& theEdge,
|
|
const Handle(Poly_PolygonOnTriangulation)& thePolygon1,
|
|
const Handle(Poly_PolygonOnTriangulation)& thePolygon2,
|
|
const Handle(Poly_Triangulation)& theTriangulation,
|
|
const TopLoc_Location& theLocation);
|
|
|
|
//! Applies location to the given point and return result.
|
|
//! @param thePnt point to be transformed.
|
|
//! @param theLoc location to be applied.
|
|
Standard_EXPORT static gp_Pnt UseLocation(const gp_Pnt& thePnt,
|
|
const TopLoc_Location& theLoc);
|
|
|
|
//! Checks is the given edge degenerated.
|
|
//! Checks geometrical parameters in case if IsDegenerated flag is not set.
|
|
//! @param theEdge edge to be checked.
|
|
//! @param theFace face within which parametric space edge will be checked
|
|
//! for geometrical degenerativity.
|
|
Standard_EXPORT static Standard_Boolean IsDegenerated(
|
|
const TopoDS_Edge& theEdge,
|
|
const TopoDS_Face& theFace);
|
|
};
|
|
|
|
#endif
|