Skip to main content

jet_cad_2d_kit 0.1.1 copy "jet_cad_2d_kit: ^0.1.1" to clipboard
jet_cad_2d_kit: ^0.1.1 copied to clipboard

The kit contract for jet_cad_2d plans: plan components, the .jetlib symbol library format and validator, kit words, and a pure-Dart authoring toolkit.

example/example.dart

// A one-symbol kit: its catalog, its words, its library, decoded.
//
//   cd packages/jet_cad_2d_kit && dart run example/example.dart
import 'package:jet_cad_2d_kit/authoring.dart';

/// The catalog of a kit "cafe": one round table for two, a service unit.
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),
        ],
      ),
    ]);

/// The kit's words: Turkish, declared complete.
const KitNames cafeNames = KitNames({
  'tr': {
    'symbol:cafe.table.round-two': 'Yuvarlak masa, 2 kişilik',
    'category:cafe/Tables': 'Masalar',
  },
});

void main() {
  final library = SymbolLibrary.decode(encodeLibrary(buildCafeCatalog()));
  for (final entry in library.entries) {
    print('${entry.id}: ${entry.leaves.length} leaves, '
        '${cafeNames.symbolName('tr', entry.symbol)}, '
        'capacity ${entry.unit?.capacity}');
  }
}
1
likes
160
points
194
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

The kit contract for jet_cad_2d plans: plan components, the .jetlib symbol library format and validator, kit words, and a pure-Dart authoring toolkit.

Repository (GitHub)
View/report issues

Topics

#cad #floor-plan #symbols

Funding

Consider supporting this project:

github.com
buymeacoffee.com

License

Apache-2.0 (license)

Dependencies

flutter, jet_cad_2d, jet_cad_2d_flutter, meta, vector_math

More

Packages that depend on jet_cad_2d_kit