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 11:18:51 +00:00
2017-01-31 15:35:56 +01:00
try:
from . import csgvis
from .csgvis import MouseMove
2017-01-31 15:35:56 +01:00
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()
except:
pass
2015-07-29 20:39:04 +02:00
unit_cube = CSGeometry()
2017-06-11 09:45:15 +02: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 09:12:50 +02:00
unit_cube.Add (p1*p2*p3*p4*p5*p6, col=(0,0,1))
2015-07-29 20:39:04 +02:00