0020526: [CEA] Disk meshing fails
care of orientation of a sole edge in a wire
This commit is contained in:
parent
d5f1f4ce3a
commit
ef83ddd3eb
@ -39,6 +39,7 @@
|
|||||||
#include "StdMeshers_LengthFromEdges.hxx"
|
#include "StdMeshers_LengthFromEdges.hxx"
|
||||||
#include "StdMeshers_QuadranglePreference.hxx"
|
#include "StdMeshers_QuadranglePreference.hxx"
|
||||||
|
|
||||||
|
#include <Precision.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
|
|
||||||
@ -78,7 +79,7 @@ NETGENPlugin_NETGEN_2D_ONLY::NETGENPlugin_NETGEN_2D_ONLY(int hypId, int studyId,
|
|||||||
{
|
{
|
||||||
MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::NETGENPlugin_NETGEN_2D_ONLY");
|
MESSAGE("NETGENPlugin_NETGEN_2D_ONLY::NETGENPlugin_NETGEN_2D_ONLY");
|
||||||
_name = "NETGEN_2D_ONLY";
|
_name = "NETGEN_2D_ONLY";
|
||||||
|
|
||||||
_shapeType = (1 << TopAbs_FACE);// 1 bit /shape type
|
_shapeType = (1 << TopAbs_FACE);// 1 bit /shape type
|
||||||
|
|
||||||
_compatibleHypothesis.push_back("MaxElementArea");
|
_compatibleHypothesis.push_back("MaxElementArea");
|
||||||
@ -205,6 +206,10 @@ static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
|
|||||||
StdMeshers_FaceSidePtr wire = wires[ iW ];
|
StdMeshers_FaceSidePtr wire = wires[ iW ];
|
||||||
const vector<UVPtStruct>& uvPtVec = wire->GetUVPtStruct();
|
const vector<UVPtStruct>& uvPtVec = wire->GetUVPtStruct();
|
||||||
|
|
||||||
|
bool reverse = // 20526: [CEA] Disk meshing fails
|
||||||
|
( wire->NbEdges() == 1 &&
|
||||||
|
geom.emap(geom.emap.FindIndex(wire->Edge(0))).Orientation() == TopAbs_REVERSED );
|
||||||
|
|
||||||
int firstPointID = ngMesh.GetNP() + 1;
|
int firstPointID = ngMesh.GetNP() + 1;
|
||||||
int edgeID = 1, posID = -2;
|
int edgeID = 1, posID = -2;
|
||||||
for ( int i = 0; i < wire->NbSegments(); ++i ) // loop on segments
|
for ( int i = 0; i < wire->NbSegments(); ++i ) // loop on segments
|
||||||
@ -255,6 +260,14 @@ static TError AddSegmentsToMesh(netgen::Mesh& ngMesh,
|
|||||||
}
|
}
|
||||||
seg.epgeominfo[ iEnd ].edgenr = edgeID; // = geom.emap.FindIndex(edge);
|
seg.epgeominfo[ iEnd ].edgenr = edgeID; // = geom.emap.FindIndex(edge);
|
||||||
}
|
}
|
||||||
|
// 20526: [CEA] Disk meshing fails
|
||||||
|
if (reverse)
|
||||||
|
{
|
||||||
|
swap (seg.p1, seg.p2);
|
||||||
|
swap (seg.epgeominfo[0].dist, seg.epgeominfo[1].dist);
|
||||||
|
swap (seg.epgeominfo[0].u, seg.epgeominfo[1].u);
|
||||||
|
swap (seg.epgeominfo[0].v, seg.epgeominfo[1].v);
|
||||||
|
}
|
||||||
|
|
||||||
ngMesh.AddSegment (seg);
|
ngMesh.AddSegment (seg);
|
||||||
|
|
||||||
@ -364,7 +377,7 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
|
|||||||
// Generate surface mesh
|
// Generate surface mesh
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
||||||
char *optstr;
|
char *optstr = 0;
|
||||||
int startWith = MESHCONST_MESHSURFACE;
|
int startWith = MESHCONST_MESHSURFACE;
|
||||||
int endWith = MESHCONST_OPTSURFACE;
|
int endWith = MESHCONST_OPTSURFACE;
|
||||||
int err = 1;
|
int err = 1;
|
||||||
@ -442,3 +455,4 @@ bool NETGENPlugin_NETGEN_2D_ONLY::Compute(SMESH_Mesh& aMesh,
|
|||||||
|
|
||||||
return !err;
|
return !err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user