23304: [EDF 10304] Radial Quadrangle on ellipse

This commit is contained in:
eap 2016-07-28 19:16:32 +03:00
parent 00971639b0
commit 1cea009185
6 changed files with 840 additions and 944 deletions

View File

@ -3,20 +3,26 @@
\page radial_quadrangle_1D2D_algo_page Radial Quadrangle 1D2D
\n This algorithm applies to the meshing of 2D shapes under the
following conditions: the face must be a full circle or a part of circle
(i.e. the number of edges is less or equal to 3 and one of them is a circle curve).
following conditions: the face must be a full ellipse or a part of ellipse
(i.e. the number of edges is less or equal to 3 and one of them is an ellipse curve).
The resulting mesh consists of triangles (near the center point) and
quadrangles.
This algorithm is optionally parametrized by the hypothesis indicating the number
of mesh layers along the radius. The distribution of layers can be set with any 1D Hypothesis.
This algorithm is optionally parametrized by the hypothesis indicating
the number of mesh layers along the radius. The distribution of layers
can be set with any 1D Hypothesis. If the face boundary includes
radial edges, this distribution is applied to the longest radial
edge. If the face boundary does not include radial edges, this
distribution is applied to the longest virtual radial edge. The
distribution is applied to the longest radial edge starting from its
end lying on the elliptic curve.
If no own hypothesis of the algorithm is assigned, any local or global hypothesis is used
by the algorithm to discretize edges. Note that if the geometrical face has two radial edges,
they must be meshed with equal number of segments.
If no 1D hypothesis is assigned to an edge, "Default Number of Segments" preferences parameter
is used to discretize the edge.
If no own hypothesis of the algorithm is assigned, any local or global
hypothesis is used by the algorithm to discretize edges.
If no 1D hypothesis is assigned to an edge, "Default Number of
Segments" preferences parameter is used to discretize the edge.
\image html hypo_radquad_dlg.png

View File

@ -195,12 +195,14 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const StdMeshers_FaceSide* theSide,
const double theUFirst,
const double theULast)
{
myEdge.resize ( 1 );
myEdgeID.resize ( 1, 0 );
myC2d.push_back ( theC2d );
myC3dAdaptor.resize ( 1 );
myFirst.push_back ( theUFirst );
myLast.push_back ( theULast );
myNormPar.push_back ( 1. );
myIsUniform.push_back( true );
myEdgeID.push_back ( 0 );
myLength = 0;
myProxyMesh = theSide->myProxyMesh;
myDefaultPnt2d = *thePnt2d1;
@ -324,7 +326,6 @@ const std::vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXCons
if ( NbEdges() == 0 ) return myPoints;
StdMeshers_FaceSide* me = const_cast< StdMeshers_FaceSide* >( this );
//SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
fHelper.SetSubShape( myFace );
@ -429,17 +430,19 @@ const std::vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXCons
else
{
node = VertexNode( iE );
while ( !node && iE > 0 )
node = VertexNode( --iE );
if ( !node )
return myPoints;
if ( myProxyMesh->GetMesh()->HasModificationsToDiscard() )
while ( !node && iE > 1 ) // check intermediate VERTEXes
node = VertexNode( --iE );
}
if ( u2node.rbegin()->second == node &&
!fHelper.IsRealSeam ( node->getshapeId() ) &&
!fHelper.IsDegenShape( node->getshapeId() ))
u2node.erase( --u2node.end() );
if ( node )
{
if ( u2node.rbegin()->second == node &&
!fHelper.IsRealSeam ( node->getshapeId() ) &&
!fHelper.IsDegenShape( node->getshapeId() ))
u2node.erase( --u2node.end() );
u2node.insert( u2node.end(), make_pair( 1., node ));
u2node.insert( u2node.end(), make_pair( 1., node ));
}
}
if ((int) u2node.size() + nbProxyNodes != myNbPonits &&

View File

@ -215,10 +215,14 @@ public:
*/
const SMDS_MeshNode* VertexNode(std::size_t i, bool* isMoved = 0) const;
/*!
/*
* \brief Return edge and parameter on edge by normalized parameter
*/
inline double Parameter(double U, TopoDS_Edge & edge) const;
/*
* \brief Return edge ID and parameter on edge by normalized parameter
*/
inline double Parameter(double U, int & edgeID) const;
/*!
* \brief Return UV by normalized parameter
*/
@ -351,9 +355,11 @@ inline int StdMeshers_FaceSide::EdgeIndex( double U ) const
//================================================================================
/*!
* \brief Return edge and parameter on edge by normalized parameter
* \param U - the parameter
* \brief Return an edge and parameter on the edge by a normalized parameter
* \param U - normalized parameter
* \retval double - pameter on a curve
* \ warning The returned parameter can be inaccurate if the edge is non-uniformly
* parametrized. Use Value2d() to get a precise point on the edge
*/
//================================================================================
@ -366,6 +372,25 @@ inline double StdMeshers_FaceSide::Parameter(double U, TopoDS_Edge & edge) const
return myFirst[i] * ( 1 - r ) + myLast[i] * r;
}
//================================================================================
/*!
* \brief Return an edge ID and parameter on the edge by a normalized parameter
* \param U - normalized parameter
* \retval double - pameter on a curve
* \ warning The returned parameter can be inaccurate if the edge is non-uniformly
* parametrized. Use Value2d() to get a precise point on the edge
*/
//================================================================================
inline double StdMeshers_FaceSide::Parameter(double U, int & edgeID) const
{
int i = EdgeIndex( U );
edgeID = myEdgeID[ i ];
double prevU = i ? myNormPar[ i-1 ] : 0;
double r = ( U - prevU )/ ( myNormPar[ i ] - prevU );
return myFirst[i] * ( 1 - r ) + myLast[i] * r;
}
//================================================================================
/*!
* \brief Return first normalized parameter of the i-th edge

View File

@ -122,7 +122,7 @@ public:
if ( !StdMeshers_Regular_1D::computeInternalParameters( mesh, C3D, len, f, l, theParams, false))
{
for ( size_t i = 1; i < 15; ++i )
theParams.push_back( i/15 );
theParams.push_back( i/15. ); // ????
}
else
{
@ -1561,7 +1561,7 @@ namespace
uvsNew.push_back( uvPt );
for (list<double>::iterator itU = params.begin(); itU != params.end(); ++itU )
{
gp_XY uv = ( 1 - *itU ) * uvOut + *itU * uvIn;
gp_XY uv = ( 1 - *itU ) * uvOut + *itU * uvIn; // applied in direction Out -> In
gp_Pnt p = surface->Value( uv.X(), uv.Y() );
uvPt.node = theHelper.AddNode( p.X(), p.Y(), p.Z(), /*id=*/0, uv.X(), uv.Y() );
uvPt.u = uv.X();

File diff suppressed because it is too large Load Diff

View File

@ -24,20 +24,19 @@
#ifndef _SMESH_RadialQuadrangle_1D2D_HXX_
#define _SMESH_RadialQuadrangle_1D2D_HXX_
#include "SMESH_StdMeshers.hxx"
#include "SMESH_Algo.hxx"
#include <TopoDS_Edge.hxx>
#include "StdMeshers_Quadrangle_2D.hxx"
#include <vector>
class StdMeshers_NumberOfLayers;
class StdMeshers_LayerDistribution;
class SMESH_MesherHelper;
class gp_Pnt;
class STDMESHERS_EXPORT StdMeshers_RadialQuadrangle_1D2D: public SMESH_2D_Algo
/*!
* \brief Algorithm generating quadrangles on a full or a part of an elliptic face.
* Elements around an ellipse center are triangles.
*/
class STDMESHERS_EXPORT StdMeshers_RadialQuadrangle_1D2D: public StdMeshers_Quadrangle_2D
{
public:
StdMeshers_RadialQuadrangle_1D2D(int hypId, int studyId, SMESH_Gen* gen);
@ -63,16 +62,14 @@ public:
protected:
bool computeLayerPositions(const gp_Pnt& p1,
const gp_Pnt& p2,
const TopoDS_Edge& linEdge=TopoDS_Edge(),
bool* linEdgeComputed = 0);
int computeLayerPositions(StdMeshers_FaceSidePtr linSide,
std::vector< double >& positions,
int* nbEdgesComputed = 0,
bool useHalf = false);
const StdMeshers_NumberOfLayers* myNbLayerHypo;
const StdMeshers_LayerDistribution* myDistributionHypo;
SMESH_MesherHelper* myHelper;
std::vector< double > myLayerPositions;
};
#endif