← Ecky CAD / Ecky Language Reference

REFERENCE / 05

Verify Clauses

Use verify when source should declare structural expectations explicitly.

(model
  (verify
    (tag front_gap body.front_window_1)
    (metric gap (clearance min-distance body lid))
    (expect gap (>= 3)))
  (part body (box 10 10 10))
  (part lid (box 10 10 10)))
  • model verification is top-level under model
  • component-owned verification is the one exception: a verify clause may

sit directly inside define-component, before its geometry expression, and expands once per instance

  • one verify clause requires three sections in order:
  • tag
  • metric
  • expect
  • nested verify inside geometry or helper expressions is rejected
  • empty (verify) is rejected

tag

(tag body_shell body.front_window_1)
  • carries authored labels, ids, or references
  • payload stays opaque to compiler/core IR
  • useful for human grouping and later diagnostics

metric

(metric check (manifest has-step))
(metric triangles (stl triangle-count))
(metric gap (clearance min-distance body.front_window_1 lid.front_skirt))
  • first item usually names local check alias
  • second item is metric expression
  • current runtime metric namespaces:
  • manifest
  • stl
  • clearance

Current shipped metric keys:

  • manifest has-step
  • manifest has-preview-stl
  • manifest edge-target-count
  • manifest face-target-count
  • manifest export-format-count
  • manifest part-count
  • stl triangle-count
  • stl connected-component-count
  • stl non-manifold-edge-count
  • stl overhang-face-count
  • clearance min-distance

clearance min-distance compares the minimum distance between two named selectors.

  • selectors can name parts, selection targets, or correspondence outputs
  • part selectors use manifest bounds
  • edge and face selectors use runtime mesh target geometry when available
  • unresolved selectors fail authored verify with a raw runtime error

expect

(expect check (= true))
(expect triangles (> 100))
  • first item should reference the metric alias used above
  • second item is comparator form
  • current shipped comparators:
  • =
  • >
  • >=
  • <
  • <=

Authoring rule:

  • fix geometry or exports until verify passes
  • do not remove verify clauses to bypass authored requirements