second order elements with STL

This commit is contained in:
Joachim Schoeberl 2013-11-18 09:16:11 +00:00
parent 58cfeebca8
commit f82ea24a8a
3 changed files with 17 additions and 4 deletions

View File

@ -41,6 +41,7 @@ void STLMeshing (STLGeometry & geom,
lineendpoints(), spiralpoints(), selectedmultiedge()
*/
{
ref = NULL;
edgedata = new STLEdgeDataList(*this);
externaledges.SetSize(0);
Clear();
@ -61,6 +62,7 @@ void STLMeshing (STLGeometry & geom,
STLGeometry :: ~STLGeometry()
{
delete edgedata;
delete ref;
}
void STLGeometry :: Save (string filename) const
@ -98,7 +100,11 @@ int STLGeometry :: GenerateMesh (Mesh*& mesh, MeshingParameters & mparam,
const Refinement & STLGeometry :: GetRefinement () const
{
return RefinementSTLGeometry (*this);
delete ref;
ref = new RefinementSTLGeometry(*this);
// ref -> Set2dOptimizer(new MeshOptimizeSTLSurface(*this)); ??? copied from CSG
return *ref;
}
@ -3072,13 +3078,11 @@ void STLGeometry :: BuildSmoothEdges ()
for (int j = 1; j <= 3; j++)
{
int nbt = NeighbourTrig (i, j);
ng2 = GetTriangle(nbt).GeomNormal(points);
ng2 /= (ng2.Length() + 1e-24);
int pi1, pi2;
trig.GetNeighbourPoints(GetTriangle(nbt), pi1, pi2);
if (!IsEdge(pi1,pi2))

View File

@ -160,6 +160,8 @@ namespace netgen
Vec<3> ex, ey, ez;
Point<3> p1;
mutable class RefinementSTLGeometry * ref;
public:
int edgesfound;
int surfacemeshed;

View File

@ -409,6 +409,13 @@ STLGeometry * STLTopology ::Load (istream & ist)
if (readtrigs.Size() % 100000 == 0)
PrintMessageCR (3, readtrigs.Size(), " triangles loaded\r");
}
else
{
cout << "Skipping flat triangle "
<< "l1 = " << Dist(pts[0], pts[1])
<< ", l2 = " << Dist(pts[0], pts[2])
<< ", l3 = " << Dist(pts[2], pts[1]) << endl;
}
}
}