diff --git a/python/csg.py b/python/csg.py index 8eee7745..85af4611 100644 --- a/python/csg.py +++ b/python/csg.py @@ -4,8 +4,7 @@ if __platform.startswith('linux') or __platform.startswith('darwin'): from libcsg.csg import * import libcsgvis.csgvis as csgvis from libcsgvis.csgvis import MouseMove - import libmesh.meshing -# from libmesh.meshing import * + from libmesh.meshing import * if __platform.startswith('win'): # Windows from nglib.csg import * @@ -20,3 +19,14 @@ del csgvis def VS (obj): return obj.VS() + + +def csg_meshing_func (geom, maxh): + return GenerateMesh (geom, MeshingParameters (maxh=maxh)) + +CSGeometry.GenerateMesh = csg_meshing_func + + +unit_cube = CSGeometry() +unit_cube.Add (OrthoBrick(Pnt(0,0,0), Pnt(1,1,1))) + diff --git a/python/geom2d.py b/python/geom2d.py index cdffd337..d439ae36 100644 --- a/python/geom2d.py +++ b/python/geom2d.py @@ -1,10 +1,11 @@ from nglib.meshing import * from nglib.geom2d import * - -geom = SplineGeometry() + +geom = SplineGeometry() geom.Load("square.in2d") param = MeshingParameters() param.maxh = 0.05 - -m1 = geom.GenerateMesh (param) \ No newline at end of file + +m1 = geom.GenerateMesh (param) +