-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsingle_wedge.py
111 lines (97 loc) · 3.69 KB
/
single_wedge.py
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
"""
MIT License
Copyright (c) 2024 Roger Cheng
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
"""
Single Wedge
This file is intended for use in CQ-Editor and visualize a single wedge of
the spent spool storage system with given parameters.
"""
import math
import r2s4
# Calculate spool inner radius from measuring circumference of spool center
#spool_inner_circumference = 283 # MH Build
spool_inner_circumference = 347 # Filament PM
inner_radius = spool_inner_circumference / (math.pi*2)
# Outer spool diameter is easier to measure directly
spool_outer_diameter = 200 # MH Build, Filament PM
spool_outer_radius = spool_outer_diameter / 2
#######################################################################
#
# Dimensions of target spent spool spindle
#
#spool_height = 55 # MH Build
spool_height = 70 # Filament PM
#######################################################################
#
# How big of a wedge we want in degrees
#
wedge_size = 15
#######################################################################
#
# Additional space between mating surfaces due to 3D printing inaccuracy.
# May require adjustment to fit specific combinations of printer,
# filment, print profile, etc.
#
# Dimensionally perfect printes will generate pieces that fit together
# snugly with this value set to zero. This is rare. Due to layer-to-
# layer variations, nozzle erosion, etc. Most 3D printers will need a
# little extra clearance to fit well.
#
# If base segments don't fit into each other, increase this value.
# If they fit too loosely, decrease this value.
#
# Recommend increasing/decreasing in increments of 0.05mm
#
# If fit is still loose at no additional clearance, the printer has an
# under-extrusion issue that needs to be investigated.
#
# If fit is still tight at 0.4mm... that's the diameter of the nozzle!
# the printer has an accuracy issue that needs to be resolved.
#
additional_clearance = 0.1 # mm
#######################################################################
#
# Build and show
#
show_object(
r2s4.build_base(
inner_radius,
spool_outer_radius,
spool_height,
wedge_size,
additional_clearance
).rotate((0,0,0),(0,0,1),-wedge_size/2),
options = {"alpha":0.5, "color":"green"})
show_object(
r2s4.build_placeholder(
inner_radius,
spool_outer_radius,
spool_height,
wedge_size,
additional_clearance
).rotate((0,0,0),(0,0,1),-wedge_size/2)
.translate((0,0,-15)),
options = {"alpha":0.5, "color":"aquamarine"})
show_object(r2s4.build_tray(
inner_radius,
spool_outer_radius,
spool_height,
wedge_size
).rotate((0,0,0),(0,0,1),-wedge_size/2),
options = {"alpha":0.5, "color":"red"})