Fix BK12 model
This commit is contained in:
parent
8e7fe382d2
commit
d71cbf1391
340
utils.py
340
utils.py
|
@ -5,25 +5,26 @@ from ocp_vscode import *
|
||||||
|
|
||||||
import localselectors
|
import localselectors
|
||||||
|
|
||||||
|
|
||||||
class SFU1204:
|
class SFU1204:
|
||||||
def __init__(self, base, l):
|
def __init__(self, base, l):
|
||||||
self.w = base.workplane()
|
self.w = base.workplane()
|
||||||
self.len = l
|
self.len = l
|
||||||
|
|
||||||
def ballscrew(self):
|
def ballscrew(self):
|
||||||
profile = [
|
profile = [
|
||||||
(0, 0),
|
(0, 0),
|
||||||
(0, 8/2),
|
(0, 8 / 2),
|
||||||
(15, 8/2),
|
(15, 8 / 2),
|
||||||
(15, 10/2),
|
(15, 10 / 2),
|
||||||
(15+16, 10/2),
|
(15 + 16, 10 / 2),
|
||||||
(15+39, 10/2),
|
(15 + 39, 10 / 2),
|
||||||
(15+39, 12/2),
|
(15 + 39, 12 / 2),
|
||||||
(self.len - 10, 12/2),
|
(self.len - 10, 12 / 2),
|
||||||
(self.len - 10, 8/2),
|
(self.len - 10, 8 / 2),
|
||||||
(self.len, 8/2),
|
(self.len, 8 / 2),
|
||||||
(self.len, 0),
|
(self.len, 0),
|
||||||
]
|
]
|
||||||
w = self.w.moveTo(0, 0)
|
w = self.w.moveTo(0, 0)
|
||||||
for v in profile[1:]:
|
for v in profile[1:]:
|
||||||
w = w.lineTo(v[1], v[0])
|
w = w.lineTo(v[1], v[0])
|
||||||
|
@ -32,41 +33,45 @@ class SFU1204:
|
||||||
|
|
||||||
def nut(self, x):
|
def nut(self, x):
|
||||||
w = self.w.transformed(offset=(0, x, 0), rotate=(90, 0, 0))
|
w = self.w.transformed(offset=(0, x, 0), rotate=(90, 0, 0))
|
||||||
n = (w.sketch()
|
n = (
|
||||||
.circle(40/2)
|
w.sketch()
|
||||||
.circle(12/2, mode='s')
|
.circle(40 / 2)
|
||||||
.rect(42, 30, mode='i')
|
.circle(12 / 2, mode="s")
|
||||||
|
.rect(42, 30, mode="i")
|
||||||
.finalize()
|
.finalize()
|
||||||
.extrude(10)
|
.extrude(10)
|
||||||
.faces(">z")
|
.copyWorkplane(w)
|
||||||
|
.transformed(offset=(0, 0, 10))
|
||||||
.workplane()
|
.workplane()
|
||||||
.tag("nut_face")
|
.tag("nut_face")
|
||||||
.sketch()
|
.sketch()
|
||||||
.circle(22/2)
|
.circle(22 / 2)
|
||||||
.circle(12/2, mode='s')
|
.circle(12 / 2, mode="s")
|
||||||
.finalize()
|
.finalize()
|
||||||
.extrude(25))
|
.extrude(25)
|
||||||
hole_r = 32/2
|
|
||||||
hole_pts = [
|
|
||||||
(hole_r*math.cos(angle*math.pi/180),
|
|
||||||
hole_r*math.sin(angle*math.pi/180)) for angle in
|
|
||||||
[-45, 0, 45, 180-45, 180, 180+45]]
|
|
||||||
n = (n.workplaneFromTagged("nut_face")
|
|
||||||
.pushPoints(hole_pts)
|
|
||||||
.hole(4.8)
|
|
||||||
)
|
)
|
||||||
|
hole_r = 32 / 2
|
||||||
|
hole_pts = [
|
||||||
|
(
|
||||||
|
hole_r * math.cos(angle * math.pi / 180),
|
||||||
|
hole_r * math.sin(angle * math.pi / 180),
|
||||||
|
)
|
||||||
|
for angle in [-45, 0, 45, 180 - 45, 180, 180 + 45]
|
||||||
|
]
|
||||||
|
n = n.workplaneFromTagged("nut_face").pushPoints(hole_pts).hole(4.8)
|
||||||
return n
|
return n
|
||||||
|
|
||||||
def nutHoles(self, solid, x):
|
def nutHoles(self, solid, x):
|
||||||
w = self.w.transformed(offset=(0, x, 0), rotate=(90, 0, 0))
|
w = self.w.transformed(offset=(0, x, 0), rotate=(90, 0, 0))
|
||||||
hole_r = 32/2
|
hole_r = 32 / 2
|
||||||
hole_pts = [
|
hole_pts = [
|
||||||
(hole_r*math.cos(angle*math.pi/180),
|
(
|
||||||
hole_r*math.sin(angle*math.pi/180)) for angle in
|
hole_r * math.cos(angle * math.pi / 180),
|
||||||
[-45, 0, 45, 180-45, 180, 180+45]]
|
hole_r * math.sin(angle * math.pi / 180),
|
||||||
solid = (solid.copyWorkplane(w)
|
)
|
||||||
.pushPoints(hole_pts)
|
for angle in [-45, 0, 45, 180 - 45, 180, 180 + 45]
|
||||||
.hole(4.8))
|
]
|
||||||
|
solid = solid.copyWorkplane(w).pushPoints(hole_pts).hole(4.8)
|
||||||
return solid
|
return solid
|
||||||
|
|
||||||
def fixedBearing(self):
|
def fixedBearing(self):
|
||||||
|
@ -89,18 +94,19 @@ class SFU1204:
|
||||||
X = 6.6
|
X = 6.6
|
||||||
Y = 10.8
|
Y = 10.8
|
||||||
Z = 1.5
|
Z = 1.5
|
||||||
w = self.w.transformed(offset=(0, 39+15-L, 0), rotate=(-90, 0, 0))
|
w = self.w.transformed(offset=(0, 39 + 15, 0), rotate=(-90, 180, 0))
|
||||||
w2 = w.transformed(offset=(0, (H-H1)/2, 0))
|
w2 = w.transformed(offset=(0, h - H1 / 2, 0))
|
||||||
|
w3 = w.transformed(offset=(0, E / 2, 0))
|
||||||
|
|
||||||
bearing = (w
|
bearing = (
|
||||||
.rect(B1, B1)
|
w.rect(B1, B1)
|
||||||
.extrude(L1+L)
|
.extrude(L1 + L)
|
||||||
.copyWorkplane(w2)
|
.copyWorkplane(w2)
|
||||||
.rect(B, H1)
|
.rect(B, H1)
|
||||||
.extrude(L)
|
.extrude(L)
|
||||||
.copyWorkplane(w.transformed(rotate=(180, 0, 0)))
|
.copyWorkplane(w.transformed(rotate=(180, 0, 0)))
|
||||||
.hole(d1)
|
.hole(d1)
|
||||||
.copyWorkplane(w2.transformed(rotate=(180, 0, 0)))
|
.copyWorkplane(w3.transformed(rotate=(180, 0, 0)))
|
||||||
.rect(P, E, forConstruction=True)
|
.rect(P, E, forConstruction=True)
|
||||||
.vertices()
|
.vertices()
|
||||||
.hole(d2)
|
.hole(d2)
|
||||||
|
@ -130,12 +136,9 @@ class SFU1204:
|
||||||
Y = 10.8
|
Y = 10.8
|
||||||
Z = 1.5
|
Z = 1.5
|
||||||
|
|
||||||
w = self.w.transformed(offset=(0, 39+15-L, -(H-H1)/2), rotate=(-90, 0, 0))
|
w = self.w.transformed(offset=(0, 39 + 15, -E / 2), rotate=(-90, 0, 0))
|
||||||
return (solid
|
return (
|
||||||
.copyWorkplane(w)
|
solid.copyWorkplane(w).rect(P, E, forConstruction=True).vertices().hole(d2)
|
||||||
.rect(P, E, forConstruction=True)
|
|
||||||
.vertices()
|
|
||||||
.hole(d2)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def floatingBearing(self):
|
def floatingBearing(self):
|
||||||
|
@ -154,24 +157,33 @@ class SFU1204:
|
||||||
Y = 10.8
|
Y = 10.8
|
||||||
Z = 1.5
|
Z = 1.5
|
||||||
|
|
||||||
w = self.w.transformed(offset=(0, self.len-10, 0), rotate=(-90, 0, 0))
|
w = self.w.transformed(
|
||||||
b = (w
|
offset=(0, self.len - 10 + 7 / 2 - L / 2, 0), rotate=(-90, 0, 0)
|
||||||
.rect(B1, B1)
|
)
|
||||||
|
b = (
|
||||||
|
w.rect(B1, B1)
|
||||||
.extrude(L)
|
.extrude(L)
|
||||||
.faces(">z")
|
.copyWorkplane(w.transformed(offset=(0, 0, L), rotate=(0, 0, 180)))
|
||||||
.workplane()
|
.workplane()
|
||||||
.tag("floating_far_end")
|
.tag("floating_far_end")
|
||||||
.copyWorkplane(w)
|
.copyWorkplane(w)
|
||||||
.center(0, (H-H1)/2)
|
.center(0, h - H1 / 2)
|
||||||
.rect(B, H1)
|
.rect(B, H1)
|
||||||
.extrude(L)
|
.extrude(L)
|
||||||
.workplaneFromTagged("floating_far_end")
|
.workplaneFromTagged("floating_far_end")
|
||||||
.hole(d1)
|
.hole(d1)
|
||||||
.workplaneFromTagged("floating_far_end")
|
.workplaneFromTagged("floating_far_end")
|
||||||
.center(0, -(H-H1)/2)
|
.center(0, -E / 2)
|
||||||
.rect(P, E, forConstruction=True)
|
.rect(P, E, forConstruction=True)
|
||||||
.vertices()
|
.vertices()
|
||||||
.hole(d2)
|
.hole(d2)
|
||||||
|
.copyWorkplane(w)
|
||||||
|
.circle(30 / 2)
|
||||||
|
.extrude(L / 2 - 7 / 2, combine="s")
|
||||||
|
.workplaneFromTagged("floating_far_end")
|
||||||
|
.transformed(rotate=(180, 0, 0))
|
||||||
|
.circle(30 / 2)
|
||||||
|
.extrude(L / 2 - 7 / 2, combine="s")
|
||||||
)
|
)
|
||||||
return b
|
return b
|
||||||
|
|
||||||
|
@ -191,51 +203,54 @@ class SFU1204:
|
||||||
Y = 10.8
|
Y = 10.8
|
||||||
Z = 1.5
|
Z = 1.5
|
||||||
|
|
||||||
w = self.w.transformed(offset=(0, self.len-10+L, 0), rotate=(90, 0, 0))
|
w = self.w.transformed(offset=(0, self.len - 10 + L, 0), rotate=(90, 0, 0))
|
||||||
solid = (solid
|
solid = (
|
||||||
.copyWorkplane(w)
|
solid.copyWorkplane(w)
|
||||||
.center(0, -(H-H1)/2)
|
.center(0, -E / 2)
|
||||||
.rect(P, E, forConstruction=True)
|
.rect(P, E, forConstruction=True)
|
||||||
.vertices()
|
.vertices()
|
||||||
.hole(d2)
|
.hole(d2)
|
||||||
)
|
)
|
||||||
return solid
|
return solid
|
||||||
|
|
||||||
|
|
||||||
# it's oriented along the y axis of the given base plane
|
# it's oriented along the y axis of the given base plane
|
||||||
class HGR20:
|
class HGR20:
|
||||||
def __init__(self, base, l):
|
def __init__(self, base, l):
|
||||||
self.base = base.workplane()
|
self.base = base.workplane()
|
||||||
self.l = l
|
self.l = l
|
||||||
|
|
||||||
def holes(self, w):
|
def holes(self, w):
|
||||||
pts = []
|
pts = []
|
||||||
x = 20
|
x = 20
|
||||||
while x < self.l + 1e-6:
|
while x < self.l + 1e-6:
|
||||||
pts.append((x - self.l/2, 0))
|
pts.append((x - self.l / 2, 0))
|
||||||
x += 60
|
x += 60
|
||||||
w = (w.copyWorkplane(self.base)
|
w = (
|
||||||
.transformed(offset=(0,0,17))
|
w.copyWorkplane(self.base)
|
||||||
.pushPoints(pts)
|
.transformed(offset=(0, 0, 17))
|
||||||
.hole(5))
|
.pushPoints(pts)
|
||||||
|
.hole(5)
|
||||||
|
)
|
||||||
return w
|
return w
|
||||||
|
|
||||||
def rail_sketch(s = None):
|
def rail_sketch(s=None):
|
||||||
# pixel coordinates based on a picture in the Hiwin's
|
# pixel coordinates based on a picture in the Hiwin's
|
||||||
# linear rail guidebook
|
# linear rail guidebook
|
||||||
|
|
||||||
hgr_profile = [
|
hgr_profile = [
|
||||||
(0, 0),
|
(0, 0),
|
||||||
(37, 0),
|
(37, 0),
|
||||||
(37 + 6, 6),
|
(37 + 6, 6),
|
||||||
(96 - 6, 6),
|
(96 - 6, 6),
|
||||||
(96, 0),
|
(96, 0),
|
||||||
(186-17, 0),
|
(186 - 17, 0),
|
||||||
(186, 17),
|
(186, 17),
|
||||||
(186, 76),
|
(186, 76),
|
||||||
(129, 133),
|
(129, 133),
|
||||||
(129, 59 + 133),
|
(129, 59 + 133),
|
||||||
(129 + 20, 59 + 133 + 20),
|
(129 + 20, 59 + 133 + 20),
|
||||||
#(31, 129 + 20 + 31, 133 + 20 + 31),
|
# (31, 129 + 20 + 31, 133 + 20 + 31),
|
||||||
(186 - 6, 316 - 42 - 25 - 6),
|
(186 - 6, 316 - 42 - 25 - 6),
|
||||||
(186, 316 - 42 - 25),
|
(186, 316 - 42 - 25),
|
||||||
(186, 316 - 42),
|
(186, 316 - 42),
|
||||||
|
@ -243,9 +258,9 @@ class HGR20:
|
||||||
(31, 186 - 6 - 31, 316 - 6 - 1),
|
(31, 186 - 6 - 31, 316 - 6 - 1),
|
||||||
(143 + 6, 316 - 6),
|
(143 + 6, 316 - 6),
|
||||||
(143, 316),
|
(143, 316),
|
||||||
(0, 316)
|
(0, 316),
|
||||||
]
|
]
|
||||||
scale = (10/186*17/316)**0.5
|
scale = (10 / 186 * 17 / 316) ** 0.5
|
||||||
scaled_profile = [tuple((scale * v for v in vals)) for vals in hgr_profile]
|
scaled_profile = [tuple((scale * v for v in vals)) for vals in hgr_profile]
|
||||||
if s is None:
|
if s is None:
|
||||||
s = cq.Sketch()
|
s = cq.Sketch()
|
||||||
|
@ -263,163 +278,171 @@ class HGR20:
|
||||||
s = s.segment((-v[1], v[2]))
|
s = s.segment((-v[1], v[2]))
|
||||||
s = s.segment((0, 0))
|
s = s.segment((0, 0))
|
||||||
return s
|
return s
|
||||||
|
|
||||||
def rail(self): # workplane or face to use, length of rail
|
def rail(self): # workplane or face to use, length of rail
|
||||||
# TODO rotate w
|
# TODO rotate w
|
||||||
xy = cq.Workplane().copyWorkplane(self.base)
|
xy = cq.Workplane().copyWorkplane(self.base)
|
||||||
w = xy.transformed((90, 90, 0), (-self.l/2, 0, 0))
|
w = xy.transformed((90, 90, 0), (-self.l / 2, 0, 0))
|
||||||
w = w.placeSketch(HGR20.rail_sketch().assemble())
|
w = w.placeSketch(HGR20.rail_sketch().assemble())
|
||||||
w = w.extrude(self.l)
|
w = w.extrude(self.l)
|
||||||
|
|
||||||
x = 20
|
x = 20
|
||||||
pts = []
|
pts = []
|
||||||
while x < self.l:
|
while x < self.l:
|
||||||
pts.append((x-self.l/2, 0))
|
pts.append((x - self.l / 2, 0))
|
||||||
x += 60
|
x += 60
|
||||||
#print("points", pts)
|
# print("points", pts)
|
||||||
w = (w.copyWorkplane(xy)
|
w = (
|
||||||
.transformed(offset=(0,0,17))
|
w.copyWorkplane(xy).transformed(offset=(0, 0, 17)).pushPoints(pts).hole(5)
|
||||||
.pushPoints(pts)
|
) # TODO replace with counterbore and get proper diameter
|
||||||
.hole(5)) # TODO replace with counterbore and get proper diameter
|
|
||||||
return w
|
return w
|
||||||
|
|
||||||
W = 44
|
W = 44
|
||||||
H = 30
|
H = 30
|
||||||
H1 = 4.6
|
H1 = 4.6
|
||||||
L = 77.5
|
L = 77.5
|
||||||
L1 = 50.1 # for HGH20CA, TODO deal with variations
|
L1 = 50.1 # for HGH20CA, TODO deal with variations
|
||||||
B = 32
|
B = 32
|
||||||
C = 36
|
C = 36
|
||||||
l = 5 # M5x6
|
l = 5 # M5x6
|
||||||
T = 6
|
T = 6
|
||||||
|
|
||||||
def carriage(self, x): # HGH20CA
|
def carriage(self, x): # HGH20CA
|
||||||
W = 44
|
W = 44
|
||||||
H = 30
|
H = 30
|
||||||
H1 = 4.6
|
H1 = 4.6
|
||||||
L = 77.5
|
L = 77.5
|
||||||
L1 = 50.1 # for HGH20CA, TODO deal with variations
|
L1 = 50.1 # for HGH20CA, TODO deal with variations
|
||||||
B = 32
|
B = 32
|
||||||
C = 36
|
C = 36
|
||||||
l = 5 # M5x6
|
l = 5 # M5x6
|
||||||
T = 6
|
T = 6
|
||||||
xy = cq.Workplane().copyWorkplane(self.base)
|
xy = cq.Workplane().copyWorkplane(self.base)
|
||||||
w = xy.transformed((90, 90, 0), (-self.l/2 + x, 0, 0)).tag("endplane")
|
w = xy.transformed((90, 90, 0), (-self.l / 2 + x, 0, 0)).tag("endplane")
|
||||||
# TODO
|
# TODO
|
||||||
|
|
||||||
|
s = (
|
||||||
s = (cq.Sketch()
|
cq.Sketch()
|
||||||
.segment((W/2, H1), (W/2, H))
|
.segment((W / 2, H1), (W / 2, H))
|
||||||
.segment((-W/2, H))
|
.segment((-W / 2, H))
|
||||||
.segment((-W/2, H1))
|
.segment((-W / 2, H1))
|
||||||
.segment((W/2, H1))
|
.segment((W / 2, H1))
|
||||||
.assemble()
|
.assemble()
|
||||||
)
|
)
|
||||||
s = s.face(HGR20.rail_sketch().assemble(), mode="s")
|
s = s.face(HGR20.rail_sketch().assemble(), mode="s")
|
||||||
s2 = (cq.Sketch()
|
s2 = (
|
||||||
.segment((W/2, H1), (W/2, H-3))
|
cq.Sketch()
|
||||||
.segment((-W/2, H-3))
|
.segment((W / 2, H1), (W / 2, H - 3))
|
||||||
.segment((-W/2, H1))
|
.segment((-W / 2, H - 3))
|
||||||
.segment((W/2, H1))
|
.segment((-W / 2, H1))
|
||||||
.assemble()
|
.segment((W / 2, H1))
|
||||||
)
|
.assemble()
|
||||||
|
)
|
||||||
s2 = s2.face(HGR20.rail_sketch().assemble(), mode="s")
|
s2 = s2.face(HGR20.rail_sketch().assemble(), mode="s")
|
||||||
|
|
||||||
pts = []
|
pts = []
|
||||||
|
|
||||||
def savePointsF(l, p):
|
def savePointsF(l, p):
|
||||||
l.append(p)
|
l.append(p)
|
||||||
return p
|
return p
|
||||||
#origin = w.workplane().plane.toWorldCoords(cq.Vector(0, 0, 0))
|
|
||||||
#norm = w.workplane().plane.toWorldCoords(cq.Vector(0, 1, 0))
|
# origin = w.workplane().plane.toWorldCoords(cq.Vector(0, 0, 0))
|
||||||
#norm = norm - origin
|
# norm = w.workplane().plane.toWorldCoords(cq.Vector(0, 1, 0))
|
||||||
#print(norm)
|
# norm = norm - origin
|
||||||
|
# print(norm)
|
||||||
# FINALLY GOT THIS WORKING
|
# FINALLY GOT THIS WORKING
|
||||||
w = (w.transformed((0, 0, 0), (0, 0, L/2-L1/2))
|
w = (
|
||||||
.placeSketch(s).extrude(L1)
|
w.transformed((0, 0, 0), (0, 0, L / 2 - L1 / 2))
|
||||||
.workplaneFromTagged("endplane")
|
.placeSketch(s)
|
||||||
.placeSketch(s2)
|
.extrude(L1)
|
||||||
.extrude(L)
|
.workplaneFromTagged("endplane")
|
||||||
#.faces(cq.DirectionMinMaxSelector(norm, True))
|
.placeSketch(s2)
|
||||||
.faces(">y")
|
.extrude(L)
|
||||||
.workplane()
|
# .faces(cq.DirectionMinMaxSelector(norm, True))
|
||||||
.transformed((0, 0, 0), (L/2 + x, 0, 0))
|
.faces(">y")
|
||||||
.rect(C, B)
|
.workplane()
|
||||||
.tag("mountingholes")
|
.transformed((0, 0, 0), (L / 2 + x, 0, 0))
|
||||||
.vertices() # carriage mounting holes are here!
|
.rect(C, B)
|
||||||
#.extrude(20)
|
.tag("mountingholes")
|
||||||
.hole(l, T)
|
.vertices() # carriage mounting holes are here!
|
||||||
)
|
# .extrude(20)
|
||||||
|
.hole(l, T)
|
||||||
|
)
|
||||||
return w
|
return w
|
||||||
|
|
||||||
def carriageHoles(self, w, x):
|
def carriageHoles(self, w, x):
|
||||||
W = 44
|
W = 44
|
||||||
H = 30
|
H = 30
|
||||||
H1 = 4.6
|
H1 = 4.6
|
||||||
L = 77.5
|
L = 77.5
|
||||||
L1 = 50.1 # for HGH20CA, TODO deal with variations
|
L1 = 50.1 # for HGH20CA, TODO deal with variations
|
||||||
B = 32
|
B = 32
|
||||||
C = 36
|
C = 36
|
||||||
l = 5 # M5x6
|
l = 5 # M5x6
|
||||||
T = 6
|
T = 6
|
||||||
xy = cq.Workplane().copyWorkplane(self.base).transformed(offset=(0, 0, H))
|
xy = cq.Workplane().copyWorkplane(self.base).transformed(offset=(0, 0, H))
|
||||||
holes = (xy.transformed((0, 0, 0), (-self.l/2+L/2 + x, 0, 0))
|
holes = (
|
||||||
.rect(C, B)
|
xy.transformed((0, 0, 0), (-self.l / 2 + L / 2 + x, 0, 0))
|
||||||
.vertices()
|
.rect(C, B)
|
||||||
.cylinder(1000, l/2)
|
.vertices()
|
||||||
)
|
.cylinder(1000, l / 2)
|
||||||
w = (w.cut(holes))
|
)
|
||||||
|
w = w.cut(holes)
|
||||||
return w
|
return w
|
||||||
|
|
||||||
|
|
||||||
class Plate:
|
class Plate:
|
||||||
# TODO add standard thicknesses here
|
# TODO add standard thicknesses here
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def inch(x):
|
def inch(x):
|
||||||
return 25.4*x
|
return 25.4 * x
|
||||||
|
|
||||||
|
|
||||||
def tubing(l, x, y, w, workplane):
|
def tubing(l, x, y, w, workplane):
|
||||||
return (workplane
|
return workplane.placeSketch(
|
||||||
.placeSketch(cq.Sketch()
|
cq.Sketch().rect(x, y).rect(x - 2 * w, y - 2 * w, mode="s")
|
||||||
.rect(x, y)
|
).extrude(l)
|
||||||
.rect(x - 2*w, y-2*w, mode='s'))
|
|
||||||
.extrude(l))
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
plate = (cq.Workplane("XY")
|
plate = (
|
||||||
.rect(200, 200)
|
cq.Workplane("XY")
|
||||||
.extrude(10)
|
.rect(200, 200)
|
||||||
.faces(">Z")
|
.extrude(10)
|
||||||
.workplane()
|
.faces(">Z")
|
||||||
.tag("railmount")
|
.workplane()
|
||||||
.end()
|
.tag("railmount")
|
||||||
)
|
.end()
|
||||||
|
)
|
||||||
|
|
||||||
hgr20 = HGR20(plate.workplaneFromTagged("railmount"), 300)
|
hgr20 = HGR20(plate.workplaneFromTagged("railmount"), 300)
|
||||||
plate2 = hgr20.holes(plate)
|
plate2 = hgr20.holes(plate)
|
||||||
hgrtest = hgr20.rail()
|
hgrtest = hgr20.rail()
|
||||||
carriage = hgr20.carriage(0)
|
carriage = hgr20.carriage(0)
|
||||||
plate3 = (cq.Workplane("XY")
|
plate3 = (
|
||||||
|
cq.Workplane("XY")
|
||||||
.copyWorkplane(carriage.workplaneFromTagged("mountingholes"))
|
.copyWorkplane(carriage.workplaneFromTagged("mountingholes"))
|
||||||
.rect(200, 200)
|
.rect(200, 200)
|
||||||
.extrude(5)
|
.extrude(5)
|
||||||
)
|
)
|
||||||
plate3 = hgr20.carriageHoles(plate3, 0)
|
plate3 = hgr20.carriageHoles(plate3, 0)
|
||||||
tube1 = tubing(500, inch(2), inch(1), inch(0.062), cq.Workplane("XZ"))
|
tube1 = tubing(500, inch(2), inch(1), inch(0.062), cq.Workplane("XZ"))
|
||||||
|
|
||||||
ball_screw = SFU1204(cq.Workplane(), 500)
|
ball_screw = SFU1204(cq.Workplane(), 500)
|
||||||
|
|
||||||
#show_object(plate2)
|
# show_object(plate2)
|
||||||
#show_object(hgrtest)
|
# show_object(hgrtest)
|
||||||
#show_object(carriage)
|
# show_object(carriage)
|
||||||
#show_object(plate3)
|
# show_object(plate3)
|
||||||
#show_object(tube1)
|
# show_object(tube1)
|
||||||
|
|
||||||
show_object(ball_screw.ballscrew())
|
show_object(ball_screw.ballscrew())
|
||||||
show_object(ball_screw.nut(200))
|
show_object(ball_screw.nut(200))
|
||||||
nut_holder = (cq.Workplane("XZ")
|
nut_holder = (
|
||||||
.transformed(offset=(0, 0, -200-50))
|
cq.Workplane("XZ")
|
||||||
|
.transformed(offset=(0, 0, -200 - 50))
|
||||||
.rect(40, 30)
|
.rect(40, 30)
|
||||||
.extrude(50)
|
.extrude(50)
|
||||||
.faces(">z")
|
.faces(">z")
|
||||||
|
@ -429,7 +452,8 @@ if __name__ == "__main__":
|
||||||
fixed = ball_screw.fixedBearing()
|
fixed = ball_screw.fixedBearing()
|
||||||
show_object(nut_holder)
|
show_object(nut_holder)
|
||||||
show_object(fixed)
|
show_object(fixed)
|
||||||
bearing_holder = (cq.Workplane("XZ")
|
bearing_holder = (
|
||||||
|
cq.Workplane("XZ")
|
||||||
.transformed(offset=(0, 0, 0))
|
.transformed(offset=(0, 0, 0))
|
||||||
.rect(60, 80)
|
.rect(60, 80)
|
||||||
.extrude(20)
|
.extrude(20)
|
||||||
|
@ -440,7 +464,8 @@ if __name__ == "__main__":
|
||||||
show_object(bearing_holder)
|
show_object(bearing_holder)
|
||||||
bearing2 = ball_screw.floatingBearing()
|
bearing2 = ball_screw.floatingBearing()
|
||||||
show_object(bearing2)
|
show_object(bearing2)
|
||||||
bearing_holder2 = (cq.Workplane("XZ")
|
bearing_holder2 = (
|
||||||
|
cq.Workplane("XZ")
|
||||||
.transformed(offset=(0, 0, -540))
|
.transformed(offset=(0, 0, -540))
|
||||||
.rect(60, 80)
|
.rect(60, 80)
|
||||||
.extrude(20)
|
.extrude(20)
|
||||||
|
@ -450,4 +475,5 @@ if __name__ == "__main__":
|
||||||
bearing_holder2 = ball_screw.floatingBearingHoles(bearing_holder2)
|
bearing_holder2 = ball_screw.floatingBearingHoles(bearing_holder2)
|
||||||
show_object(bearing_holder2)
|
show_object(bearing_holder2)
|
||||||
|
|
||||||
#show_object(cq.Workplane().placeSketch(HGR20.rail_sketch().assemble()).extrude(10))
|
# show_object(cq.Workplane().placeSketch(HGR20.rail_sketch().assemble()).extrude(10))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue