from icqsol.tools.geometry.icqBox import Box

"""
Test conversion from a shape to a list of polygons
@author pletzer@psu.edu
"""

shp = Box(origin = [0., 0., 0.], lengths = [1., 1., 1.], n_x=1, n_y=1, n_z=1)

shp.debug()

# check whether one can convert to a list of polygons
polys = shp.toPolygons()

# check whether each polygon can be cloned
map(lambda p: p.clone(), polys)


@@ -37,16 +37,93 @@
 port Box
+%0Afrom icqsol.tools.geometry.icqSphere import Sphere%0A%0Afrom csg.core import CSG
 %0A%0A%22%22%22%0ATe
@@ -279,16 +279,17 @@
 n_z=1)%0A%0A
+#
 shp.debu
@@ -292,16 +292,16 @@
 debug()%0A
-
 %0A# check
@@ -449,8 +449,212 @@
 polys)%0A%0A
+# check that we can load the polygons%0Aa = CSG.fromPolygons(polys)%0A%0Ashp2 = Sphere(radius=1.0, origin=(0., 0., 0.), n_theta=5, n_phi=2)%0Ashp2.debug()%0Apolys2 = shp2.toPolygons()%0Aa2 = CSG.fromPolygons(polys2)%0A

problem converting to polygons