Skip to content

Checks and interference rules

A config can contain two types of tests. A check limits the position of a frame. An interference rule finds solids that overlap. This page describes both, and lists what they do not find.

A check compares one coordinate of a frame with a minimum or a maximum, in the root frame or in the frame in. A check with solve fails when the solver of that frame finds no exact solution.

"checks": [
{"frame": "J_foot", "in": "F_tool", "axis": "z", "min": "plate_t",
"limits": {"rod_L": [80, 300], "distance": [60, 320], "spine_L": [10, 150]},
"msg": "竖梁太矮:……", "msg_en": "Beam too short: ..."},
{"solve": "P_phone", "limits": {"rod_L": [80, 300], "rod_tilt": [0, 60]},
"msg": "手机角度无解:……", "msg_en": "No phone angle ..."}
]

axis is x, y or z (default z). min and max are expressions. msg is the default message. msg_en is the English message. limits names parameters and the range to search for each: when the check fails, the message also gives the ranges of these parameters where the model can be solved and passes the frame checks, with the other values as they are. In Python, m.intervals(name, lo, hi) gives these ranges.

A check with expr in place of frame tests the parameters alone. It fails when the expression is 0. With enabled, the check is skipped when that expression is 0.

{"expr": "spoon_depth <= spoon_w/2", "enabled": "head == 1", "msg": "...", "msg_en": "Spoon: the bowl is deeper than half its width."}

asfinger build and asfinger frames print each failed check as a line that starts with [check]. In Python, m.check() returns the messages, and m.check(lang='en') returns the English ones.

A rule names two sides, a and b. It fails when the volume of their overlap is larger than tol_mm3 (default 1 mm³).

"interference": [
{"id": "phone_vs_body", "a": "phone", "b": "tool_body", "msg": "...", "msg_en": "..."},
{"id": "holder_vs_rod", "a": "holder", "b": {"part": "tool_body", "only": ["rod", "tip"]}},
{"id": "sight_to_tip",
"a": {"sight": {"from": "C_main", "to": "T_tip", "stop_before": "rod_D/2 + 1", "r": 0.5}},
"b": [{"part": "tool_body", "only": ["adapter", "beam_mitred", "spine_mitred"]}, "holder", "phone"],
"tol_mm3": 0.3}
]

A side can be:

Form Meaning
"phone" A whole part.
{"part": "tool_body", "only": [names]} Only the named nodes of a part.
{"part": "tool_body", "skip": [names]} A part without the named nodes.
{"sight": {"from": F, "to": F, "r": r, "stop_before": d}} A thin cylinder between two frame origins: a line of sight.
{"csg": node, "frame": F} A solid that exists only for the test, for example a screw head or the space for a tool.
a list of these forms Their union.

A rule can also have:

  • enabled: an expression. The rule is skipped when it is 0.
  • level: "error" (default) or "warn". An error is something that cannot be built. A warning is an inconvenience, for example a screw that needs a short hex key.

A rule is skipped when a side of it is a part or frame that an option switched off. When a side is a list, only the members that are switched off are left out: the rule still tests the others, and it is skipped when none is left.

asfinger build prints errors as [interference] lines and warnings as [warning] lines, and writes both to report.json. In Python, m.interference() returns the errors and m.interference(level='warn') the warnings. The web editor evaluates the same rules, shows the overlap in red, and blocks the STL export while an error exists.

Language of the messages. The command line prints msg. In the configs of this repository, msg is Chinese and msg_en is English. For English messages, use m.check(lang='en') and m.interference(lang='en') in Python, or read the rule id in the message.

Rule Level Fails when
phone_vs_body error The pusher passes through the phone.
phone_vs_holder error The phone overlaps its holder (back_to_mount too small).
holder_vs_rod error The rod passes through the holder.
sight_to_tip error A solid blocks the line from the main camera to the tip.
adapter_vs_body error The pusher overlaps the mount adapter.
screw_heads error A screw head of the base overlaps the pusher (only with mount_screws = 2).
screw_access error No room for a hex key above a screw (only with mount_screws = 2).
screw_driver warn A straight driver cannot reach a screw (only with mount_screws = 2).
ring_heads error A screw head of the M6 ring overlaps the pusher (only with ring = 1, the universal base).
ring_access error No room for a hex key above one of the four ring screws at 45° (only with ring = 1).
ring_extra warn No room for a hex key above one of the three spare ring holes on the axes (only with ring = 1).
ring_driver warn A straight driver cannot reach a ring screw (only with ring = 1).

The default configs have two checks. The one on J_foot fails when the beam would be lower than plate_t above the tool face of the base. The one on P_phone fails when no phone angle up to 90° puts the spine on the beam.

  • Only the listed pairs are tested. Two solids that are in no rule can overlap without a message.
  • Small overlaps pass. An overlap below tol_mm3 is not reported. Two faces that only touch have no overlap volume.
  • Clearance is not tested. A rule reports an overlap. It does not report a gap that is too small for assembly or for printing tolerance.
  • The line of sight is one thin line. sight_to_tip tests a cylinder of 0.5 mm radius from C_main to the tip. It does not test the full field of view, and it does not test the other cameras.
  • The robot is not part of the model. No rule tests the pusher or the phone against the links of the arm or against the table.
  • Printing is not tested. Overhangs, wall thickness and strength are not examined. The phone holder snaps are brittle in matte PLA. Print them in PETG, or flat as a separate part.
  • A stale solved frame makes the tests wrong. The tests use the stored pose of the phone. See Frames.
  • The phone is a box. The part phone is a stand-in: a box with the outer dimensions of the iPhone 17 Pro, and a ring for the main lens. It has no case and no full camera bump.