Sign in with STEVE

steve/miniature-linear-guide

HIWIN MGN miniature linear guideway, sizes 7, 9, 12 and 15: rail (MGNR) or block (MGN-C / MGN-H).

v1.0.0 Latest STEVE MIT 0

Not affiliated with or endorsed by HIWIN.

Isometric
part.py 78 lines · Python · STEVE runtime · checked
Download
1"""HIWIN MGN miniature linear guideway (MG series, standard width), sizes 7, 9, 12 and 15: the rail MGNR or a block
2MGN-C / MGN-H.
3
4Envelope model for assemblies from HIWIN's dimension table (Linear Guideway Technical Information, FORM
5G99TE24-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).
11The ball tracks, end seals, end caps' shape and the grease nipple are not modelled.
12"""
13from steve import Model
14
15size = "MGN12" # Size
16component = "rail" # Component: rail, block-C, block-H
17rail_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.
20BLOCKS = {
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)}}
27LENGTHS = {
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)
34RAILS = {
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
41WR, HR, D, h, d, P, E = RAILS[size]
42
43model = Model()
44if 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")
61else:
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")
76model.material("steel-generic", color="#9da2a8") # bearing steel
77result = model.result()
78

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.

Miniature linear guide (HIWIN MGN)

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.

Geometry

Envelope for assemblies; the ball tracks, end seals, the end caps' shape and the grease nipple are not modelled.

  • Rail: a bar WR × HR, length 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).
  • 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 (its top), as it sits on a rail whose base is the XY plane. The rail's channel runs through it, modelled as the rail's own section WR × HR (HIWIN does not dimension the block's inner channel). Four tapped holes M × l from the top at B (across, Y) × C (along, X), drawn at the thread's nominal diameter (the thread is not modelled).

Parameters

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

Source

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):

  • 2-4-19 (1) "MGN-C / MGN-H", printed page 88 (PDF page 91): block and rail dimensions;
  • 2-4-17, Table 2-4-15 "Standard and Maximum Lengths of Rail", printed page 85 (PDF page 88): pitch P, standard end distance E and the standard lengths L (n). The rail presets use the first standard length of each rail: MGNR7 40 (3 holes), MGNR9 55 (3), MGNR12 70 (3), MGNR15 70 (2).

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. 1.0.0 Latest
More #linear-guide
STEVEMIT

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.

2 51 sizes 0 1 day ago v2.0.0
STEVEMIT

steve/linear-bushing

Linear bushing (linear ball bearing) LM / LMF / LMK, shafts 3 to 60 mm: straight, round or square flange.

0 15 sizes 0 1 day ago v1.0.0
STEVEMIT

steve/hex-head-screw

Hexagon head screw, fully threaded, ISO 4017 / DIN 933, M1.6 to M36, any length, with catalogue sizes as presets.

18 85 sizes 0 1 day ago v2.0.0
STEVEMIT

steve/button-head-screw

Hexagon socket button head screw, ISO 7380-1, M3 to M16, any length, with catalogue sizes as presets.

10 65 sizes 0 1 day ago v2.0.0