jet_cad_2d_kit
The kit contract of jet_cad_2d plans. A kit — restaurant, architecture, cinema — ships its symbols, its parametric types and its tools on this contract, and the plan library loads any kit without knowing its domain. No kit depends on the plan library, and no kit depends on another.
Two libraries:
package:jet_cad_2d_kit/jet_cad_2d_kit.dart, the contract (Flutter): the components a plan stores (jetcad.symbol,jetcad.unit,jetcad.manifest,jetcad.library), the.jetliblibrary format and its validator,KitNames,SymbolLibrarySource,bundledLibrary, the code side (PlanType,PlanTool, the property specs,ColourTarget, attachment providers,PlanServices,KitDiagnostic) and thePlanKitdescriptor.package:jet_cad_2d_kit/authoring.dart, the authoring toolkit (pure Dart, runs underdart run): the catalog language, the library builder, shape helpers, the geometry snapshot and the conformance test.
A kit's catalog
Catalog buildCafeCatalog() => Catalog(kit: 'cafe', symbols: [
CatalogSymbol(
key: 'cafe.table.round-two',
name: 'Round table, 2 seats',
category: 'Tables',
tags: const ['table', 'round', 'two'],
unit: const CatalogUnit(kind: UnitKinds.table, capacity: 2),
base: (600, 600),
shapes: [
const CatalogCircle((600, 600), 350),
...chairsAround(600, 600, 350, 2),
],
),
]);
encodeLibrary(catalog) gives the .jetlib bytes a kit commits as an
asset; SymbolLibrary.decode(bytes) validates and reads them. A kit's own
test runs conformance(...) and expects no problem: the committed library
is the built one, every published key@N keeps its geometry, and every
declared locale is complete.
The kit author's contract — naming, components, the format's rules, words, versions, the new-kit checklist and the code side — is docs/kits.md.
The jet-cad packages
| Package | What it is | Depends on |
|---|---|---|
jet_cad_2d_plan |
The plan library: the editor, the widgets and the host API | the kit contract, the renderer and the engine |
jet_cad_2d_kit_architecture |
The architecture kit: walls, openings, rooms, dimensions and furniture | the kit contract, the renderer and the engine |
jet_cad_2d_kit_restaurant |
The restaurant kit: furniture and service units | the kit contract and the engine |
jet_cad_2d_kit |
The kit contract: types, tools and the symbol library format | the renderer and the engine |
jet_cad_2d_flutter |
Flutter rendering and interaction | the engine |
jet_cad_2d |
The pure-Dart engine and document model | nothing of jet-cad |
A host that embeds the planner adds jet_cad_2d_plan and the kits it loads;
the kit contract, the renderer and the engine come with them, and a host
should not also depend on them directly unless it uses their API itself.
Embedding the floor planner in an app is walked through in the host guide.
Support
If jet-cad is useful to you, you can support its development through GitHub Sponsors or Buy Me a Coffee.
License
Apache License 2.0. See LICENSE.
Libraries
- 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. - jet_cad_2d_kit
- The kit contract of jet_cad_2d plans: the components a plan stores, the
.jetlibsymbol library format, a kit's words, its symbol sources, its code side (parametric types, tools, property specs, colour targets, attachment providers, the services a plan gives them, diagnostics) and itsPlanKitdescriptor. - testing
- Test doubles for a kit's own tests (spec 3a C1.11): FakePlanServices,
a
PlanServicesover a document, so a kit's tools, grips and providers are tested without the plan library. It moves with the contract: a member the contract adds toPlanServicesis added here in the same change, so a kit's tests keep compiling.