-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
start.SetCoord( iParam, sumParam / 4.);
}
if ( needGrid ) {
- // compute nodes of 3 x 3 x 3 grid
+ // compute nodes of 10 x 10 x 10 grid
int iNode = 0;
Bnd_Box box;
- for ( double x = 0.25; x < 0.9; x += 0.25 )
- for ( double y = 0.25; y < 0.9; y += 0.25 )
- for ( double z = 0.25; z < 0.9; z += 0.25 ) {
+ for ( double x = 0.05; x < 1.; x += 0.1 )
+ for ( double y = 0.05; y < 1.; y += 0.1 )
+ for ( double z = 0.05; z < 1.; z += 0.1 ) {
TxyzPair & prmPtn = my3x3x3GridNodes[ iNode++ ];
prmPtn.first.SetCoord( x, y, z );
ShellPoint( prmPtn.first, prmPtn.second );
{
double minDist = DBL_MAX;
gp_XYZ* bestParam = 0;
- for ( int iNode = 0; iNode < 27; iNode++ ) {
+ for ( int iNode = 0; iNode < 1000; iNode++ ) {
TxyzPair & prmPtn = my3x3x3GridNodes[ iNode ];
double dist = ( thePoint.XYZ() - prmPtn.second ).SquareModulus();
if ( dist < minDist ) {
<< " ------ NB IT: " << myNbIterations << ", SUM DIST: " << mySumDist );
#endif
+ const double reachedDist = sqrt( sqDistance );
+ if ( reachedDist > 1000 * myTolerance &&
+ computeParameters( thePoint, theParams, solution ) &&
+ reachedDist > distance() )
+ return true;
+
theParams = solution;
if ( myFaceIndex > 0 )
/*!
* \brief Return number of wires and a list of oredered edges.
* \param theFace - the face to process
- * \param theFirstVertex - the vertex of the outer wire to set first in the returned
- * list ( theFirstVertex may be NULL )
* \param theEdges - all ordered edges of theFace (outer edges goes first).
* \param theNbEdgesInWires - nb of edges (== nb of vertices in closed wire) in each wire
+ * \param theFirstVertex - the vertex of the outer wire to set first in the returned
+ * list ( theFirstVertex may be NULL )
* \param theShapeAnalysisAlgo - if true, ShapeAnalysis::OuterWire() is used to find
* the outer wire else BRepTools::OuterWire() is used.
* \retval int - nb of wires
//================================================================================
int SMESH_Block::GetOrderedEdges (const TopoDS_Face& theFace,
- TopoDS_Vertex theFirstVertex,
list< TopoDS_Edge >& theEdges,
list< int > & theNbEdgesInWires,
+ TopoDS_Vertex theFirstVertex,
const bool theShapeAnalysisAlgo)
{
// put wires in a list, so that an outer wire comes first
// find bottom edges and veritices
list< TopoDS_Edge > eList;
list< int > nbVertexInWires;
- GetOrderedEdges( TopoDS::Face( Fxy0 ), TopoDS::Vertex( V000 ), eList, nbVertexInWires );
+ GetOrderedEdges( TopoDS::Face( Fxy0 ), eList, nbVertexInWires, TopoDS::Vertex( V000 ) );
if ( nbVertexInWires.size() != 1 || nbVertexInWires.front() != 4 ) {
MESSAGE(" LoadBlockShapes() error ");
return false;
// find top edges and veritices
eList.clear();
- GetOrderedEdges( TopoDS::Face( Fxy1 ), TopoDS::Vertex( V001 ), eList, nbVertexInWires );
+ GetOrderedEdges( TopoDS::Face( Fxy1 ), eList, nbVertexInWires, TopoDS::Vertex( V001 ) );
if ( nbVertexInWires.size() != 1 || nbVertexInWires.front() != 4 ) {
MESSAGE(" LoadBlockShapes() error ");
return false;