Skip to content
Archee Docs

Parts, ports and mates

Declare parts, give them typed ports, place them on axes and connect them with mates.

Parts and kinds

part NAME kind KIND { ... } declares a part. The kind is one of shaft gear bearing housing key cap seal spacer washer bolt assembly. A part with kind assembly, or any place, is an assembly.

Ports

A port is a typed interface. Its fields are values, so a port carries diameters, lengths and fits that other parts read. Every part has an implicit axis ax, the axis of revolution. at is the axial start, in millimetres from the part origin.

PortFieldsMeaning
cyld (length or fit), len, atAn outer cylinder section
bored (fit), len, atAn inner cylinder section
faceat, r0, r1, side (+1 or -1)An annular shoulder or end face
keyhost, b, h, t, len, atA keyway seat on a cyl or bore
threadd, pitch, len, at, form, handA threaded section
holesn, d, pcd, atA bolt-circle pattern
meshm, z, b, alpha (default 20 deg), atA gear-tooth section; dp derives as m*z
port s2: cyl(d = d2 k6, len = 60 mm, at = 55 mm)
port k2: key(host = s2, b = 14 mm, h = 9 mm, t = 5.5 mm, len = 50 mm, at = 60 mm) @T1 "Bảng 10.5"
port m3: mesh(m = m3, z = z3, b = 85 mm, at = 125 mm)

Place parts

An assembly places child parts on its axes.

axis a1 = (0 mm, 0 mm) dir 0 deg
axis a2 = (0 mm, a12) dir 0 deg
place shaft2 = shaft2(T = T2, n = n2) on a2 at 0 mm
place wheel2 = wheel2 on a2 at 60 mm
place b1 = standards.bearing.b6208 on a2 at 10 mm

place x = p(...) on a at L creates an instance x of part p, binds its inputs, and puts its origin on axis a at offset L. Its own axis lies along a. Parallel shafts use separate axes declared with axis.

Library parts such as standards.bearing.b6208 and standards.key.a14x9x50 are referenced, never copied.

Data flow

  • in flows down: a child in takes its place binding, else its default. An unbound in is an error (E02).
  • out rolls up: the parent reads child.out_name.
  • Every assembly gets an out mass that sums its children’s masses, unless it declares one.

Mates

A mate connects two ports and names the pairing. The first path is the inner side (the shaft side, the external thread, the pinion). The second is the outer side.

mate m3 fit shaft2.s2 wheel2.bore
mate m4 key shaft2.k2 wheel2.key via key2
mate m6 mesh shaft1.m1 wheel2.m drive inner
MatePairsdrive default
fitcyl to bore, coaxial, equal nominal diametercyl
stopface to face, contact on shared radiithe first face
keykey seat on cyl to key seat on bore, via a library keythe shaft seat
screwexternal thread to internal threadexternal
boltholes to holes, via a library boltthe first holes
meshmesh to mesh, parallel axesthe pinion

The driver holds the authoritative values and the other side must agree. A mate between ports of the wrong kind reports M01. A missing port or library reference reports M02. A mate id is unique inside its part, and check and mate ids share one namespace.

Checks

check NAME: lhs REL rhs is a relation that must hold. When it fails, arc check reports it under the rule name calc.check.

check len_ok: shaft2.s4.at + shaft2.s4.len <= req.L_max