-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015 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
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <BRep_Tool.hxx>
#include <GCPnts_AbscissaPoint.hxx>
#include <Geom2dAdaptor_Curve.hxx>
+#include <Geom_Line.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopoDS.hxx>
myMissingVertexNodes = true;
// check if the edge has a non-uniform parametrization (issue 0020705)
- if ( !myC2d[i].IsNull() && myEdgeLength[i] > DBL_MIN)
+ if ( !myC2d[i].IsNull() )
{
- Geom2dAdaptor_Curve A2dC( myC2d[i],
- std::min( myFirst[i], myLast[i] ),
- std::max( myFirst[i], myLast[i] ));
- double p2 = myFirst[i]+(myLast[i]-myFirst[i])/2., p4 = myFirst[i]+(myLast[i]-myFirst[i])/4.;
- double d2 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p2 );
- double d4 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p4 );
- //cout<<"len = "<<len<<" d2 = "<<d2<<" fabs(2*d2/len-1.0) = "<<fabs(2*d2/len-1.0)<<endl;
- myIsUniform[i] = !( fabs(2*d2/myEdgeLength[i]-1.0) > 0.01 || fabs(2*d4/d2-1.0) > 0.01 );
- //if ( !myIsUniform[i] ) to implement Value3d(u)
+ if ( myEdgeLength[i] > DBL_MIN)
{
- double fp,lp;
- Handle(Geom_Curve) C3d = BRep_Tool::Curve(myEdge[i],fp,lp);
- myC3dAdaptor[i].Load( C3d, fp,lp );
+ Geom2dAdaptor_Curve A2dC( myC2d[i],
+ std::min( myFirst[i], myLast[i] ),
+ std::max( myFirst[i], myLast[i] ));
+ double p2 = myFirst[i]+(myLast[i]-myFirst[i])/2., p4 = myFirst[i]+(myLast[i]-myFirst[i])/4.;
+ double d2 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p2 );
+ double d4 = GCPnts_AbscissaPoint::Length( A2dC, myFirst[i], p4 );
+ //cout<<"len = "<<len<<" d2 = "<<d2<<" fabs(2*d2/len-1.0) = "<<fabs(2*d2/len-1.0)<<endl;
+ myIsUniform[i] = !( fabs(2*d2/myEdgeLength[i]-1.0) > 0.01 || fabs(2*d4/d2-1.0) > 0.01 );
+ Handle(Geom_Curve) C3d = BRep_Tool::Curve(myEdge[i],d2,d4);
+ myC3dAdaptor[i].Load( C3d, d2,d4 );
+ }
+ else
+ {
+ const TopoDS_Vertex& V = TopoDS::Vertex( vExp.Value() );
+ Handle(Geom_Curve) C3d = new Geom_Line( BRep_Tool::Pnt( V ), gp::DX() );
+ myC3dAdaptor[i].Load( C3d, 0, 0.5 * BRep_Tool::Tolerance( V ));
}
}
// reverse a proxy submesh
}
for ( size_t i = 0; i < myEdge.size(); ++i )
{
+ if ( myEdge[i].IsNull() ) continue; // for a side on points only
double fp,lp;
Handle(Geom_Curve) C3d = BRep_Tool::Curve(myEdge[i],fp,lp);
if ( !C3d.IsNull() )
double r = ( U - prevU )/ ( myNormPar[ i ] - prevU );
double par = myFirst[i] * ( 1 - r ) + myLast[i] * r;
-
+
// check parametrization of curve
if( !myIsUniform[i] )
{
SMESH_Mesh & theMesh,
const bool theIgnoreMediumNodes,
TError & theError,
- SMESH_ProxyMesh::Ptr theProxyMesh)
+ SMESH_ProxyMesh::Ptr theProxyMesh,
+ const bool theCheckVertexNodes)
{
list< TopoDS_Edge > edges, internalEdges;
list< int > nbEdgesInWires;
// as StdMeshers_FaceSide::GetUVPtStruct() requires
if ( wireEdges.front().Orientation() != TopAbs_INTERNAL ) // Issue 0020676
{
- while ( !SMESH_Algo::VertexNode( TopExp::FirstVertex( wireEdges.front(), true),
- theMesh.GetMeshDS()))
- {
- wireEdges.splice(wireEdges.end(), wireEdges,
- wireEdges.begin(), ++wireEdges.begin());
- if ( from->IsSame( wireEdges.front() )) {
- theError = TError
- ( new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,"No nodes on vertices"));
- return TSideVector(0);
+ if ( theCheckVertexNodes )
+ while ( !SMESH_Algo::VertexNode( TopExp::FirstVertex( wireEdges.front(), true),
+ theMesh.GetMeshDS()))
+ {
+ wireEdges.splice(wireEdges.end(), wireEdges,
+ wireEdges.begin(), ++wireEdges.begin());
+ if ( from->IsSame( wireEdges.front() )) {
+ theError = TError
+ ( new SMESH_ComputeError(COMPERR_BAD_INPUT_MESH,"No nodes on vertices"));
+ return TSideVector(0);
+ }
}
- }
}
else if ( *nbE > 1 ) // Issue 0020676 (Face_pb_netgen.brep) - several internal edges in a wire
{