2017-05-30 00:19:34 +05:00
|
|
|
from netgen.libngpy._csg import *
|
|
|
|
from netgen.libngpy._meshing import MeshingParameters
|
|
|
|
from netgen.libngpy._meshing import Pnt
|
|
|
|
from netgen.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):
|
2016-09-29 19:44:16 +05:00
|
|
|
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()
|
2017-06-11 12:45:15 +05:00
|
|
|
p1 = Plane(Pnt(0,0,0),Vec(-1,0,0)).bc("back")
|
|
|
|
p2 = Plane(Pnt(1,1,1),Vec(1,0,0)).bc("front")
|
|
|
|
p3 = Plane(Pnt(0,0,0),Vec(0,-1,0)).bc("left")
|
|
|
|
p4 = Plane(Pnt(1,1,1),Vec(0,1,0)).bc("right")
|
|
|
|
p5 = Plane(Pnt(0,0,0),Vec(0,0,-1)).bc("bottom")
|
|
|
|
p6 = Plane(Pnt(1,1,1),Vec(0,0,1)).bc("top")
|
|
|
|
unit_cube.Add (p1*p2*p3*p4*p5*p6)
|
|
|
|
# unit_cube.Add (OrthoBrick(Pnt(0,0,0), Pnt(1,1,1)))
|
2015-07-29 23:39:04 +05:00
|
|
|
|