steve/deep-groove-ball-bearing
Deep groove ball bearing, metric: 6xx, MR, 60, 62, 63, 68 and 69 series, open, ZZ or 2RS, optional flange.
HIWIN MGN miniature linear guideway, sizes 7, 9, 12 and 15: rail (MGNR) or block (MGN-C / MGN-H).
Not affiliated with or endorsed by HIWIN.
| 1 | """HIWIN MGN miniature linear guideway (MG series, standard width), sizes 7, 9, 12 and 15: the rail MGNR or a block |
| 2 | MGN-C / MGN-H. |
| 3 | |
| 4 | Envelope model for assemblies from HIWIN's dimension table (Linear Guideway Technical Information, FORM |
| 5 | G99TE24-2410, section 2-4-19 (1), printed page 88): |
| 6 | - rail: a WR x HR bar of length `rail_length` along X, centred on the origin, base on the XY plane, with mounting |
| 7 | holes (through hole d, counterbore D deep h) from E at the -X end at pitch P while at least E from the +X end; |
| 8 | - block: a W x L body from H1 (its underside above the rail's base) to H, centred on the origin, length L along X, |
| 9 | with the rail's WR x HR section as the channel through it and four M x l tapped holes (drawn at the thread's |
| 10 | nominal diameter) at B (across) x C (along). |
| 11 | The ball tracks, end seals, end caps' shape and the grease nipple are not modelled. |
| 12 | """ |
| 13 | from steve import Model |
| 14 | |
| 15 | size = "MGN12" # Size |
| 16 | component = "rail" # Component: rail, block-C, block-H |
| 17 | rail_length = 70 # mm Rail length (rail only) |
| 18 | |
| 19 | # HIWIN FORM G99TE24-2410, 2-4-19 (1) MGN-C / MGN-H, mm. Block: H, H1, N, W, B, B1, (M, l) the mounting thread. |
| 20 | BLOCKS = { |
| 21 | "MGN7": (8, 1.5, 5, 17, 12, 2.5, 2, 2.5), |
| 22 | "MGN9": (10, 2, 5.5, 20, 15, 2.5, 3, 3), |
| 23 | "MGN12": (13, 3, 7.5, 27, 20, 3.5, 3, 3.5), |
| 24 | "MGN15": (16, 4, 8.5, 32, 25, 3.5, 3, 4), |
| 25 | } |
| 26 | # Block length L and hole spacing C along the rail: {size: {"C": (C, L1, L), "H": (C, L1, L)}} |
| 27 | LENGTHS = { |
| 28 | "MGN7": {"C": (8, 13.5, 22.5), "H": (13, 21.8, 30.8)}, |
| 29 | "MGN9": {"C": (10, 18.9, 28.9), "H": (16, 29.9, 39.9)}, |
| 30 | "MGN12": {"C": (15, 21.7, 34.7), "H": (20, 32.4, 45.4)}, |
| 31 | "MGN15": {"C": (20, 26.7, 42.1), "H": (25, 43.4, 58.8)}, |
| 32 | } |
| 33 | # Rail MGNR: WR, HR, D (counterbore), h (counterbore depth), d (through hole), P (pitch), E (standard end distance) |
| 34 | RAILS = { |
| 35 | "MGN7": (7, 4.8, 4.2, 2.3, 2.4, 15, 5), |
| 36 | "MGN9": (9, 6.5, 6, 3.5, 3.5, 20, 7.5), |
| 37 | "MGN12": (12, 8, 6, 4.5, 3.5, 25, 10), |
| 38 | "MGN15": (15, 10, 6, 4.5, 3.5, 40, 15), |
| 39 | } |
| 40 | |
| 41 | WR, HR, D, h, d, P, E = RAILS[size] |
| 42 | |
| 43 | model = Model() |
| 44 | if component == "rail": |
| 45 | if rail_length < 2 * E: |
| 46 | raise ValueError(f"The rail must be at least 2 E = {2 * E} mm long.") |
| 47 | holes = int((rail_length - 2 * E) // P) + 1 |
| 48 | x0 = -rail_length / 2 + E |
| 49 | with model.sketch("rail_sketch", on="XY", name="Rail") as sk: |
| 50 | sk.rect("outline", (-rail_length / 2, -WR / 2), (rail_length / 2, WR / 2)) |
| 51 | model.extrude("rail", "rail_sketch", distance=HR, name="Rail") |
| 52 | with model.sketch("holes_sketch", on="XY", name="Mounting holes") as sk: |
| 53 | for i in range(holes): |
| 54 | sk.circle(f"hole_{i + 1}", (x0 + i * P, 0), d / 2) |
| 55 | model.extrude("holes", "holes_sketch", distance=HR, op="cut", name="Mounting holes") |
| 56 | model.plane("cbore_plane", on="XY", offset=HR - h, name="Counterbore floor") |
| 57 | with model.sketch("cbore_sketch", on="cbore_plane", name="Counterbores") as sk: |
| 58 | for i in range(holes): |
| 59 | sk.circle(f"cbore_{i + 1}", (x0 + i * P, 0), D / 2) |
| 60 | model.extrude("cbores", "cbore_sketch", distance=h, op="cut", name="Counterbores") |
| 61 | else: |
| 62 | H, H1, N, W, B, B1, M, l = BLOCKS[size] |
| 63 | C, L1, L = LENGTHS[size][component[-1]] |
| 64 | model.plane("base_plane", on="XY", offset=H1, name="Block underside") |
| 65 | with model.sketch("block_sketch", on="base_plane", name="Block") as sk: |
| 66 | sk.rect("outline", (-L / 2, -W / 2), (L / 2, W / 2)) |
| 67 | model.extrude("block", "block_sketch", distance=H - H1, name="Block") |
| 68 | with model.sketch("channel_sketch", on="base_plane", name="Rail channel") as sk: |
| 69 | sk.rect("channel", (-L / 2, -WR / 2), (L / 2, WR / 2)) |
| 70 | model.extrude("channel", "channel_sketch", distance=HR - H1, op="cut", name="Rail channel") |
| 71 | model.plane("thread_plane", on="XY", offset=H - l, name="Thread bottom") |
| 72 | with model.sketch("thread_sketch", on="thread_plane", name="Mounting threads") as sk: |
| 73 | for i, (x, y) in enumerate([(-C / 2, -B / 2), (C / 2, -B / 2), (C / 2, B / 2), (-C / 2, B / 2)]): |
| 74 | sk.circle(f"thread_{i + 1}", (x, y), M / 2) |
| 75 | model.extrude("threads", "thread_sketch", distance=l, op="cut", name="Mounting threads") |
| 76 | model.material("steel-generic", color="#9da2a8") # bearing steel |
| 77 | result = model.result() |
| 78 |
| 1 | name = "steve/miniature-linear-guide" |
| 2 | version = "1.0.0" |
| 3 | runtime = "steve" |
| 4 | license = "MIT" |
| 5 | summary = "HIWIN MGN miniature linear guideway, sizes 7, 9, 12 and 15: rail (MGNR) or block (MGN-C / MGN-H)." |
| 6 | description = """HIWIN MG series miniature linear guideway (MGN, standard width): the rail MGNR with its counterbored \ |
| 7 | mounting holes, or a carriage block MGN-C (standard length) or MGN-H (long). Envelope geometry for assemblies, from \ |
| 8 | the dimension table of HIWIN's catalogue (Linear Guideway Technical Information, FORM G99TE24-2410, section 2-4, MG \ |
| 9 | series): the ball tracks, seals and grease nipple are not modelled. |
| 10 | |
| 11 | The rail lies along X on the XY plane, centred on the origin. A block is drawn where it sits on a rail whose base is the \ |
| 12 | XY plane: its underside at H1, its top at H, centred on the origin, with the rail's channel through it (the channel is \ |
| 13 | modelled as the rail's own width and height). Dimensions: see the README.""" |
| 14 | tags = ["linear-guide", "linear-rail", "carriage", "mgn", "hiwin", "motion", "bearing", "metric"] |
| 15 | |
| 16 | [parameters.size] |
| 17 | type = "choice" |
| 18 | default = "MGN12" |
| 19 | choices = ["MGN7", "MGN9", "MGN12", "MGN15"] |
| 20 | label = "Size" |
| 21 | |
| 22 | [parameters.component] |
| 23 | type = "choice" |
| 24 | default = "rail" |
| 25 | choices = ["rail", "block-C", "block-H"] |
| 26 | label = "Component" |
| 27 | description = "rail (MGNR), block-C (standard block MGN-C) or block-H (long block MGN-H)." |
| 28 | |
| 29 | [parameters.rail_length] |
| 30 | type = "number" |
| 31 | default = 70 |
| 32 | min = 20 |
| 33 | max = 2000 |
| 34 | unit = "mm" |
| 35 | label = "Rail length" |
| 36 | description = "Rail only. Holes from E at one end at pitch P; standard lengths are (n - 1) P + 2 E." |
| 37 | |
| 38 | [[presets]] |
| 39 | id = "MGNR7-40" |
| 40 | title = "MGNR7 rail, 40 mm" |
| 41 | params = { size = "MGN7", component = "rail", rail_length = 40 } |
| 42 | aliases = ["MGN7 rail", "MGNR7", "HIWIN MGNR7R40", "MGN7 linear rail"] |
| 43 | standard = "HIWIN MGN" |
| 44 | |
| 45 | [[presets]] |
| 46 | id = "MGN7C" |
| 47 | title = "MGN7C block (standard)" |
| 48 | params = { size = "MGN7", component = "block-C" } |
| 49 | aliases = ["HIWIN MGN7C", "MGN7C carriage", "MGN7C linear block", "MGN7 block C"] |
| 50 | standard = "HIWIN MGN" |
| 51 | |
| 52 | [[presets]] |
| 53 | id = "MGN7H" |
| 54 | title = "MGN7H block (long)" |
| 55 | params = { size = "MGN7", component = "block-H" } |
| 56 | aliases = ["HIWIN MGN7H", "MGN7H carriage", "MGN7H linear block", "MGN7 block H"] |
| 57 | standard = "HIWIN MGN" |
| 58 | |
| 59 | [[presets]] |
| 60 | id = "MGNR9-55" |
| 61 | title = "MGNR9 rail, 55 mm" |
| 62 | params = { size = "MGN9", component = "rail", rail_length = 55 } |
| 63 | aliases = ["MGN9 rail", "MGNR9", "HIWIN MGNR9R55", "MGN9 linear rail"] |
| 64 | standard = "HIWIN MGN" |
| 65 | |
| 66 | [[presets]] |
| 67 | id = "MGN9C" |
| 68 | title = "MGN9C block (standard)" |
| 69 | params = { size = "MGN9", component = "block-C" } |
| 70 | aliases = ["HIWIN MGN9C", "MGN9C carriage", "MGN9C linear block", "MGN9 block C"] |
| 71 | standard = "HIWIN MGN" |
| 72 | |
| 73 | [[presets]] |
| 74 | id = "MGN9H" |
| 75 | title = "MGN9H block (long)" |
| 76 | params = { size = "MGN9", component = "block-H" } |
| 77 | aliases = ["HIWIN MGN9H", "MGN9H carriage", "MGN9H linear block", "MGN9 block H"] |
| 78 | standard = "HIWIN MGN" |
| 79 | |
| 80 | [[presets]] |
| 81 | id = "MGNR12-70" |
| 82 | title = "MGNR12 rail, 70 mm" |
| 83 | params = { size = "MGN12", component = "rail", rail_length = 70 } |
| 84 | aliases = ["MGN12 rail", "MGNR12", "HIWIN MGNR12R70", "MGN12 linear rail"] |
| 85 | standard = "HIWIN MGN" |
| 86 | |
| 87 | [[presets]] |
| 88 | id = "MGN12C" |
| 89 | title = "MGN12C block (standard)" |
| 90 | params = { size = "MGN12", component = "block-C" } |
| 91 | aliases = ["HIWIN MGN12C", "MGN12C carriage", "MGN12C linear block", "MGN12 block C"] |
| 92 | standard = "HIWIN MGN" |
| 93 | |
| 94 | [[presets]] |
| 95 | id = "MGN12H" |
| 96 | title = "MGN12H block (long)" |
| 97 | params = { size = "MGN12", component = "block-H" } |
| 98 | aliases = ["HIWIN MGN12H", "MGN12H carriage", "MGN12H linear block", "MGN12 block H"] |
| 99 | standard = "HIWIN MGN" |
| 100 |
HIWIN MG series miniature linear guideway, standard width (MGN), sizes 7, 9, 12 and 15: the rail MGNR or a carriage block MGN-C (standard) / MGN-H (long). Presets cover the catalogue's MGN7, MGN9 and MGN12 rails and blocks.
Envelope for assemblies; the ball tracks, end seals, the end caps' shape and the grease nipple are not modelled.
rail_length, along X, centred on the origin, its base on the XY plane. Mounting
holes: through hole Ø d with a counterbore Ø D, h deep, from the top; the first hole E from the −X end, then at pitch
P while at least E from the +X end (a standard rail, L = (n − 1) P + 2 E, has E at both ends).| Parameter | Meaning |
|---|---|
size |
MGN7, MGN9, MGN12, MGN15 |
component |
rail (MGNR), block-C (MGN-C), block-H (MGN-H) |
rail_length |
rail length, mm (rail only); standard lengths are (n − 1) P + 2 E |
HIWIN Technologies Corp., Linear Guideway Technical Information, ©2024, FORM G99TE24-2410, section 2-4 "MG Series" (official PDF: https://hiwin.com/wp-content/uploads/2026/08/HIWIN-Linear-Guideway-Catalog-1.pdf):
Block, mm (H: block top above the rail base; H1: clearance under the block; N: rail centre to block side; L: overall length with end seals, L1: steel body length, not modelled separately):
| Size | H | H1 | N | W | B | B1 | C (C / H block) | L1 (C / H) | L (C / H) | M × l |
|---|---|---|---|---|---|---|---|---|---|---|
| MGN7 | 8 | 1.5 | 5 | 17 | 12 | 2.5 | 8 / 13 | 13.5 / 21.8 | 22.5 / 30.8 | M2 × 2.5 |
| MGN9 | 10 | 2 | 5.5 | 20 | 15 | 2.5 | 10 / 16 | 18.9 / 29.9 | 28.9 / 39.9 | M3 × 3 |
| MGN12 | 13 | 3 | 7.5 | 27 | 20 | 3.5 | 15 / 20 | 21.7 / 32.4 | 34.7 / 45.4 | M3 × 3.5 |
| MGN15 | 16 | 4 | 8.5 | 32 | 25 | 3.5 | 20 / 25 | 26.7 / 43.4 | 42.1 / 58.8 | M3 × 4 |
Rail, mm:
| Rail | WR | HR | D | h | d | P | E | Bolt |
|---|---|---|---|---|---|---|---|---|
| MGNR7 | 7 | 4.8 | 4.2 | 2.3 | 2.4 | 15 | 5 | M2 × 6 |
| MGNR9 | 9 | 6.5 | 6 | 3.5 | 3.5 | 20 | 7.5 | M3 × 8 |
| MGNR12 | 12 | 8 | 6 | 4.5 | 3.5 | 25 | 10 | M3 × 8 |
| MGNR15 | 15 | 10 | 6 | 4.5 | 3.5 | 40 | 15 | M3 × 10 |
The catalogue entries "MGN15x block", "MGN7/12x block" and "MGNx rail" are placeholders that name no HIWIN model and are not presets.
Preset list: models of the step.parts catalogue (MIT), see library/NOTICE.md.
| 1 | # Miniature linear guide (HIWIN MGN) |
| 2 | |
| 3 | HIWIN MG series miniature linear guideway, standard width (MGN), sizes 7, 9, 12 and 15: the rail **MGNR** or a |
| 4 | carriage block **MGN-C** (standard) / **MGN-H** (long). Presets cover the catalogue's MGN7, MGN9 and MGN12 rails and |
| 5 | blocks. |
| 6 | |
| 7 | ## Geometry |
| 8 | |
| 9 | Envelope for assemblies; the ball tracks, end seals, the end caps' shape and the grease nipple are not modelled. |
| 10 | |
| 11 | - **Rail:** a bar WR × HR, length `rail_length`, along X, centred on the origin, its base on the XY plane. Mounting |
| 12 | holes: through hole Ø d with a counterbore Ø D, h deep, from the top; the first hole E from the −X end, then at pitch |
| 13 | P while at least E from the +X end (a standard rail, L = (n − 1) P + 2 E, has E at both ends). |
| 14 | - **Block:** a body W wide (Y) and L long (X), centred on the origin, from H1 (its underside above the rail's base) to H |
| 15 | (its top), as it sits on a rail whose base is the XY plane. The rail's channel runs through it, modelled as the |
| 16 | rail's own section WR × HR (HIWIN does not dimension the block's inner channel). Four tapped holes M × l from the |
| 17 | top at B (across, Y) × C (along, X), drawn at the thread's nominal diameter (the thread is not modelled). |
| 18 | |
| 19 | ## Parameters |
| 20 | |
| 21 | | Parameter | Meaning | |
| 22 | |---|---| |
| 23 | | `size` | `MGN7`, `MGN9`, `MGN12`, `MGN15` | |
| 24 | | `component` | `rail` (MGNR), `block-C` (MGN-C), `block-H` (MGN-H) | |
| 25 | | `rail_length` | rail length, mm (rail only); standard lengths are (n − 1) P + 2 E | |
| 26 | |
| 27 | ## Source |
| 28 | |
| 29 | HIWIN Technologies Corp., *Linear Guideway Technical Information*, ©2024, FORM **G99TE24-2410**, section 2-4 "MG |
| 30 | Series" (official PDF: https://hiwin.com/wp-content/uploads/2026/08/HIWIN-Linear-Guideway-Catalog-1.pdf): |
| 31 | |
| 32 | - 2-4-19 (1) "MGN-C / MGN-H", printed page 88 (PDF page 91): block and rail dimensions; |
| 33 | - 2-4-17, Table 2-4-15 "Standard and Maximum Lengths of Rail", printed page 85 (PDF page 88): pitch P, standard end |
| 34 | distance E and the standard lengths L (n). The rail presets use the first standard length of each rail: MGNR7 40 (3 |
| 35 | holes), MGNR9 55 (3), MGNR12 70 (3), MGNR15 70 (2). |
| 36 | |
| 37 | Block, mm (H: block top above the rail base; H1: clearance under the block; N: rail centre to block side; L: overall |
| 38 | length with end seals, L1: steel body length, not modelled separately): |
| 39 | |
| 40 | | Size | H | H1 | N | W | B | B1 | C (C / H block) | L1 (C / H) | L (C / H) | M × l | |
| 41 | |---|---|---|---|---|---|---|---|---|---|---| |
| 42 | | MGN7 | 8 | 1.5 | 5 | 17 | 12 | 2.5 | 8 / 13 | 13.5 / 21.8 | 22.5 / 30.8 | M2 × 2.5 | |
| 43 | | MGN9 | 10 | 2 | 5.5 | 20 | 15 | 2.5 | 10 / 16 | 18.9 / 29.9 | 28.9 / 39.9 | M3 × 3 | |
| 44 | | MGN12 | 13 | 3 | 7.5 | 27 | 20 | 3.5 | 15 / 20 | 21.7 / 32.4 | 34.7 / 45.4 | M3 × 3.5 | |
| 45 | | MGN15 | 16 | 4 | 8.5 | 32 | 25 | 3.5 | 20 / 25 | 26.7 / 43.4 | 42.1 / 58.8 | M3 × 4 | |
| 46 | |
| 47 | Rail, mm: |
| 48 | |
| 49 | | Rail | WR | HR | D | h | d | P | E | Bolt | |
| 50 | |---|---|---|---|---|---|---|---|---| |
| 51 | | MGNR7 | 7 | 4.8 | 4.2 | 2.3 | 2.4 | 15 | 5 | M2 × 6 | |
| 52 | | MGNR9 | 9 | 6.5 | 6 | 3.5 | 3.5 | 20 | 7.5 | M3 × 8 | |
| 53 | | MGNR12 | 12 | 8 | 6 | 4.5 | 3.5 | 25 | 10 | M3 × 8 | |
| 54 | | MGNR15 | 15 | 10 | 6 | 4.5 | 3.5 | 40 | 15 | M3 × 10 | |
| 55 | |
| 56 | The catalogue entries "MGN15x block", "MGN7/12x block" and "MGNx rail" are placeholders that name no HIWIN model and |
| 57 | are not presets. |
| 58 | |
| 59 | Preset list: models of the step.parts catalogue (MIT), see `library/NOTICE.md`. |
| 60 |
HIWIN MG series miniature linear guideway (MGN, standard width): the rail MGNR with its counterbored mounting holes, or a carriage block MGN-C (standard length) or MGN-H (long). Envelope geometry for assemblies, from the dimension table of HIWIN's catalogue (Linear Guideway Technical Information, FORM G99TE24-2410, section 2-4, MG series): the ball tracks, seals and grease nipple are not modelled. The rail lies along X on the XY plane, centred on the origin. A block is drawn where it sits on a rail whose base is the XY plane: its underside at H1, its top at H, centred on the origin, with the rail's channel through it (the channel is modelled as the rail's own width and height). Dimensions: see the README.
HIWIN MG series miniature linear guideway, standard width (MGN), sizes 7, 9, 12 and 15: the rail MGNR or a carriage block MGN-C (standard) / MGN-H (long). Presets cover the catalogue's MGN7, MGN9 and MGN12 rails and blocks.
Envelope for assemblies; the ball tracks, end seals, the end caps' shape and the grease nipple are not modelled.
rail_length, along X, centred on the origin, its base on the XY plane. Mounting
holes: through hole Ø d with a counterbore Ø D, h deep, from the top; the first hole E from the −X end, then at pitch
P while at least E from the +X end (a standard rail, L = (n − 1) P + 2 E, has E at both ends).| Parameter | Meaning |
|---|---|
size |
MGN7, MGN9, MGN12, MGN15 |
component |
rail (MGNR), block-C (MGN-C), block-H (MGN-H) |
rail_length |
rail length, mm (rail only); standard lengths are (n − 1) P + 2 E |
HIWIN Technologies Corp., Linear Guideway Technical Information, ©2024, FORM G99TE24-2410, section 2-4 "MG Series" (official PDF: https://hiwin.com/wp-content/uploads/2026/08/HIWIN-Linear-Guideway-Catalog-1.pdf):
Block, mm (H: block top above the rail base; H1: clearance under the block; N: rail centre to block side; L: overall length with end seals, L1: steel body length, not modelled separately):
| Size | H | H1 | N | W | B | B1 | C (C / H block) | L1 (C / H) | L (C / H) | M × l |
|---|---|---|---|---|---|---|---|---|---|---|
| MGN7 | 8 | 1.5 | 5 | 17 | 12 | 2.5 | 8 / 13 | 13.5 / 21.8 | 22.5 / 30.8 | M2 × 2.5 |
| MGN9 | 10 | 2 | 5.5 | 20 | 15 | 2.5 | 10 / 16 | 18.9 / 29.9 | 28.9 / 39.9 | M3 × 3 |
| MGN12 | 13 | 3 | 7.5 | 27 | 20 | 3.5 | 15 / 20 | 21.7 / 32.4 | 34.7 / 45.4 | M3 × 3.5 |
| MGN15 | 16 | 4 | 8.5 | 32 | 25 | 3.5 | 20 / 25 | 26.7 / 43.4 | 42.1 / 58.8 | M3 × 4 |
Rail, mm:
| Rail | WR | HR | D | h | d | P | E | Bolt |
|---|---|---|---|---|---|---|---|---|
| MGNR7 | 7 | 4.8 | 4.2 | 2.3 | 2.4 | 15 | 5 | M2 × 6 |
| MGNR9 | 9 | 6.5 | 6 | 3.5 | 3.5 | 20 | 7.5 | M3 × 8 |
| MGNR12 | 12 | 8 | 6 | 4.5 | 3.5 | 25 | 10 | M3 × 8 |
| MGNR15 | 15 | 10 | 6 | 4.5 | 3.5 | 40 | 15 | M3 × 10 |
The catalogue entries "MGN15x block", "MGN7/12x block" and "MGNx rail" are placeholders that name no HIWIN model and are not presets.
Preset list: models of the step.parts catalogue (MIT), see library/NOTICE.md.
Deep groove ball bearing, metric: 6xx, MR, 60, 62, 63, 68 and 69 series, open, ZZ or 2RS, optional flange.
Linear bushing (linear ball bearing) LM / LMF / LMK, shafts 3 to 60 mm: straight, round or square flange.
Hexagon head screw, fully threaded, ISO 4017 / DIN 933, M1.6 to M36, any length, with catalogue sizes as presets.
Hexagon socket button head screw, ISO 7380-1, M3 to M16, any length, with catalogue sizes as presets.