summaryrefslogtreecommitdiffstats
path: root/libdimension-python
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@gmail.com>2011-12-21 15:51:47 -0500
committerTavian Barnes <tavianator@gmail.com>2011-12-21 15:52:06 -0500
commitb602fff4133fd793b04839e4e0514c8c101fa50a (patch)
treee9023f73ef1170378d09130305fc72a561ce7ff2 /libdimension-python
parentbabba43cd4d1b9c92a569f19acbe17e429193b01 (diff)
downloaddimension-teapot.tar.xz
Add teapots WIP.teapot
Diffstat (limited to 'libdimension-python')
-rw-r--r--libdimension-python/dimension.pxd1
-rw-r--r--libdimension-python/dimension.pyx9
2 files changed, 10 insertions, 0 deletions
diff --git a/libdimension-python/dimension.pxd b/libdimension-python/dimension.pxd
index 3f89e71..cddd7ba 100644
--- a/libdimension-python/dimension.pxd
+++ b/libdimension-python/dimension.pxd
@@ -335,6 +335,7 @@ cdef extern from "../libdimension/dimension.h":
dmnsn_object *dmnsn_new_cube()
dmnsn_object *dmnsn_new_cone(double r1, double r2, bint open)
dmnsn_object *dmnsn_new_torus(double major, double minor)
+ dmnsn_object *dmnsn_new_teapot()
dmnsn_object *dmnsn_new_csg_union(dmnsn_array *objects)
dmnsn_object *dmnsn_new_csg_intersection(dmnsn_object *A, dmnsn_object *B)
diff --git a/libdimension-python/dimension.pyx b/libdimension-python/dimension.pyx
index a34d2eb..704d6fa 100644
--- a/libdimension-python/dimension.pyx
+++ b/libdimension-python/dimension.pyx
@@ -1271,6 +1271,15 @@ cdef class Torus(Object):
self._object = dmnsn_new_torus(major_radius, minor_radius)
Object.__init__(self, *args, **kwargs)
+cdef class Teapot(Object):
+ """The Utah teapot."""
+ def __init__(self, *args, **kwargs):
+ """
+ Create a Teapot. Teapot() accepts any arguments that Object() accepts.
+ """
+ self._object = dmnsn_new_teapot()
+ Object.__init__(self, *args, **kwargs)
+
cdef class Union(Object):
"""A CSG union."""
def __init__(self, objects, *args, **kwargs):