Compare versions
3 files changed, +44 −10 1.1.0: Real teeth. detail = simple keeps a plain bar.
| @@ -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 | |
| 2 | origin, 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 | |
| 2 | length; 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 | |
| 3 | height: more teeth build too slowly for a belt. detail = "simple": a plain bar of the belt's overall height.""" | |
| 4 | import math | |
| 5 | ||
| 3 | 6 | from steve import Model |
| 4 | 7 | |
| 5 | 8 | width = 6 # mm Belt width |
| 6 | 9 | length = 300 # mm Belt length |
| 10 | detail = "full" # full: teeth; simple: a plain bar | |
| 7 | 11 | |
| 8 | 12 | # Handson Technology, GT2 belt data sheet: 2 mm pitch, belt height 1.38 mm, tooth height 0.75 mm. |
| 9 | 13 | HEIGHT = 1.38 |
| 14 | TOOTH_HEIGHT = 0.75 | |
| 15 | PITCH = 2.0 | |
| 16 | TOOTH_WIDTH = 1.2 # a proportion for looks | |
| 17 | TOOTHED_LENGTH = 500 # mm: the most of a belt that carries drawn teeth | |
| 10 | 18 | |
| 11 | 19 | model = Model() |
| 12 | with model.sketch("belt_sketch", on="XY", name="Belt") as sk: | |
| 13 | sk.rect("outline", (-length / 2, -width / 2), (length / 2, width / 2)) | |
| 14 | model.extrude("belt", "belt_sketch", distance=HEIGHT, name="Belt") | |
| 20 | if detail == "simple": | |
| 21 | outline = [(-length / 2, 0), (length / 2, 0), (length / 2, HEIGHT), (-length / 2, HEIGHT)] | |
| 22 | else: | |
| 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)] | |
| 33 | with model.sketch("belt_sketch", on="XZ", name="Belt section") as sk: | |
| 34 | sk.polyline("outline", outline, closed=True) | |
| 35 | model.extrude("belt", "belt_sketch", distance=width, both=True, name="Belt") | |
| 15 | 36 | result = model.result() |
| 16 | 37 |
| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | name = "steve/timing-belt" |
| 2 | version = "1.0.0" | |
| 2 | version = "1.1.0" | |
| 3 | 3 | runtime = "steve" |
| 4 | 4 | license = "MIT" |
| 5 | 5 | summary = "GT2 (2GT) open timing belt as a straight envelope: width and length as parameters, with common lengths as presets." |
| 6 | description = """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. \ | |
| 7 | Length along X, centred on the origin. See the README; not affiliated with any belt brand.""" | |
| 6 | description = """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.""" | |
| 8 | 7 | tags = ["belt", "timing-belt", "gt2", "2gt", "power-transmission"] |
| 8 | changes = "Real teeth. detail = simple keeps a plain bar." | |
| 9 | 9 | |
| 10 | 10 | [parameters.width] |
| 11 | 11 | type = "number" |
| @@ -22,6 +22,13 @@ | ||
| 22 | 22 | max = 5000 |
| 23 | 23 | unit = "mm" |
| 24 | 24 | label = "Length" |
| 25 | ||
| 26 | [parameters.detail] | |
| 27 | type = "choice" | |
| 28 | default = "full" | |
| 29 | choices = ["full", "simple"] | |
| 30 | label = "Detail" | |
| 31 | description = "full: teeth. simple: a plain bar of the overall height, for big assemblies." | |
| 25 | 32 | |
| 26 | 33 | [[presets]] |
| 27 | 34 | id = "GT2-W6-L50" |
| @@ -121,3 +128,10 @@ | ||
| 121 | 128 | aliases = ["GT2 9mm belt 1000", "GT2 9mm belt"] |
| 122 | 129 | standard = "Handson GT2" |
| 123 | 130 | |
| 131 | [[presets]] | |
| 132 | id = "GT2-W6-L300-simple" | |
| 133 | title = "GT2 belt, 6 mm wide, 300 mm, simple (no teeth)" | |
| 134 | params = { width = 6, length = 300, detail = "simple" } | |
| 135 | aliases = ["GT2 belt simple"] | |
| 136 | standard = "Handson GT2" | |
| 137 |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | # Timing belt (GT2) |
| 2 | 2 | |
| 3 | Open-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 | |
| 4 | aren't modelled. | |
| 3 | Open-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. | |
| 5 | 4 | |
| 6 | 5 | ## Source |
| 7 | 6 |