migrate pretiosus from ipynp to py
This commit is contained in:
parent
7c9ab943c7
commit
6ee7dd5fb1
8
.gitignore
vendored
Normal file
8
.gitignore
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
bin
|
||||||
|
include
|
||||||
|
lib64
|
||||||
|
share
|
||||||
|
lib
|
||||||
|
*.step
|
||||||
|
*.stl
|
||||||
|
*.cfg
|
||||||
258
pretiosius.py
Normal file
258
pretiosius.py
Normal file
@ -0,0 +1,258 @@
|
|||||||
|
#%%
|
||||||
|
from build123d import *
|
||||||
|
from ocp_vscode import *
|
||||||
|
from math import sin, cos, pi
|
||||||
|
|
||||||
|
import copy
|
||||||
|
set_defaults(reset_camera=Camera.KEEP, render_joints=True, helper_scale=8)
|
||||||
|
# %%
|
||||||
|
y = 120
|
||||||
|
height = 6
|
||||||
|
pad = 2
|
||||||
|
s = 0.8
|
||||||
|
s1 = 0.7
|
||||||
|
#%%
|
||||||
|
with BuildPart() as ring:
|
||||||
|
with BuildSketch(Plane.XY) as sk:
|
||||||
|
with BuildLine() as outline:
|
||||||
|
c1 = Bezier((-pad,y,0),(-pad,y+3,0),(height+pad,y+3,0),(height+pad, y, 0))
|
||||||
|
c2 = Bezier((-pad,y,0),(-pad,y-2,0),(height+pad,y-2,0),(height+pad, y, 0))
|
||||||
|
|
||||||
|
#c1 = Spline([(-pad,y,0),(height+pad,y,0)], tangents=[(0,1),( 0,-1)], tangent_scalars=[s,s])
|
||||||
|
#c2 = Spline([(-pad,y,0),(height+pad,y,0)], tangents=[(0,-1),(0,1)], tangent_scalars=[s1,s1])
|
||||||
|
|
||||||
|
make_face()
|
||||||
|
revolve(axis=Axis.X)
|
||||||
|
|
||||||
|
show(ring,outline)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
outer_ring_surface = Face.revolve(c1, 360, Axis.X)
|
||||||
|
# cut ring in half and use the outer edge that got created by the cut
|
||||||
|
#outer_ring_path = (copy.copy(ring.part)-(Pos(X=10+height/2)*Box(20,50,50))).edges().sort_by(Axis.X)[-1]
|
||||||
|
outer_ring_path = ring.part.edges().sort_by(Axis.X)[0]
|
||||||
|
|
||||||
|
show(ring,outer_ring_surface,outer_ring_path)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
def sinus_signal(periods, width, height,n):
|
||||||
|
dw = (width) / (n-1)
|
||||||
|
dphi = periods * 2 * pi / (n-1)
|
||||||
|
t = 0.5 # thickness
|
||||||
|
pts = [( t+0.1+dw*i, t+0.1+(height/2)*(1+sin(dphi*i))) for i in range(n)]
|
||||||
|
with BuildSketch() as sk:
|
||||||
|
with BuildLine() as signal:
|
||||||
|
Polyline(pts)
|
||||||
|
offset(amount=t)
|
||||||
|
make_face()
|
||||||
|
return sk
|
||||||
|
|
||||||
|
sig = sinus_signal(1,outer_ring_path.length/3, 5, 60)
|
||||||
|
show(sig)
|
||||||
|
#%%
|
||||||
|
wrapped_sig = outer_ring_surface.wrap_faces(sig.faces(), outer_ring_path)
|
||||||
|
|
||||||
|
show(ring, wrapped_sig)
|
||||||
|
|
||||||
|
# %%
|
||||||
|
width = 3
|
||||||
|
|
||||||
|
ri = 10
|
||||||
|
rm = ri+2
|
||||||
|
ro = ri+4
|
||||||
|
|
||||||
|
|
||||||
|
p = Pos(ri,0,0)
|
||||||
|
|
||||||
|
def string_to_binary_string(s:str):
|
||||||
|
return ''.join(["{0:08b}".format(ord(c)) for c in s])
|
||||||
|
|
||||||
|
def build_signal2D(binstring, width):
|
||||||
|
hheight = height - 1
|
||||||
|
print(f"{width=} {hheight=}")
|
||||||
|
n = len(binstring)
|
||||||
|
dw = width/n
|
||||||
|
h = 0.5 if binstring[0] == "0" else hheight
|
||||||
|
pts = [(h,+ 0.5)]
|
||||||
|
for i, b in enumerate(binstring):
|
||||||
|
pos_flank = (b == "0" and binstring[(i+1)%n] == "1")
|
||||||
|
neg_flank = (b == "1" and binstring[(i+1)%n] == "0")
|
||||||
|
#print(f"{pos_flank*1}{neg_flank*1}")
|
||||||
|
if pos_flank or neg_flank:
|
||||||
|
x = dw*(1+i) if i < len(binstring)-1 else dw*(1+i) -0.5
|
||||||
|
pts.append((h,x))
|
||||||
|
#print(f"- {i} {b}")
|
||||||
|
if pos_flank:
|
||||||
|
h = hheight
|
||||||
|
#print(f"^ {i} {b}")
|
||||||
|
pts.append((h,x))
|
||||||
|
if neg_flank:
|
||||||
|
#print(f"v {i} {b}")
|
||||||
|
h = 0.5
|
||||||
|
pts.append((h,x))
|
||||||
|
#print(f"{pts = }")
|
||||||
|
with BuildSketch() as sk:
|
||||||
|
with BuildLine() as signal:
|
||||||
|
Polyline(pts)
|
||||||
|
offset(amount=0.4)
|
||||||
|
make_face()
|
||||||
|
#rrr = Rectangle(width, height,mode=Mode.PRIVATE)
|
||||||
|
return sk
|
||||||
|
|
||||||
|
# %%
|
||||||
|
sig = build_signal2D("100010",outer_ring_path.length-0.0)
|
||||||
|
show(sig.face())
|
||||||
|
# %%
|
||||||
|
wrapped_sig = outer_ring_surface.wrap_faces(sig.faces(), outer_ring_path)
|
||||||
|
|
||||||
|
show(ring, wrapped_sig)
|
||||||
|
#show(sig)
|
||||||
|
|
||||||
|
|
||||||
|
# %%
|
||||||
|
def build_signal_A(binstring, ri):
|
||||||
|
n = len(binstring)
|
||||||
|
ro = ri+1
|
||||||
|
dphi =2*pi/(n+0)
|
||||||
|
dp = dphi/10
|
||||||
|
dh = min(dp*ro, 18*pi/180)
|
||||||
|
|
||||||
|
a = 1
|
||||||
|
tngu = lambda phi, d: (a*cos(phi), a*sin(phi), d)
|
||||||
|
tngd = lambda phi, d: (-a*cos(phi), -a*sin(phi), d)
|
||||||
|
|
||||||
|
with BuildPart() as signal:
|
||||||
|
with BuildLine(Plane.XY) as path_builder:
|
||||||
|
segments = []
|
||||||
|
h = 0 if binstring[0] == "0" else height
|
||||||
|
same_bits_streak = 0
|
||||||
|
for i, b in enumerate(binstring):
|
||||||
|
pos_flank = (b == "0" and binstring[(i+1)%n] == "1")
|
||||||
|
neg_flank = (b == "1" and binstring[(i+1)%n] == "0")
|
||||||
|
same_bits_streak += 1
|
||||||
|
if neg_flank or pos_flank or (i == n-1):
|
||||||
|
phi0 = dphi*(i-same_bits_streak+1)
|
||||||
|
phi1 = dphi*(i-same_bits_streak+1+0.5*same_bits_streak)
|
||||||
|
phi2 = dphi*(i+1)
|
||||||
|
phi0_pad = phi0 + dp
|
||||||
|
phi2_pad = phi2 - dp
|
||||||
|
#if segments:
|
||||||
|
# segments.append(Spline(segments[-1]@1,p1, tangents=[segments[-1]%1, tngu(phi2, -1)]))
|
||||||
|
segments.append(ThreePointArc(
|
||||||
|
(ri * cos(phi0_pad), ri * sin(phi0_pad),h),
|
||||||
|
(ri * cos(phi1), ri * sin(phi1),h),
|
||||||
|
(ri * cos(phi2_pad), ri * sin(phi2_pad),h),
|
||||||
|
))
|
||||||
|
same_bits_streak = 0
|
||||||
|
p1 = (ri * cos(phi2), ri * sin(phi2),height-dh)
|
||||||
|
p2 = (ri * cos(phi2), ri * sin(phi2),dh)
|
||||||
|
#l = segments[i]
|
||||||
|
if neg_flank:
|
||||||
|
h = 0
|
||||||
|
segments.append(Spline(segments[-1]@1,p1, tangents=[segments[-1]%1, tngu(phi2, -1)]))
|
||||||
|
segments.append(Spline(p1,p2,
|
||||||
|
tangents=[tngu(phi2, -1), tngd(phi2, -1)]))
|
||||||
|
if pos_flank:
|
||||||
|
h = height
|
||||||
|
segments.append(Spline(p2,p1,
|
||||||
|
tangents=[tngu(phi2, 1), tngd(phi2, 1)]))
|
||||||
|
|
||||||
|
# l1 = segments[0]
|
||||||
|
with BuildSketch(Plane( segments[0] @ 0, z_dir=segments[0] % 0)) as x_section:
|
||||||
|
Circle(0.5)
|
||||||
|
#return path_builder
|
||||||
|
sweep(transition=Transition.ROUND)
|
||||||
|
return signal
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def build_signal_B(binstring, ri):
|
||||||
|
n = len(binstring)
|
||||||
|
ro = ri+1
|
||||||
|
dphi =2*pi/(n+0) # how much angle per bit
|
||||||
|
dp = 0.81/ri/pi#dphi/10 # how much of that used for curvature
|
||||||
|
dh = min(dp*ro, 10*pi/180)
|
||||||
|
|
||||||
|
a = 1
|
||||||
|
tngu = lambda phi, d: (a*cos(phi), a*sin(phi), d)
|
||||||
|
tngd = lambda phi, d: (-a*cos(phi), -a*sin(phi), d)
|
||||||
|
|
||||||
|
def build_segments(pre_segments=[]):
|
||||||
|
segments = []
|
||||||
|
h = 0 if binstring[0] == "0" else height
|
||||||
|
same_bits_streak = 0
|
||||||
|
i_hoz = 0
|
||||||
|
ns = len(pre_segments)
|
||||||
|
for i, b in enumerate(binstring):
|
||||||
|
pos_flank = b == "0" and binstring[(i+1)%n] == "1"
|
||||||
|
neg_flank = b == "1" and binstring[(i+1)%n] == "0"
|
||||||
|
same_bits_streak += 1
|
||||||
|
if neg_flank or pos_flank or (i == n-1):
|
||||||
|
phi0 = dphi*(i-same_bits_streak+1)
|
||||||
|
phi1 = dphi*(i-same_bits_streak+1+0.5*same_bits_streak)
|
||||||
|
phi2 = dphi*(i+1)
|
||||||
|
phi0_pad = phi0 + dp
|
||||||
|
phi2_pad = phi2 - dp
|
||||||
|
#if segments:
|
||||||
|
# segments.append(Spline(segments[-1]@1,p1, tangents=[segments[-1]%1, tngu(phi2, -1)]))
|
||||||
|
segments.append(ThreePointArc(
|
||||||
|
(ri * cos(phi0_pad), ri * sin(phi0_pad),h),
|
||||||
|
(ri * cos(phi1), ri * sin(phi1),h),
|
||||||
|
(ri * cos(phi2_pad), ri * sin(phi2_pad),h),
|
||||||
|
))
|
||||||
|
i_hoz += 1
|
||||||
|
same_bits_streak = 0
|
||||||
|
p1 = (ri * cos(phi2), ri * sin(phi2),height-dh)
|
||||||
|
p2 = (ri * cos(phi2), ri * sin(phi2),dh)
|
||||||
|
#l = segments[i]
|
||||||
|
if neg_flank:
|
||||||
|
h = 0
|
||||||
|
if pre_segments:
|
||||||
|
segments.append(Spline(pre_segments[i_hoz-1]@1,p1, tangents=[pre_segments[i_hoz-1]%1, tngu(phi2, -1)]))
|
||||||
|
segments.append(Spline(p1,p2,
|
||||||
|
tangents=[tngu(phi2, -1), tngd(phi2, -1)]))
|
||||||
|
segments.append(Spline(p2, pre_segments[i_hoz%ns]@0, tangents=[tngd(phi2, -1), pre_segments[i_hoz%ns]%0]))
|
||||||
|
if pos_flank:
|
||||||
|
h = height
|
||||||
|
if pre_segments:
|
||||||
|
segments.append(Spline(pre_segments[i_hoz-1]@1,p2, tangents=[pre_segments[i_hoz-1]%1, tngu(phi2, 1)]))
|
||||||
|
segments.append(Spline(p2,p1,
|
||||||
|
tangents=[tngu(phi2, 1), tngd(phi2, 1)]))
|
||||||
|
segments.append(Spline(p1, pre_segments[i_hoz%ns]@0, tangents=[tngd(phi2, 1), pre_segments[i_hoz%ns]%0]))
|
||||||
|
|
||||||
|
return segments
|
||||||
|
|
||||||
|
pre_segments = build_segments()#???
|
||||||
|
|
||||||
|
|
||||||
|
with BuildPart() as signal:
|
||||||
|
with BuildLine(Plane.XY) as path_builder:
|
||||||
|
#path_builder.mode=Mode.PRIVATE
|
||||||
|
segments = build_segments(pre_segments)
|
||||||
|
#segments = build_segments()
|
||||||
|
# l1 = segments[0]
|
||||||
|
with BuildSketch(Plane(segments[0] @ 0, z_dir=segments[0] % 0)) as x_section:
|
||||||
|
Circle(0.4)
|
||||||
|
#Rectangle(0.8,0.8)
|
||||||
|
#return path_builder
|
||||||
|
sweep()
|
||||||
|
#sweep(transition=Transition.ROUND)
|
||||||
|
signal.label="decor"
|
||||||
|
#return pre_segments
|
||||||
|
return path_builder
|
||||||
|
#return signal
|
||||||
|
|
||||||
|
# %%
|
||||||
|
#binstr = '0101100'#
|
||||||
|
#binstr = '110101000'#
|
||||||
|
binstr = string_to_binary_string("munsel")
|
||||||
|
#binstr = string_to_binary_string("nonpostrans")
|
||||||
|
signal = build_signal_B(binstr, ri+width+0.3)
|
||||||
|
#show(signal,ring, transparent=True)
|
||||||
|
show(signal, transparent=True)
|
||||||
|
|
||||||
|
|
||||||
|
#%%
|
||||||
|
product = Compound(label="ring", children=[ring.part, signal.part])
|
||||||
|
show(product)
|
||||||
62
psorias_releaser.py
Normal file
62
psorias_releaser.py
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
def build_psorias_release(L = 216, W = 127, H = 135,PEAK2PEAK = 160, h_bottom = 15):
|
||||||
|
|
||||||
|
R0 = 40
|
||||||
|
R1 = 8
|
||||||
|
R2 = 40
|
||||||
|
R3 = 30
|
||||||
|
w_cut_inside = (PEAK2PEAK / 2) - R1-1
|
||||||
|
w_cut_outside = (L / 2) - w_cut_inside - (2 * R1)
|
||||||
|
print(f"{w_cut_inside = } {w_cut_outside = }")
|
||||||
|
|
||||||
|
h_bend = 70
|
||||||
|
w_bend = w_cut_outside - 8
|
||||||
|
h_rect = 10
|
||||||
|
w_slope = 10
|
||||||
|
|
||||||
|
|
||||||
|
with BuildPart() as p:
|
||||||
|
with BuildSketch(Plane.XZ) as s:
|
||||||
|
with Locations((0,H-R0)):
|
||||||
|
Circle(R0)
|
||||||
|
with Locations((0,0)):
|
||||||
|
Rectangle(W, h_rect)
|
||||||
|
make_hull()
|
||||||
|
extrude(amount=L/2)
|
||||||
|
with BuildSketch(Plane.YZ.offset(-W/2)) as s:
|
||||||
|
with Locations((-(L-w_cut_inside)/2, H+h_rect/2)):
|
||||||
|
Rectangle(w_cut_inside, h_rect)
|
||||||
|
with Locations(((-L+w_cut_inside-w_slope-R2-1)/2, h_bottom+h_rect/2)):
|
||||||
|
Rectangle(w_cut_inside-w_slope-R2, h_rect)
|
||||||
|
with Locations((-(L-w_cut_inside+R2-w_slope)/2, h_bottom+R2)):
|
||||||
|
Circle(R2)
|
||||||
|
make_hull()
|
||||||
|
extrude(amount=W, mode=Mode.SUBTRACT)
|
||||||
|
with BuildSketch(Plane.YZ.offset(-W/2)) as s:
|
||||||
|
with Locations((-w_cut_outside/2, H+h_rect/2)):
|
||||||
|
Rectangle(w_cut_outside, h_rect)
|
||||||
|
with Locations(((h_rect)/2, h_rect)):
|
||||||
|
Rectangle(h_rect, h_rect)
|
||||||
|
with Locations((-w_bend+R3, h_bend)):
|
||||||
|
Circle(R3)
|
||||||
|
make_hull()
|
||||||
|
extrude(amount=W, mode=Mode.SUBTRACT)
|
||||||
|
fillet(p.edges().sort_by(Axis.Z)[-1], radius=R1)
|
||||||
|
fillet(p.edges().sort_by(Axis.Z)[-3], radius=R1)
|
||||||
|
#scale(by=(1,1,0.8), mode=Mode.SUBTRACT)
|
||||||
|
mirror(p.part, about=Plane(p.faces().group_by(Axis.Y)[0][0]))
|
||||||
|
return p
|
||||||
|
|
||||||
|
p = build_psorias_release()
|
||||||
|
p1 = build_psorias_release(L = 216, W = 110, H = 100,PEAK2PEAK = 160, h_bottom = 15)
|
||||||
|
p2 = p.part - p1.part.locate(Location((0.,0,-25.)))
|
||||||
|
|
||||||
|
p2
|
||||||
|
|
||||||
|
# %%
|
||||||
|
p1 = copy.copy(p.part)
|
||||||
|
p1 = scale(p1, by=(0.8,0.95,0.8)).locate(Location((0.,-(1-0.95)*W/2.-2.5,-25.)))
|
||||||
|
p2 = p.part-p1
|
||||||
|
|
||||||
|
p2.export_step("psoas_releaser.step")
|
||||||
|
|
||||||
|
|
||||||
145
water_blesser.py
145
water_blesser.py
@ -1,7 +1,7 @@
|
|||||||
#%%
|
#%%
|
||||||
from build123d import *
|
from build123d import *
|
||||||
from ocp_vscode import *
|
from ocp_vscode import *
|
||||||
from bd_animation import AnimationGroup, clone, normalize_track
|
#from bd_animation import AnimationGroup, clone, normalize_track
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
set_defaults(reset_camera=Camera.KEEP, render_joints=True, helper_scale=8)
|
set_defaults(reset_camera=Camera.KEEP, render_joints=True, helper_scale=8)
|
||||||
@ -83,7 +83,43 @@ show(psu_holder)
|
|||||||
|
|
||||||
# %%
|
# %%
|
||||||
rg=74
|
rg=74
|
||||||
with BuildPart() as glass_holder:
|
rg1=83
|
||||||
|
rg2=68
|
||||||
|
rgr=2
|
||||||
|
|
||||||
|
with BuildPart() as glassholder_rod:
|
||||||
|
with BuildLine(Plane.XZ) as ghp:
|
||||||
|
FilletPolyline((rg/2+rgr,3),(rg/2+rgr,10),(rg/4,20),(rg/4,60),(rg1/2+rgr,114),\
|
||||||
|
(rg2/2+rgr,200),radius=10)
|
||||||
|
with BuildSketch(Plane((rg/2+rgr,0,0),z_dir=(0,0,1))):
|
||||||
|
Rectangle(rgr*2,rgr*2)
|
||||||
|
sweep()
|
||||||
|
# lower screw mounts
|
||||||
|
with BuildSketch():
|
||||||
|
with Locations((rg/2,-2)):
|
||||||
|
Circle(6)
|
||||||
|
with Locations((rg/2+2,-4)):
|
||||||
|
Circle(1.55,mode=Mode.SUBTRACT)
|
||||||
|
extrude(amount=3)
|
||||||
|
# upper screw mounts
|
||||||
|
with BuildSketch(Plane.XY.offset(197)):
|
||||||
|
with Locations((rg/2,-2)):
|
||||||
|
Circle(6)
|
||||||
|
with Locations((rg/2+2,-4)):
|
||||||
|
Circle(1.55,mode=Mode.SUBTRACT)
|
||||||
|
extrude(amount=3)
|
||||||
|
Cylinder(rg/2,6,mode=Mode.SUBTRACT)
|
||||||
|
with Locations((0,0,197)):
|
||||||
|
Cylinder(rg2/2,6,mode=Mode.SUBTRACT)
|
||||||
|
with Locations((rg2/2,8)):
|
||||||
|
Box(30,12,500,mode=Mode.SUBTRACT)
|
||||||
|
#with Locations((0,0,200))
|
||||||
|
show(glassholder_rod, ghp)
|
||||||
|
# %%
|
||||||
|
export_step(glassholder_rod.part, 'glassholder_rod.step')
|
||||||
|
|
||||||
|
# %%
|
||||||
|
with BuildPart() as glass_holder_base:
|
||||||
with BuildSketch() as sk:
|
with BuildSketch() as sk:
|
||||||
Circle(rg/2+2)
|
Circle(rg/2+2)
|
||||||
extrude(amount=4.5)
|
extrude(amount=4.5)
|
||||||
@ -98,9 +134,112 @@ with BuildPart() as glass_holder:
|
|||||||
Cylinder(rg/2,3,mode=Mode.SUBTRACT)
|
Cylinder(rg/2,3,mode=Mode.SUBTRACT)
|
||||||
with Locations((-rg/4-1,0,6)):
|
with Locations((-rg/4-1,0,6)):
|
||||||
Box(rg/2+2,rg+4,10,mode=Mode.SUBTRACT)
|
Box(rg/2+2,rg+4,10,mode=Mode.SUBTRACT)
|
||||||
fillet(glass_holder.edges().group_by(Axis.Z)[5].filter_by(GeomType.CIRCLE), radius=1.6)
|
fillet(glass_holder_base.edges().group_by(Axis.Z)[5].filter_by(GeomType.CIRCLE), radius=1.6)
|
||||||
Cylinder(rg/2-10, 2,mode=Mode.SUBTRACT)
|
Cylinder(rg/2-10, 2,mode=Mode.SUBTRACT)
|
||||||
|
|
||||||
|
with PolarLocations(rgr,3):
|
||||||
|
with Locations((rg/2,-2,0)):
|
||||||
|
Cylinder(6,1,align=[Align.CENTER,Align.CENTER,Align.MIN])
|
||||||
|
with Locations((rg/2+2,-4)):
|
||||||
|
Cylinder(1.55,10,mode=Mode.SUBTRACT)
|
||||||
|
show(glass_holder_base)
|
||||||
|
# %%
|
||||||
|
export_step(glass_holder_base.part, 'glassholder_base.step')
|
||||||
|
|
||||||
|
#%%
|
||||||
|
with BuildPart() as glassholder_top:
|
||||||
|
with BuildSketch(Plane.XY.offset(200)):
|
||||||
|
Circle(rg2/2+rgr*2)
|
||||||
|
with Locations((-rg2/2+6,0)):
|
||||||
|
Rectangle(14,rg)
|
||||||
|
Circle(rg2/2,mode=Mode.SUBTRACT)
|
||||||
|
with PolarLocations(rgr,3):
|
||||||
|
with Locations((rg2/2,-2,0)):
|
||||||
|
Circle(6)
|
||||||
|
with Locations((rg2/2+2,-4)):
|
||||||
|
Circle(1.55,mode=Mode.SUBTRACT)
|
||||||
|
extrude(amount=4)
|
||||||
|
with Locations((-rg2/2+4,-rg2/2-5,202),(-rg2/2+4,rg2/2+5,202)):
|
||||||
|
Cylinder(5.6/2, 20, rotation=(90,0,0))
|
||||||
|
Cylinder(rg2/2, 500, mode=Mode.SUBTRACT)
|
||||||
|
with Locations((0,0,205),(0,0,199)):
|
||||||
|
Box(120,120,2,mode=Mode.SUBTRACT)
|
||||||
|
|
||||||
|
show(glassholder_top)
|
||||||
|
# %%
|
||||||
|
export_step(glassholder_top.part, "glassholder_top.step")
|
||||||
|
|
||||||
|
#%%
|
||||||
|
with BuildPart() as glassstem_holder:
|
||||||
|
with Locations((-8.5,0,0)):
|
||||||
|
Box(10,rg/2,2)
|
||||||
|
with PolarLocations(rg/4+2, 3):
|
||||||
|
Box(4,4,100,mode=Mode.SUBTRACT)
|
||||||
|
fillet(glassstem_holder.edges().group_by(Axis.X)[-1].filter_by(Axis.Z), radius=4)
|
||||||
|
|
||||||
|
show(glassstem_holder)
|
||||||
|
export_step(glassstem_holder.part, "glassstem_holder.step")
|
||||||
|
# %%
|
||||||
|
with BuildPart() as glass_holder:
|
||||||
|
add(glass_holder_base)
|
||||||
|
with PolarLocations(rgr,3):
|
||||||
|
add(copy.copy(glassholder_rod))
|
||||||
|
add(glassholder_top)
|
||||||
|
with Locations((0,0,50)):
|
||||||
|
add(glassstem_holder)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
show(glass_holder)
|
show(glass_holder)
|
||||||
# %%
|
# %%
|
||||||
show(glass_holder.edges().group_by(Axis.Z)[5].filter_by(GeomType.CIRCLE))
|
show(glass_holder.edges().group_by(Axis.Z)[5].filter_by(GeomType.CIRCLE))
|
||||||
# %%
|
# %%
|
||||||
|
def splintgen(m=1.45,h=7.2):
|
||||||
|
with BuildPart() as snapfit_splint:
|
||||||
|
with BuildSketch() as sn_sk:
|
||||||
|
with BuildLine():
|
||||||
|
Polyline((0,0),(m+0.5,0),(m+0.5,1),(m,1),(m,h),(m+0.5,h),(m+0.5,h+0.5),\
|
||||||
|
(m,h+m),(m/2,h+m),(0,m*3),close=True)
|
||||||
|
make_face()
|
||||||
|
mirror(about=Plane.YZ)
|
||||||
|
extrude(amount=m)#50% radius
|
||||||
|
return snapfit_splint
|
||||||
|
|
||||||
|
m3x7_splint = splintgen(h=8.5)
|
||||||
|
show(m3x7_splint)
|
||||||
|
#%%
|
||||||
|
export_step(m3x7_splint.part, "m3x8_splint.step")
|
||||||
|
|
||||||
|
# %%
|
||||||
|
with BuildPart() as bearing_mount:
|
||||||
|
d=19.4
|
||||||
|
t = 1
|
||||||
|
Cylinder(d/2+t,7+1)
|
||||||
|
#Cylinder(d/2,7,mode=Mode.SUBTRACT)
|
||||||
|
#Cylinder(d/2-1,9,mode=Mode.SUBTRACT)
|
||||||
|
with Locations((-d/2-t,0,4.5)):
|
||||||
|
Box(1,36,17)
|
||||||
|
fillet(bearing_mount.edges(Select.NEW).filter_by(Axis.Z),radius=7)
|
||||||
|
Cylinder(d/2,7,mode=Mode.SUBTRACT)
|
||||||
|
Cylinder(d/2-1,9,mode=Mode.SUBTRACT)
|
||||||
|
with Locations((-d/2-t,0,28.5)):
|
||||||
|
Box(1,80,40)
|
||||||
|
fillet(bearing_mount.edges(Select.NEW).filter_by(Axis.X),radius=10)
|
||||||
|
|
||||||
|
with BuildSketch(Plane.YZ.offset(-d/2-t)):
|
||||||
|
with Locations((0,28.5)):
|
||||||
|
with GridLocations(12,6,6,6):
|
||||||
|
RectangleRounded(10,4,1)
|
||||||
|
with GridLocations(75,10,2,4):
|
||||||
|
Circle(1.5)
|
||||||
|
extrude(amount=2,mode=Mode.SUBTRACT,both=True)
|
||||||
|
|
||||||
|
with Locations((d/2,0,0)):
|
||||||
|
Box(10,10,10,mode=Mode.SUBTRACT)
|
||||||
|
fillet(bearing_mount.edges(Select.NEW).filter_by(Axis.Z).group_by(Axis.X)[-1],radius=0.5)
|
||||||
|
|
||||||
|
show(bearing_mount)
|
||||||
|
# %%
|
||||||
|
export_step(bearing_mount.part, "bearing_mount.step")
|
||||||
|
# %%
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user