mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-27 16:20:32 +05:00
23304: [EDF 10304] Radial Quadrangle on ellipse
This commit is contained in:
parent
00971639b0
commit
1cea009185
@ -3,20 +3,26 @@
|
|||||||
\page radial_quadrangle_1D2D_algo_page Radial Quadrangle 1D2D
|
\page radial_quadrangle_1D2D_algo_page Radial Quadrangle 1D2D
|
||||||
|
|
||||||
\n This algorithm applies to the meshing of 2D shapes under the
|
\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
|
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 a circle curve).
|
(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
|
The resulting mesh consists of triangles (near the center point) and
|
||||||
quadrangles.
|
quadrangles.
|
||||||
|
|
||||||
This algorithm is optionally parametrized by the hypothesis indicating the number
|
This algorithm is optionally parametrized by the hypothesis indicating
|
||||||
of mesh layers along the radius. The distribution of layers can be set with any 1D Hypothesis.
|
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
|
If no own hypothesis of the algorithm is assigned, any local or global
|
||||||
is used to discretize the edge.
|
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
|
\image html hypo_radquad_dlg.png
|
||||||
|
|
||||||
|
@ -195,12 +195,14 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const StdMeshers_FaceSide* theSide,
|
|||||||
const double theUFirst,
|
const double theUFirst,
|
||||||
const double theULast)
|
const double theULast)
|
||||||
{
|
{
|
||||||
|
myEdge.resize ( 1 );
|
||||||
|
myEdgeID.resize ( 1, 0 );
|
||||||
myC2d.push_back ( theC2d );
|
myC2d.push_back ( theC2d );
|
||||||
|
myC3dAdaptor.resize ( 1 );
|
||||||
myFirst.push_back ( theUFirst );
|
myFirst.push_back ( theUFirst );
|
||||||
myLast.push_back ( theULast );
|
myLast.push_back ( theULast );
|
||||||
myNormPar.push_back ( 1. );
|
myNormPar.push_back ( 1. );
|
||||||
myIsUniform.push_back( true );
|
myIsUniform.push_back( true );
|
||||||
myEdgeID.push_back ( 0 );
|
|
||||||
myLength = 0;
|
myLength = 0;
|
||||||
myProxyMesh = theSide->myProxyMesh;
|
myProxyMesh = theSide->myProxyMesh;
|
||||||
myDefaultPnt2d = *thePnt2d1;
|
myDefaultPnt2d = *thePnt2d1;
|
||||||
@ -324,7 +326,6 @@ const std::vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXCons
|
|||||||
if ( NbEdges() == 0 ) return myPoints;
|
if ( NbEdges() == 0 ) return myPoints;
|
||||||
|
|
||||||
StdMeshers_FaceSide* me = const_cast< StdMeshers_FaceSide* >( this );
|
StdMeshers_FaceSide* me = const_cast< StdMeshers_FaceSide* >( this );
|
||||||
//SMESHDS_Mesh* meshDS = myProxyMesh->GetMeshDS();
|
|
||||||
SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
|
SMESH_MesherHelper eHelper( *myProxyMesh->GetMesh() );
|
||||||
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
|
SMESH_MesherHelper fHelper( *myProxyMesh->GetMesh() );
|
||||||
fHelper.SetSubShape( myFace );
|
fHelper.SetSubShape( myFace );
|
||||||
@ -429,17 +430,19 @@ const std::vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool isXCons
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
node = VertexNode( iE );
|
node = VertexNode( iE );
|
||||||
while ( !node && iE > 0 )
|
if ( myProxyMesh->GetMesh()->HasModificationsToDiscard() )
|
||||||
node = VertexNode( --iE );
|
while ( !node && iE > 1 ) // check intermediate VERTEXes
|
||||||
if ( !node )
|
node = VertexNode( --iE );
|
||||||
return myPoints;
|
|
||||||
}
|
}
|
||||||
if ( u2node.rbegin()->second == node &&
|
if ( node )
|
||||||
!fHelper.IsRealSeam ( node->getshapeId() ) &&
|
{
|
||||||
!fHelper.IsDegenShape( node->getshapeId() ))
|
if ( u2node.rbegin()->second == node &&
|
||||||
u2node.erase( --u2node.end() );
|
!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 &&
|
if ((int) u2node.size() + nbProxyNodes != myNbPonits &&
|
||||||
|
@ -215,10 +215,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
const SMDS_MeshNode* VertexNode(std::size_t i, bool* isMoved = 0) const;
|
const SMDS_MeshNode* VertexNode(std::size_t i, bool* isMoved = 0) const;
|
||||||
|
|
||||||
/*!
|
/*
|
||||||
* \brief Return edge and parameter on edge by normalized parameter
|
* \brief Return edge and parameter on edge by normalized parameter
|
||||||
*/
|
*/
|
||||||
inline double Parameter(double U, TopoDS_Edge & edge) const;
|
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
|
* \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
|
* \brief Return an edge and parameter on the edge by a normalized parameter
|
||||||
* \param U - the parameter
|
* \param U - normalized parameter
|
||||||
* \retval double - pameter on a curve
|
* \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;
|
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
|
* \brief Return first normalized parameter of the i-th edge
|
||||||
|
@ -122,7 +122,7 @@ public:
|
|||||||
if ( !StdMeshers_Regular_1D::computeInternalParameters( mesh, C3D, len, f, l, theParams, false))
|
if ( !StdMeshers_Regular_1D::computeInternalParameters( mesh, C3D, len, f, l, theParams, false))
|
||||||
{
|
{
|
||||||
for ( size_t i = 1; i < 15; ++i )
|
for ( size_t i = 1; i < 15; ++i )
|
||||||
theParams.push_back( i/15 );
|
theParams.push_back( i/15. ); // ????
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1561,7 +1561,7 @@ namespace
|
|||||||
uvsNew.push_back( uvPt );
|
uvsNew.push_back( uvPt );
|
||||||
for (list<double>::iterator itU = params.begin(); itU != params.end(); ++itU )
|
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() );
|
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.node = theHelper.AddNode( p.X(), p.Y(), p.Z(), /*id=*/0, uv.X(), uv.Y() );
|
||||||
uvPt.u = uv.X();
|
uvPt.u = uv.X();
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -24,20 +24,19 @@
|
|||||||
#ifndef _SMESH_RadialQuadrangle_1D2D_HXX_
|
#ifndef _SMESH_RadialQuadrangle_1D2D_HXX_
|
||||||
#define _SMESH_RadialQuadrangle_1D2D_HXX_
|
#define _SMESH_RadialQuadrangle_1D2D_HXX_
|
||||||
|
|
||||||
#include "SMESH_StdMeshers.hxx"
|
#include "StdMeshers_Quadrangle_2D.hxx"
|
||||||
|
|
||||||
#include "SMESH_Algo.hxx"
|
|
||||||
|
|
||||||
#include <TopoDS_Edge.hxx>
|
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
class StdMeshers_NumberOfLayers;
|
class StdMeshers_NumberOfLayers;
|
||||||
class StdMeshers_LayerDistribution;
|
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:
|
public:
|
||||||
StdMeshers_RadialQuadrangle_1D2D(int hypId, int studyId, SMESH_Gen* gen);
|
StdMeshers_RadialQuadrangle_1D2D(int hypId, int studyId, SMESH_Gen* gen);
|
||||||
@ -63,16 +62,14 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
bool computeLayerPositions(const gp_Pnt& p1,
|
int computeLayerPositions(StdMeshers_FaceSidePtr linSide,
|
||||||
const gp_Pnt& p2,
|
std::vector< double >& positions,
|
||||||
const TopoDS_Edge& linEdge=TopoDS_Edge(),
|
int* nbEdgesComputed = 0,
|
||||||
bool* linEdgeComputed = 0);
|
bool useHalf = false);
|
||||||
|
|
||||||
|
|
||||||
const StdMeshers_NumberOfLayers* myNbLayerHypo;
|
const StdMeshers_NumberOfLayers* myNbLayerHypo;
|
||||||
const StdMeshers_LayerDistribution* myDistributionHypo;
|
const StdMeshers_LayerDistribution* myDistributionHypo;
|
||||||
SMESH_MesherHelper* myHelper;
|
|
||||||
std::vector< double > myLayerPositions;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user