unit-cube

This commit is contained in:
Joachim Schoeberl 2015-07-29 20:39:04 +02:00
parent 0ce429d094
commit adeb492b64
2 changed files with 17 additions and 6 deletions

View File

@ -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)))

View File

@ -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)
m1 = geom.GenerateMesh (param)