Sign in with STEVE

Compare versions

3 files changed, +44 −10 1.1.0: Real teeth. detail = simple keeps a plain bar.

part.py +26 −5
@@ -1,16 +1,37 @@
1"""Open-ended GT2 (2GT) timing belt as a straight envelope for assemblies: a bar of the belt's overall height and width, length along X, centred on the
2origin, back of the belt up. Teeth are not modelled."""
1"""Open-ended GT2 (2GT) timing belt, straight, 2 mm pitch: length along X, centred on the origin, back of the belt up, teeth down on the XY plane. detail = "full": the teeth along the
2length; tooth width is a proportion for looks, not for design (only the height and pitch are published). A belt over 500 mm carries teeth along 250 mm at each end, the middle at full
3height: more teeth build too slowly for a belt. detail = "simple": a plain bar of the belt's overall height."""
4import math
5
36from steve import Model
47
58width = 6 # mm Belt width
69length = 300 # mm Belt length
10detail = "full" # full: teeth; simple: a plain bar
711
812# Handson Technology, GT2 belt data sheet: 2 mm pitch, belt height 1.38 mm, tooth height 0.75 mm.
913HEIGHT = 1.38
14TOOTH_HEIGHT = 0.75
15PITCH = 2.0
16TOOTH_WIDTH = 1.2 # a proportion for looks
17TOOTHED_LENGTH = 500 # mm: the most of a belt that carries drawn teeth
1018
1119model = Model()
12with model.sketch("belt_sketch", on="XY", name="Belt") as sk:
13 sk.rect("outline", (-length / 2, -width / 2), (length / 2, width / 2))
14model.extrude("belt", "belt_sketch", distance=HEIGHT, name="Belt")
20if detail == "simple":
21 outline = [(-length / 2, 0), (length / 2, 0), (length / 2, HEIGHT), (-length / 2, HEIGHT)]
22else:
23 back = TOOTH_HEIGHT
24 outline = [(-length / 2, back), (-length / 2, HEIGHT), (length / 2, HEIGHT), (length / 2, back)]
25 count = int(length // PITCH)
26 centres = [(i - (count - 1) / 2) * PITCH for i in range(count)]
27 if length > TOOTHED_LENGTH: # teeth at both ends, so an end view shows them
28 kept = int(TOOTHED_LENGTH / 2 // PITCH)
29 centres = centres[:kept] + centres[-kept:]
30 for x in reversed(centres):
31 half = TOOTH_WIDTH / 2
32 outline += [(x + half, back), (x + half * 0.6, 0.0), (x - half * 0.6, 0.0), (x - half, back)]
33with model.sketch("belt_sketch", on="XZ", name="Belt section") as sk:
34 sk.polyline("outline", outline, closed=True)
35model.extrude("belt", "belt_sketch", distance=width, both=True, name="Belt")
1536result = model.result()
1637
pypart.toml +17 −3
@@ -1,11 +1,11 @@
11name = "steve/timing-belt"
2version = "1.0.0"
2version = "1.1.0"
33runtime = "steve"
44license = "MIT"
55summary = "GT2 (2GT) open timing belt as a straight envelope: width and length as parameters, with common lengths as presets."
6description = """Open-ended GT2 timing belt, 2 mm pitch, as a straight bar of the belt's overall height and width, for assemblies. Teeth are not modelled. \
7Length along X, centred on the origin. See the README; not affiliated with any belt brand."""
6description = """Open-ended GT2 timing belt, 2 mm pitch, straight, with its teeth. A belt over 500 mm carries teeth along 250 mm at each end. detail = simple is a plain bar of the overall height for big assemblies. Length along X, centred on the origin. See the README; not affiliated with any belt brand."""
87tags = ["belt", "timing-belt", "gt2", "2gt", "power-transmission"]
8changes = "Real teeth. detail = simple keeps a plain bar."
99
1010[parameters.width]
1111type = "number"
@@ -22,6 +22,13 @@
2222max = 5000
2323unit = "mm"
2424label = "Length"
25
26[parameters.detail]
27type = "choice"
28default = "full"
29choices = ["full", "simple"]
30label = "Detail"
31description = "full: teeth. simple: a plain bar of the overall height, for big assemblies."
2532
2633[[presets]]
2734id = "GT2-W6-L50"
@@ -121,3 +128,10 @@
121128aliases = ["GT2 9mm belt 1000", "GT2 9mm belt"]
122129standard = "Handson GT2"
123130
131[[presets]]
132id = "GT2-W6-L300-simple"
133title = "GT2 belt, 6 mm wide, 300 mm, simple (no teeth)"
134params = { width = 6, length = 300, detail = "simple" }
135aliases = ["GT2 belt simple"]
136standard = "Handson GT2"
137
README.md +1 −2
@@ -1,7 +1,6 @@
11# Timing belt (GT2)
22
3Open-ended GT2 (2GT) belt, 2 mm pitch, as a straight envelope. Length along X, centred on the origin, teeth side on the XY plane. The teeth
4aren't modelled.
3Open-ended GT2 (2GT) belt, 2 mm pitch, straight. Length along X, centred on the origin, teeth down on the XY plane. Tooth pitch and height are published; the tooth's width and taper are proportions for looks, not for design. A belt over 500 mm carries teeth along 250 mm at each end, because more take too long to build. `detail = "simple"` is a plain bar.
54
65## Source
76