netgen/python/csg.py

35 lines
760 B
Python
Raw Normal View History

2016-11-04 12:14:52 +01:00
import libngpy
from libngpy._csg import *
from libngpy._meshing import MeshingParameters
from libngpy._meshing import Pnt
2017-01-10 18:38:36 +01:00
from libngpy._meshing import Vec
2014-10-10 11:18:51 +00:00
2017-01-31 15:35:56 +01:00
try:
import libngpy.csgvis as csgvis
from libngpy.csgvis import MouseMove
CSGeometry.VS = csgvis.VS
SetBackGroundColor = csgvis.SetBackGroundColor
del csgvis
2014-10-10 11:18:51 +00:00
2017-01-31 15:35:56 +01:00
def VS (obj):
return obj.VS()
2014-10-10 11:18:51 +00:00
2017-01-31 15:35:56 +01:00
except:
pass
2015-07-29 20:39:04 +02:00
2015-08-08 12:58:41 +02:00
def csg_meshing_func (geom, **args):
if "mp" in args:
return GenerateMesh (geom, args["mp"])
else:
return GenerateMesh (geom, MeshingParameters (**args))
# return GenerateMesh (geom, MeshingParameters (**args))
2015-07-29 20:39:04 +02:00
CSGeometry.GenerateMesh = csg_meshing_func
unit_cube = CSGeometry()
unit_cube.Add (OrthoBrick(Pnt(0,0,0), Pnt(1,1,1)))