mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
occ build visualization mesh
This commit is contained in:
parent
8a64f004a9
commit
0c3c3f32d1
@ -37,6 +37,7 @@ namespace netgen
|
||||
|
||||
void OCCConstructGeometry (OCCGeometry & geom)
|
||||
{
|
||||
#ifdef NOTHING
|
||||
cout << "OCC construction" << endl;
|
||||
|
||||
BRep_Builder builder;
|
||||
@ -147,6 +148,8 @@ namespace netgen
|
||||
geom.BuildFMap();
|
||||
geom.BuildVisualizationMesh();
|
||||
geom.changed = 1;
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
namespace netgen
|
||||
{
|
||||
// #include "../visualization/vispar.hpp"
|
||||
|
||||
|
||||
void OCCGeometry :: PrintNrShapes ()
|
||||
{
|
||||
@ -954,19 +956,19 @@ namespace netgen
|
||||
}
|
||||
|
||||
|
||||
void OCCGeometry :: BuildVisualizationMesh ()
|
||||
void OCCGeometry :: BuildVisualizationMesh (double deflection)
|
||||
{
|
||||
|
||||
cout << "Preparing visualization (deflection = " << vispar.occdeflection << ") ... " << flush;
|
||||
|
||||
cout << "Preparing visualization (deflection = " << deflection << ") ... " << flush;
|
||||
|
||||
BRepTools::Clean (shape);
|
||||
//WriteOCC_STL("test.stl");
|
||||
BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh (shape, vispar.occdeflection, true);
|
||||
BRepMesh_IncrementalMesh::BRepMesh_IncrementalMesh (shape, deflection, true);
|
||||
cout << "done" << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void OCCGeometry :: CalcBoundingBox ()
|
||||
{
|
||||
Bnd_Box bb;
|
||||
BRepBndLib::Add (shape, bb);
|
||||
|
||||
@ -978,8 +980,6 @@ namespace netgen
|
||||
(*testout) << "Bounding Box = [" << p1 << " - " << p2 << "]" << endl;
|
||||
boundingbox = Box<3> (p1,p2);
|
||||
SetCenter();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1129,7 +1129,8 @@ namespace netgen
|
||||
//
|
||||
|
||||
|
||||
occgeo->BuildVisualizationMesh();
|
||||
// occgeo->BuildVisualizationMesh();
|
||||
occgeo->CalcBoundingBox();
|
||||
PrintContents (occgeo);
|
||||
|
||||
return occgeo;
|
||||
@ -1196,7 +1197,8 @@ OCCGeometry * LoadOCC_STEP (const char * filename)
|
||||
occgeo->changed = 1;
|
||||
occgeo->BuildFMap();
|
||||
|
||||
occgeo->BuildVisualizationMesh();
|
||||
// occgeo->BuildVisualizationMesh();
|
||||
occgeo->CalcBoundingBox();
|
||||
PrintContents (occgeo);
|
||||
|
||||
return occgeo;
|
||||
@ -1282,7 +1284,8 @@ OCCGeometry * LoadOCC_STEP (const char * filename)
|
||||
|
||||
occgeo->changed = 1;
|
||||
occgeo->BuildFMap();
|
||||
occgeo->BuildVisualizationMesh();
|
||||
// occgeo->BuildVisualizationMesh();
|
||||
occgeo->CalcBoundingBox();
|
||||
PrintContents (occgeo);
|
||||
|
||||
return occgeo;
|
||||
|
@ -112,7 +112,7 @@
|
||||
namespace netgen
|
||||
{
|
||||
|
||||
#include "../visualization/vispar.hpp"
|
||||
// #include "../visualization/vispar.hpp"
|
||||
// class VisualizationParameters;
|
||||
// extern VisualizationParameters vispar;
|
||||
|
||||
@ -252,7 +252,8 @@ namespace netgen
|
||||
return OCCSurface (TopoDS::Face(fmap(surfi)), PLANESPACE);
|
||||
}
|
||||
|
||||
void BuildVisualizationMesh ();
|
||||
void CalcBoundingBox ();
|
||||
void BuildVisualizationMesh (double deflection);
|
||||
|
||||
void RecursiveTopologyTree (const TopoDS_Shape & sh,
|
||||
stringstream & str,
|
||||
|
@ -364,8 +364,10 @@ namespace netgen
|
||||
|
||||
void VisualSceneOCCGeometry :: BuildScene (int zoomall)
|
||||
{
|
||||
if (occgeometry -> changed == OCCGEOMETRYVISUALIZATIONFULLCHANGE)
|
||||
{
|
||||
if (occgeometry -> changed == OCCGEOMETRYVISUALIZATIONFULLCHANGE)
|
||||
{
|
||||
occgeometry -> BuildVisualizationMesh (vispar.occdeflection);
|
||||
|
||||
center = occgeometry -> Center();
|
||||
rad = occgeometry -> GetBoundingBox().Diam() / 2;
|
||||
|
||||
|
10
ng/ngpkg.cpp
10
ng/ngpkg.cpp
@ -3980,7 +3980,7 @@ namespace netgen
|
||||
{
|
||||
if (strcmp (argv[1], "buildvisualizationmesh") == 0)
|
||||
{
|
||||
occgeometry->BuildVisualizationMesh();
|
||||
occgeometry->BuildVisualizationMesh(vispar.occdeflection);
|
||||
occgeometry->changed = OCCGEOMETRYVISUALIZATIONHALFCHANGE;
|
||||
}
|
||||
if (strcmp (argv[1], "mesherror") == 0)
|
||||
@ -3998,7 +3998,7 @@ namespace netgen
|
||||
occgeometry->BuildFMap();
|
||||
cout << endl << "After operation:" << endl;
|
||||
occgeometry->PrintNrShapes();
|
||||
occgeometry->BuildVisualizationMesh();
|
||||
occgeometry->BuildVisualizationMesh(vispar.occdeflection);
|
||||
occgeometry->changed = OCCGEOMETRYVISUALIZATIONHALFCHANGE;
|
||||
}
|
||||
if (strcmp (argv[1], "makesolid") == 0)
|
||||
@ -4009,7 +4009,7 @@ namespace netgen
|
||||
occgeometry->BuildFMap();
|
||||
cout << endl << "After operation:" << endl;
|
||||
occgeometry->PrintNrShapes();
|
||||
occgeometry->BuildVisualizationMesh();
|
||||
occgeometry->BuildVisualizationMesh(vispar.occdeflection);
|
||||
occgeometry->changed = OCCGEOMETRYVISUALIZATIONHALFCHANGE;
|
||||
}
|
||||
if (strcmp (argv[1], "upgradetopology") == 0)
|
||||
@ -4021,7 +4021,7 @@ namespace netgen
|
||||
occgeometry->BuildFMap();
|
||||
cout << endl << "After operation:" << endl;
|
||||
occgeometry->PrintNrShapes();
|
||||
occgeometry->BuildVisualizationMesh();
|
||||
occgeometry->BuildVisualizationMesh(vispar.occdeflection);
|
||||
occgeometry->changed = OCCGEOMETRYVISUALIZATIONHALFCHANGE;
|
||||
}
|
||||
if (strcmp (argv[1], "shapehealing") == 0)
|
||||
@ -4045,7 +4045,7 @@ namespace netgen
|
||||
occgeometry->BuildFMap();
|
||||
// cout << endl << "After operation:" << endl;
|
||||
// occgeometry->PrintNrShapes();
|
||||
occgeometry->BuildVisualizationMesh();
|
||||
occgeometry->BuildVisualizationMesh(vispar.occdeflection);
|
||||
occgeometry->changed = OCCGEOMETRYVISUALIZATIONHALFCHANGE;
|
||||
}
|
||||
|
||||
|
@ -42,12 +42,14 @@ namespace netgen
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
// should not be needed (occ currently requires it)
|
||||
namespace netgen {
|
||||
#include "../libsrc/visualization/vispar.hpp"
|
||||
VisualizationParameters vispar;
|
||||
VisualizationParameters :: VisualizationParameters() { ; }
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
namespace nglib {
|
||||
|
@ -1,4 +1,3 @@
|
||||
dist_noinst_DATA = netgen.sln netgen.suo netgen.vcproj postBuild_Install.bat
|
||||
# abc
|
||||
dist_noinst_DATA = netgen.sln netgen.suo netgen.vcproj netgen_MSVC2005.sln netgen_MSVC2005.suo netgen_MSVC2005.vcproj postBuild_Install.bat
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user