diff options
author | jvasile <jvasile@cb376a5e-1013-0410-a455-b6b1f9ac8223> | 2008-07-17 21:32:23 +0000 |
---|---|---|
committer | jvasile <jvasile@cb376a5e-1013-0410-a455-b6b1f9ac8223> | 2008-07-17 21:32:23 +0000 |
commit | 710880db0345567d8fc859a8bfa3182584392f28 (patch) | |
tree | 7499985ce9e4551482a78f01499feb5ad9278761 | |
parent | 7b9174f7409dadaa82c5981c161002c986b7d5dc (diff) | |
download | reprap-backup-710880db0345567d8fc859a8bfa3182584392f28.tar.gz reprap-backup-710880db0345567d8fc859a8bfa3182584392f28.zip |
tagging 0.2
git-svn-id: https://reprap.svn.sourceforge.net/svnroot/reprap@1775 cb376a5e-1013-0410-a455-b6b1f9ac8223
-rwxr-xr-x | trunk/users/vasile/tags/brlcad-0.2/geegaw.py | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/trunk/users/vasile/tags/brlcad-0.2/geegaw.py b/trunk/users/vasile/tags/brlcad-0.2/geegaw.py new file mode 100755 index 00000000..abaa35be --- /dev/null +++ b/trunk/users/vasile/tags/brlcad-0.2/geegaw.py @@ -0,0 +1,69 @@ +#!/usr/bin/python + +import sys + +from brlcad import * + +VERSION=0.2 + +class base(Shape): + def __init__(self, vertex=(0,0,0), height=(0, 1.5, 0), radius=0.5): + '''TODO: little nubs for the threads to bite? + TODO: a way to keep the pestle in''' + + x, y, z = vertex + h = height + hy = float(h[1]) + radius = float(radius) + + shell = Shape( [ + Cylinder((x, y + 2*hy/3, z), (h[0], hy/3, h[2]), radius), + Cone(vertex, (h[0], 2 * hy/3, h[2]), 0.25 ,radius) + ], basename='shell', suffix='', group=True) + + innards = Shape ( [ + Cylinder((x, y + 2 * hy / 3, z), + (h[0], hy/3 + 0.0001, h[2]), + radius * .75), + Cone((x, y + 2 * hy / 3, z), + (h[0], hy/3 - 1, h[2]), + radius * .75 - .025, 0.125), + Cylinder(vertex, (h[0], hy/3, h[2]), 0.25) + ], basename='innards', suffix='', group=True) + + Shape.__init__(self, [ + shell, innards + ], combination = shell - innards, basename='base') + +class pestle(Shape): + def __init__(self, vertex = (2,0,0), height=(0, 1, 0), radius=0.5): + radius = float(radius) + h = height + hy = float(height[1]) + + Shape.__init__(self, [ + Cylinder(vertex, (h[0], hy, h[2]), radius * .75, basename='pestle'), + Cylinder(vertex, (h[0], hy/2, h[2]), radius, basename='cap') + ], group=True) + + +class slater(Shape): + def __init__(self, vertex=(0,0,0), height=(0,2,0), radius=0.5): + x, y, z = vertex + h = height + hy = float(h[1]) + + Shape.__init__(self, [ + base(vertex, (h[0], hy * 3 /4, h[2]), radius), + pestle((x,y+3,z), (h[0], hy * - 1 / 2, h[2]), radius) + ], basename='slater', suffix='', group=True) + +print warning, '\n\n', copyright, '\n', license, '\n' +print Script( + Title('slater'), + Units('inch'), + slater((-1,0,0), (0,2,0), 0.5) + ) + + + |