authoring library
The kit authoring toolkit, pure Dart: the catalog language, the library
builder, the shared shape helpers, the geometry snapshot and the
conformance test. A kit's generator runs it under plain dart run.
Classes
- Catalog
- A kit's symbols, in library order.
- CatalogArc
- An arc from the angle start through the signed sweep, both in radians: a positive sweep turns counter-clockwise from start, a negative one clockwise.
- CatalogCircle
- CatalogLine
- CatalogPolyline
- A polyline through points; closed repeats the first point.
- CatalogShape
- One drawn shape of a symbol.
- CatalogSymbol
- One symbol of a kit's library. A unit draws its outline first (K3 rule 11): a closed polyline or a circle. A retired symbol stays in the library and leaves the gallery (contract R2).
- CatalogUnit
- A symbol's service unit (umbrella A6).
- KitNames
-
A kit's words by locale. Word ids:
symbol:<key>,category:<kit id>/<English category>, sub-project 2'stool:<tool id>,type:<type id>,property:<type id>.<property>, and 2b'sunit:<kit id>/<unit kind>. Every id carries its kit's id, so two kits never share one. - KitProblem
- KitText
-
A word id and its arguments, put into words when read
(
KitWords.text). Equal by its id and its arguments' values, whatever their order. - LibraryComponent
- A library's kit and format, on its root.
- ManifestComponent
- A plan's format and its kits' versions, on its root.
- PlanWords
- A kit's words at the plan's current locale, as a property reads them.
- SymbolBox
-
The local box of a symbol:
left = minX,right = maxX,front = minY,back = maxYin the definition's coordinates. - SymbolComponent
- A symbol's identity and display data, on a definition's handle.
- SymbolEntry
- One symbol of a library: its identity, its unit or null, its definition and its leaves, ascending by handle (draw order).
- SymbolLibrary
- A validated library: its kit and its entries in definition-handle order.
- UnitComponent
- A served unit: its kind, its capacity and its labelling.
- UnitKinds
- The unit kinds the contract names. Others are allowed.
Enums
- KitProblemCode
- UnitLabelling
- How a placed unit's label is formed.
Constants
Functions
-
boxOfDefinition(
DraftDocument doc, Handle definition) → SymbolBox? -
The local box of the definition
definitionindoc, from its live leaves (the entities it owns); null whendefinitionnames no definition or none of its leaves draws. -
boxOfEntry(
SymbolEntry entry) → SymbolBox? -
The local box of
entry, computed on the first call and the same object on every later call for the same entry (spec D2: once per entry). -
boxOfLeaves(
Iterable< (EntityKind, GeometryPayload)> leaves) → SymbolBox? -
The local box of
leaves(each a kind and its payload, in the definition's coordinates), or null when none of them draws. -
buildLibraryDocument(
Catalog catalog) → DraftDocument -
The library document of
catalog. Deterministic: handles ascend in catalog order (a definition, its leaves, the next definition). Every leaf is on layer 0 with BYBLOCK linetype, colour, lineweight and transparency and no flag (K3 rule 14). The caller disposes the document. -
chairAt(
double cx, double cy, double facing) → List< CatalogShape> -
A chair facing a table: its seat (a closed 450 x 450 square) centred at
(
cx,cy) and its back line, the table in directionfacing(radians from +x). The back line is 60 in from the edge away from the table. -
chairsAround(
double cx, double cy, double r, int count) → List< CatalogShape> -
countchairs around a round top of radiusrcentred at (cx,cy), at equal angles from the bottom, each tucked chairTuck under the edge. -
cleanCoordinate(
double v) → double -
vrounded to 1e-6 mm, with -0 made 0: the dust of a rotation (1e-13 off a whole millimetre) never reaches a library. A sub-micrometre value is never meaningful in a symbol. -
conformance(
{required Catalog catalog, required Uint8List committedLibrary, required String committedSnapshot, required KitNames names, required List< String> locales, Map<String, Set< sameAsEnglish = const {}, Iterable<String> >String> typeIds = const [], Iterable<String> toolIds = const [], Iterable<String> propertyIds = const []}) → List<KitProblem> -
The problems of a kit: its
catalog, itscommittedLibrarybytes, itscommittedSnapshottext, itsnamesand its declared non-Englishlocales.sameAsEnglishlists, per locale, the word ids whose right word is the English one. Empty when the kit conforms. -
encodeLibrary(
Catalog catalog) → Uint8List -
The
.jetlibbytes ofcatalog: the codec's JSON of buildLibraryDocument, UTF-8. The same catalog gives the same bytes. -
encodeSnapshot(
Map< String, String> snapshot) → String -
snapshotas its file: one entry per line, sorted by key. -
fillText(
String template, Map< String, Object> args) → String -
templatewith each placeholder{name}thatargshas replaced by'${args[name]}'; a placeholder without an argument is left as written, an argument the template does not name is ignored. -
footprintOf(
SymbolBox box) → Aabb2 -
boxas the engine's box, the shapeAttachmentQuery.footprinttakes: x from left to right, y from front to back, in the definition's coordinates. -
geometrySnapshot(
Catalog catalog) → SplayTreeMap< String, String> -
Each symbol of
catalogbykey@version, sorted, as a canonical JSON text: keys sorted, numbers in Dart's shortest round-trip form, -0 as 0. -
inset(
double x, double y, double w, double h, double d) → CatalogShape -
rect of a
wxhoutline at (x,y), inset bydon every side. -
isCodeId(
String id) → bool -
Whether
idis a type id or a tool id (spec 2a P1): a kit id, then one or more dot-separated segments of lower-case letters and digits joined by single hyphens.architecture.wall,restaurant.booth.corner. -
isKind(
String kind) → bool -
Whether
kindis a target kind, a size family or a unit kind: lower-case letters and digits joined by single hyphens. -
isKitId(
String id) → bool -
Whether
idis a kit id: a lower-case letter, then lower-case letters and digits. No dot and no hyphen: it is the first segment of every key, type id and tool id. -
isOrthonormal(
Transform2 g) → bool -
Whether
g's linear part is orthonormal (spec 09c W-8, S-10):|a² + b² − 1|,|c² + d² − 1|and|ac + bd|each at mostTolerance.standard.linear. A mirror is orthonormal; a scale is not. -
isSymbolKey(
String key) → bool -
Whether
keyis a symbol key: a kit id, then two or more dot-separated segments, each lower-case letters and digits joined by single hyphens. -
kitOfKey(
String id) → String -
The first dot-separated segment of
id(a key, a type id or a tool id): its kit.iditself when it holds no dot. -
numberedNameIndex(
String name, Iterable< String Function(int n)> patterns, {String fold(String)?}) → int? -
The
nofnamewhennameis one ofpatternsatn, compared byfold(none: exactly); otherwise null.nis a positive integer written without a leading zero, after a space, at the end. -
parseSnapshot(
String text) → SplayTreeMap< String, String> -
A committed snapshot's text, each entry re-encoded compactly. Only white
space is normalised: key order and number spelling are kept, so an entry
written by hand with
1where geometrySnapshot writes1.0reads as changed (the comparison fails closed). Throws FormatException whentextis not a JSON object of objects. -
placeholdersOf(
String template) → Set< String> -
The names of
template's placeholders. -
placementTransform(
{required Vector2 at, required Vector2 basePoint, int? quarterTurns, (double, double)? rotation, bool mirrored = false}) → Transform2 -
translation(at) · rotation · scale(mirrored ? -1 : 1, 1) · translation(-basePoint): the definition's base point lands onat(spec F-2), and a mirror flips the local x axis whatever the rotation. -
poly(
List< CatalogPoint> points) → CatalogShape -
A closed polyline through
points. -
rect(
double x, double y, double w, double h) → CatalogShape -
A closed axis-aligned rectangle from (
x,y),wwide andhtall. -
registerKitComponents(
ComponentRegistry registry) → void -
Registers
jetcad.library,jetcad.manifest,jetcad.symbolandjetcad.unitonregistry, and nothing else. Once per registry:registerreplaces a type's store. -
servedTopOfEntry(
SymbolEntry entry) → Aabb2 -
The served top of
entryin its definition's coordinates (spec 2b S2,SymbolDefinitionRef.top): its first leaf's box when that leaf is a circle or a closed polyline (today'stableTopOf, jet_cad_floor_plan/lib/src/service/table_picker.dart:92-110), else the symbol's box (boxOfEntry); empty when no leaf draws. The entry's leaves are ascending by handle, so the first is the lowest. -
stoolAt(
double cx, double cy) → List< CatalogShape> -
A bar stool at (
cx,cy): its seat (Ø 380), then a Ø 300 footrest. -
stoolsAround(
double cx, double cy, double r, int count) → List< CatalogShape> -
countstools around a round top of radiusrcentred at (cx,cy), at equal angles from the bottom, each reaching stoolTuck under the edge. -
updateSnapshot(
Map< String, String> committed, Map<String, String> current) → SplayTreeMap<String, String> -
The generator's merge: every entry of
committedas it is, plus the entries ofcurrentit lacks. Never rewrites an existing entry, so a changed geometry shows as a failing conformance test, never as a quietly regenerated file.
Typedefs
- CatalogPoint = (double, double)
- A point, (x, y) in millimetres.
- SymbolLeaf = ({GeometryPayload payload, EntityRecord record})
-
A leaf of a symbol: its record (the library's handles and
geomIndex) and its geometry.
Exceptions / Errors
- SymbolLibraryError
- A library the decoder refuses: rule is the spec's K3 rule (1-15), message names the offending key or handle.