summaryrefslogtreecommitdiff
path: root/trunk/users/vasile/objects/xslide_strap/xslide_strap.py
blob: ce5b9a5c947ff8882dc70d7b60f6fcc3e805cd44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/python

## Copyright (C) 2008 James Vasile <james@hackervisions.org>'

## This is a freed work; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 3 of the License, or
## any later version.

## This is distributed in the hope that it will be useful, but WITHOUT
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
## License for more details.  You should have received a copy of the
## GNU General Public License along with the work; if not, write
## to the Free Software Foundation, Inc., 51 Franklin Street, 5th
## Floor, Boston, MA 02110-1301 USA

import sys

from brlcad import *
from brlcad_mechanical import *

class sanyo_stepper(stepper_motor):
    def __init__(self, vertex, **kwargs):
        base_width = float(3)
        stepper_motor.__init__(self, vertex,       # vertex
                               .25, base_width,    # base thickness, base width
                                0.25,              # motor hole radius
                                2.5, base_width/2, # motor height and radius
                                1, 0.1,             #spindel height and radius
                                **kwargs)

class l_bracket(Shape):
    def __init__(self, vertex, width, length1, length2, thickness):
        pass

class motor_mount(Shape):
    def __init__(self, vertex, height):
        x, y, z = vertex
        hx, hy, hz = height
        Shape.__init__(self, '')

class cross_slide_vice(Shape):
    def __init__(self, vertex, height):
        x, y, z = vertex
        hx, hy, hz = height
        Shape.__init__(self, [
                Box(0,15,0,12,0,2, basename='base', suffix='')
                # 2 acme rods
                # 1 jaw threaded screw 
                # 2 jaws
                # 3 handles
                # 2 sliding bases
                ], basename='vice', suffix='', group=True)
        


class cartesian_bot(Shape):
    def __init__(self, vertex, height, **kwargs):
        x, y, z = vertex
        hx, hy, hz = height

        s1 = sanyo_stepper((x-5,y+5,z), rotate=(0,0,90))
#        s1.rotate((0, 0, 90))
        s2 = sanyo_stepper((x+10, y-5, z))


        Shape.__init__(self, [
                cross_slide_vice(vertex, height),
#            motor_mount(vertex, height),
#            motor_mount(vertex, height),
                s1, s2,
                ], basename='cartesian_bot', suffix='', group=True)


#print warning, '\n\n', copyright, '\n', license, '\n'

bot = 1
print Script(
    Comment('Cartesian bot based on cross-slide vice'),
    Title('xslide_strap'),
    Units('mm'),
    cartesian_bot((0,1,2), (0,2,0))
    )