From cf713efd2da43a733abf06f7c9b5c9697fef7e78 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Thu, 20 Mar 2014 12:52:29 +0000 Subject: [PATCH] refinement of stl geometries --- libsrc/stlgeom/stlgeom.cpp | 10 ++++++++-- libsrc/stlgeom/stlgeom.hpp | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/libsrc/stlgeom/stlgeom.cpp b/libsrc/stlgeom/stlgeom.cpp index b93ef718..62d8718b 100644 --- a/libsrc/stlgeom/stlgeom.cpp +++ b/libsrc/stlgeom/stlgeom.cpp @@ -41,6 +41,7 @@ void STLMeshing (STLGeometry & geom, lineendpoints(), spiralpoints(), selectedmultiedge() */ { + ref = NULL; edgedata = new STLEdgeDataList(*this); externaledges.SetSize(0); Clear(); @@ -57,10 +58,11 @@ void STLMeshing (STLGeometry & geom, smoothedges = NULL; area = -1; } - + 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); + // return RefinementSTLGeometry (*this); + delete ref; + ref = new RefinementSTLGeometry(*this); + // ref -> Set2dOptimizer(new MeshOptimizeSTLSurface(*this)); ??? copied from CSG + return *ref; } diff --git a/libsrc/stlgeom/stlgeom.hpp b/libsrc/stlgeom/stlgeom.hpp index 85ae157f..b2cac880 100644 --- a/libsrc/stlgeom/stlgeom.hpp +++ b/libsrc/stlgeom/stlgeom.hpp @@ -159,7 +159,8 @@ namespace netgen Vec<3> meshtrignv; Vec<3> ex, ey, ez; Point<3> p1; - + mutable class RefinementSTLGeometry * ref; + public: int edgesfound; int surfacemeshed;