//purpose :
//=======================================================================
BRepMesh_FastDiscret::BRepMesh_FastDiscret(
- const Standard_Real theDefle,
- const Standard_Real theAngl,
- const Bnd_Box& theBox,
- const Standard_Boolean theWithShare,
- const Standard_Boolean theInshape,
- const Standard_Boolean theRelative,
- const Standard_Boolean theShapetrigu,
- const Standard_Boolean isInParallel,
- const Standard_Real theMinSize,
- const Standard_Boolean isInternalVerticesMode)
+ const Standard_Real theDefle,
+ const Standard_Real theAngl,
+ const Bnd_Box& theBox,
+ const Standard_Boolean theWithShare,
+ const Standard_Boolean theInshape,
+ const Standard_Boolean theRelative,
+ const Standard_Boolean theShapetrigu,
+ const Standard_Boolean isInParallel,
+ const Standard_Real theMinSize,
+ const Standard_Boolean isInternalVerticesMode,
+ const Standard_Boolean isControlSurfaceDeflection)
: myAngle (theAngl),
myDeflection (theDefle),
myWithShare (theWithShare),
myBoundaryVertices(new BRepMesh::DMapOfVertexInteger),
myBoundaryPoints(new BRepMesh::DMapOfIntegerPnt),
myMinSize(theMinSize),
- myInternalVerticesMode(isInternalVerticesMode)
+ myInternalVerticesMode(isInternalVerticesMode),
+ myIsControlSurfaceDeflection(isControlSurfaceDeflection)
{
if ( myRelative )
BRepMesh_ShapeTool::BoxMaxDimension(theBox, myDtotale);
const Standard_Boolean theShapetrigu,
const Standard_Boolean isInParallel,
const Standard_Real theMinSize,
- const Standard_Boolean isInternalVerticesMode)
+ const Standard_Boolean isInternalVerticesMode,
+ const Standard_Boolean isControlSurfaceDeflection)
: myAngle (theAngl),
myDeflection (theDefle),
myWithShare (theWithShare),
myBoundaryVertices(new BRepMesh::DMapOfVertexInteger),
myBoundaryPoints(new BRepMesh::DMapOfIntegerPnt),
myMinSize(theMinSize),
- myInternalVerticesMode(isInternalVerticesMode)
+ myInternalVerticesMode(isInternalVerticesMode),
+ myIsControlSurfaceDeflection(isControlSurfaceDeflection)
{
if ( myRelative )
BRepMesh_ShapeTool::BoxMaxDimension(theBox, myDtotale);
{
OCC_CATCH_SIGNALS
- BRepMesh_FastDiscretFace aTool(GetAngle(), myMinSize, myInternalVerticesMode);
+ BRepMesh_FastDiscretFace aTool(GetAngle(), myMinSize,
+ myInternalVerticesMode, myIsControlSurfaceDeflection);
aTool.Perform(anAttribute);
}
catch (Standard_Failure)
{
public:
- Standard_EXPORT BRepMesh_FastDiscret(const Standard_Real defle,
- const Standard_Real angle,
- const Bnd_Box& B,
- const Standard_Boolean withShare = Standard_True,
- const Standard_Boolean inshape = Standard_False,
- const Standard_Boolean relative = Standard_False,
- const Standard_Boolean shapetrigu = Standard_False,
- const Standard_Boolean isInParallel = Standard_False,
- const Standard_Real theMinSize = Precision::Confusion(),
- const Standard_Boolean isInternalVerticesMode = Standard_True);
+ Standard_EXPORT BRepMesh_FastDiscret(
+ const Standard_Real defle,
+ const Standard_Real angle,
+ const Bnd_Box& B,
+ const Standard_Boolean withShare = Standard_True,
+ const Standard_Boolean inshape = Standard_False,
+ const Standard_Boolean relative = Standard_False,
+ const Standard_Boolean shapetrigu = Standard_False,
+ const Standard_Boolean isInParallel = Standard_False,
+ const Standard_Real theMinSize = Precision::Confusion(),
+ const Standard_Boolean isInternalVerticesMode = Standard_True,
+ const Standard_Boolean isControlSurfaceDeflection = Standard_True);
//! if the boolean <relative> is True, the <br>
//! deflection used for the polygonalisation of <br>
//! <br>
//! if <inshape> is True, the calculated <br>
//! triangulation will be stored in the shape. <br>
- Standard_EXPORT BRepMesh_FastDiscret(const TopoDS_Shape& shape,
- const Standard_Real defle,
- const Standard_Real angle,
- const Bnd_Box& B,
- const Standard_Boolean withShare = Standard_True,
- const Standard_Boolean inshape = Standard_False,
- const Standard_Boolean relative = Standard_False,
- const Standard_Boolean shapetrigu = Standard_False,
- const Standard_Boolean isInParallel = Standard_False,
- const Standard_Real theMinSize = Precision::Confusion(),
- const Standard_Boolean isInternalVerticesMode = Standard_True);
+ Standard_EXPORT BRepMesh_FastDiscret(
+ const TopoDS_Shape& shape,
+ const Standard_Real defle,
+ const Standard_Real angle,
+ const Bnd_Box& B,
+ const Standard_Boolean withShare = Standard_True,
+ const Standard_Boolean inshape = Standard_False,
+ const Standard_Boolean relative = Standard_False,
+ const Standard_Boolean shapetrigu = Standard_False,
+ const Standard_Boolean isInParallel = Standard_False,
+ const Standard_Real theMinSize = Precision::Confusion(),
+ const Standard_Boolean isInternalVerticesMode = Standard_True,
+ const Standard_Boolean isControlSurfaceDeflection = Standard_True);
//! Build triangulation on the whole shape.
Standard_EXPORT void Perform(const TopoDS_Shape& shape);
Standard_Real myMinSize;
Standard_Boolean myInternalVerticesMode;
+ Standard_Boolean myIsControlSurfaceDeflection;
};
DEFINE_STANDARD_HANDLE(BRepMesh_FastDiscret, Standard_Transient)
BRepMesh_FastDiscretFace::BRepMesh_FastDiscretFace(
const Standard_Real theAngle,
const Standard_Real theMinSize,
- const Standard_Boolean isInternalVerticesMode)
+ const Standard_Boolean isInternalVerticesMode,
+ const Standard_Boolean isControlSurfaceDeflection)
: myAngle(theAngle),
myInternalVerticesMode(isInternalVerticesMode),
- myMinSize(theMinSize)
+ myMinSize(theMinSize),
+ myIsControlSurfaceDeflection(isControlSurfaceDeflection)
{
}
insertInternalVertices(aNewVertices, trigu);
//control internal points
- aDef = control(aNewVertices, trigu, Standard_False);
+ if (myIsControlSurfaceDeflection)
+ aDef = control(aNewVertices, trigu, Standard_False);
}
}
//! @param theAngle deviation angle to be used for surface tessellation.
//! @param isInternalVerticesMode flag enabling/disabling internal
//! vertices mode.
+ //! @param isControlSurfaceDeflection enables/disables adaptive
+ //! reconfiguration of mesh.
Standard_EXPORT BRepMesh_FastDiscretFace(
const Standard_Real theAngle,
const Standard_Real theMinSize,
- const Standard_Boolean isInternalVerticesMode);
+ const Standard_Boolean isInternalVerticesMode,
+ const Standard_Boolean isControlSurfaceDeflection);
Standard_EXPORT void Perform(const Handle(BRepMesh_FaceAttribute)& theAttribute);
Handle(BRepMesh_DataStructureOfDelaun) myStructure;
Standard_Real myMinSize;
+ Standard_Boolean myIsControlSurfaceDeflection;
};
DEFINE_STANDARD_HANDLE (BRepMesh_FastDiscretFace, Standard_Transient)
: myRelative (Standard_False),
myInParallel(Standard_False),
myMinSize (Precision::Confusion()),
- myInternalVerticesMode(Standard_True)
+ myInternalVerticesMode(Standard_True),
+ myIsControlSurfaceDeflection(Standard_True)
{
}
: myRelative (isRelative),
myInParallel(isInParallel),
myMinSize (Precision::Confusion()),
- myInternalVerticesMode(Standard_True)
+ myInternalVerticesMode(Standard_True),
+ myIsControlSurfaceDeflection(Standard_True)
{
myDeflection = theLinDeflection;
myAngle = theAngDeflection;
myMesh = new BRepMesh_FastDiscret(myDeflection,
myAngle, aBox, Standard_True, Standard_True,
myRelative, Standard_True, myInParallel, myMinSize,
- myInternalVerticesMode);
+ myInternalVerticesMode, myIsControlSurfaceDeflection);
myMesh->InitSharedFaces(myShape);
}
return myMinSize;
}
- //! Enables/disables internal vertices mode.
+ //! Enables/disables internal vertices mode (enabled by default).
inline void SetInternalVerticesMode(const Standard_Boolean isEnabled)
{
myInternalVerticesMode = isEnabled;
return myInternalVerticesMode;
}
+ //! Enables/disables control of deflection of mesh from real surface
+ //! (enabled by default).
+ inline void SetControlSurfaceDeflection(const Standard_Boolean isEnabled)
+ {
+ myIsControlSurfaceDeflection = isEnabled;
+ }
+
+ //! Returns flag indicating is adaptive reconfiguration
+ //! of mesh enabled/disabled.
+ inline Standard_Boolean IsControlSurfaceDeflection() const
+ {
+ return myIsControlSurfaceDeflection;
+ }
+
public: //! @name plugin API
//! Plugin interface for the Mesh Factories.
NCollection_Vector<TopoDS_Face> myFaces;
Standard_Real myMinSize;
Standard_Boolean myInternalVerticesMode;
+ Standard_Boolean myIsControlSurfaceDeflection;
};
DEFINE_STANDARD_HANDLE(BRepMesh_IncrementalMesh,BRepMesh_DiscretRoot)
(switched off by default)\n\n\
-int_vert_off disables insertion of internal vertices into mesh\n\
(enabled by default)\n\
+ -surf_def_off disables control of deflection of mesh from real\n\
+ surface (enabled by default)\n\
-parallel enables parallel execution (switched off by default)\n";
return 0;
}
return 0;
}
- Standard_Real aLinDeflection = Max(Draw::Atof(argv[2]), Precision::Confusion());
- Standard_Real aAngDeflection = 0.5;
- Standard_Real aMinSize = Precision::Confusion();
- Standard_Boolean isRelative = Standard_False;
- Standard_Boolean isInParallel = Standard_False;
- Standard_Boolean isIntVertices = Standard_True;
+ Standard_Real aLinDeflection = Max(Draw::Atof(argv[2]), Precision::Confusion());
+ Standard_Real aAngDeflection = 0.5;
+ Standard_Real aMinSize = Precision::Confusion();
+ Standard_Boolean isRelative = Standard_False;
+ Standard_Boolean isInParallel = Standard_False;
+ Standard_Boolean isIntVertices = Standard_True;
+ Standard_Boolean isControlSurDef = Standard_True;
if (nbarg > 3)
{
isInParallel = Standard_True;
else if (aOpt == "-int_vert_off")
isIntVertices = Standard_False;
+ else if (aOpt == "-surf_def_off")
+ isControlSurDef = Standard_False;
else if (i < nbarg)
{
Standard_Real aVal = Draw::Atof(argv[i++]);
aMesher.SetParallel (isInParallel);
aMesher.SetMinSize (aMinSize);
aMesher.SetInternalVerticesMode(isIntVertices);
+ aMesher.SetControlSurfaceDeflection(isControlSurDef);
aMesher.Perform();
di << "Meshing statuses: ";
--- /dev/null
+puts "========"
+puts "OCC25612"
+puts "========"
+puts ""
+######################################################################################
+# Introduce possibility to disable adaptive reconfigutation of triangles in BRepMesh
+######################################################################################
+
+restore [locate_data_file bug25519_testtriangulation.brep] a
+
+tclean a
+incmesh a 0.001
+set bug_info [trinfo a]
+set TNumber_1 [lindex $bug_info 3]
+set NNumber_1 [lindex $bug_info 5]
+
+tclean a
+incmesh a 0.001 -surf_def_off
+set bug_info [trinfo a]
+set TNumber_2 [lindex $bug_info 3]
+set NNumber_2 [lindex $bug_info 5]
+
+if {$TNumber_2 >= $TNumber_1} {
+ puts "ERROR: OCC25612 is reproduced. Flag -surf_def_off does not work (triangles)."
+}
+
+if {$NNumber_2 >= $NNumber_1} {
+ puts "ERROR: OCC25612 is reproduced. Flag -surf_def_off does not work (nodes)."
+}