netgen/python/csg.py

26 lines
675 B
Python
Raw Normal View History

from .libngpy._csg import *
from .libngpy._meshing import Pnt, Vec, Trafo
from .meshing import meshsize
2014-10-10 17:18:51 +06:00
2017-01-31 19:35:56 +05:00
try:
from . import csgvis
from .csgvis import MouseMove
2017-01-31 19:35:56 +05:00
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()
except:
pass
2015-07-29 23:39:04 +05:00
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")
2017-09-01 12:12:50 +05:00
unit_cube.Add (p1*p2*p3*p4*p5*p6, col=(0,0,1))
2015-07-29 23:39:04 +05:00