netgen/python/csg.py

35 lines
760 B
Python
Raw Normal View History

2016-11-04 16:14:52 +05:00
import libngpy
from libngpy._csg import *
from libngpy._meshing import MeshingParameters
from libngpy._meshing import Pnt
2017-01-10 22:38:36 +05:00
from libngpy._meshing import Vec
2014-10-10 17:18:51 +06:00
2017-01-31 19:35:56 +05:00
try:
import libngpy.csgvis as csgvis
from libngpy.csgvis import MouseMove
CSGeometry.VS = csgvis.VS
SetBackGroundColor = csgvis.SetBackGroundColor
del csgvis
2014-10-10 17:18:51 +06:00
2017-01-31 19:35:56 +05:00
def VS (obj):
return obj.VS()
2014-10-10 17:18:51 +06:00
2017-01-31 19:35:56 +05:00
except:
pass
2015-07-29 23:39:04 +05:00
2015-08-08 15:58:41 +05: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 23:39:04 +05:00
CSGeometry.GenerateMesh = csg_meshing_func
unit_cube = CSGeometry()
unit_cube.Add (OrthoBrick(Pnt(0,0,0), Pnt(1,1,1)))