Examples › object database › Object library · the dataset's own Bases (proposal 2)
Object library · the dataset's own Bases (proposal 2)
Table-first, and no new view design: the .base files object-db bases already writes (all but Customers, which is private) for Obsidian, read by
data-ui. Each needs two edits (a data: line added; the file.inFolder(...) clause commented out, because a data
file has no vault folders), and Types.base a third (its backlink formula becomes a precomputed column). The peek adds
the 3D orbit viewer on its own, from the field's media: mesh.
The .base file and its data
Every tab above is one entry of this file; the views read these rows. ⋯ in the toolbar copies the current view as YAML.
# Proposal 2 · Table-first: ~/bam-waste-objects/views/Objects.base (bam-waste-objects @ 3a3be7a, written by
# `object-db bases`), read by data-ui. The verbatim file is library/Objects.base; the edits are marked EDIT below.
# Check it: node bin/data-ui.mjs check gallery/examples/object-db-ledger/views.base
data: ../object-db-shelf/objects.json # EDIT 1 (added): data-ui reads a data file; Obsidian reads the vault's notes
filters:
and:
# EDIT 2 (commented out): - file.inFolder("objects") data-ui has no vault folders; the data file IS that folder
- 'kind == "instance"'
properties:
note.name:
displayName: "Name"
note.mass_g:
displayName: "Mass (g)"
note.size_class:
displayName: "Size class"
note.geometry_class:
displayName: "Geometry"
views:
- type: cards
name: "Cards"
groupBy:
property: type
direction: ASC
order:
- name
- material
- form
- mass_g
image: note.thumbnail
imageFit: contain
cardSize: 170
sort:
- property: name
direction: ASC
- type: table
name: "Table"
order:
- name
- type
- material
- form
- colour
- size_class
- geometry_class
- mass_g
- source
sort:
- property: name
direction: ASC
- type: cards
name: "Real scans"
filters:
or:
- 'source == "graspclutter6d"'
- 'source == "graspnet1b"'
groupBy:
property: type
direction: ASC
order:
- name
- material
- form
- mass_g
image: note.thumbnail
imageFit: contain
cardSize: 170
sort:
- property: name
direction: ASC
- type: cards
name: "Soft twins"
filters:
or:
- 'soft_kind == "cloth"'
- 'soft_kind == "film"'
- 'soft_kind == "shell"'
groupBy:
property: type
direction: ASC
order:
- name
- material
- form
- mass_g
image: note.soft_thumbnail
imageFit: contain
cardSize: 170
sort:
- property: name
direction: ASC
// ../object-db-shelf/objects.json: 366 rows, 309 KB; the first 3
{
"id": "bam-objects",
"title": "BAM object library (public sample)",
"titleProperty": "name",
"imageProperty": "thumbnail",
"origin": {
"url": "notes/{id}.md"
},
"source": "BAM's object library @ 3a3be7a: 366 of 2196 instances, public sources only (open-licence scans and BAM's generated primitives), sampled by source/build.py",
"properties": {
"id": {
"type": "text",
"hidden": true
},
"kind": {
"type": "text",
"hidden": true
},
"name": {
"type": "text",
"width": 220
},
"type": {
"type": "text",
"display": "badge",
"facet": "values"
},
"material": {
"type": "text",
"display": "badge",
"facet": "values"
},
"form": {
"type": "text",
"facet": "values"
},
"colour": {
"type": "text",
"facet": "values"
},
"grade": {
"type": "text",
"facet": "values"
},
"damage": {
"type": "text",
"facet": "values"
},
"rigidity": {
"type": "text",
"facet": "values"
},
"brand": {
"type": "text"
},
"source": {
"type": "text",
"facet": "values"
},
"geometry": {
"type": "text",
"facet": "values"
},
"size_class": {
"type": "text"
},
"geometry_class": {
"type": "text"
},
"fits_2f85": {
"type": "boolean"
},
"mass_g": {
"type": "number",
"unitText": "g",
"decimals": 1
},
"length_mm": {
"type": "number",
"unitText": "mm",
"decimals": 0
},
"width_mm": {
"type": "number",
"unitText": "mm",
"decimals": 0
},
"height_mm": {
"type": "number",
"unitText": "mm",
"decimals": 0
},
"bbox_volume_ml": {
"type": "number",
"unitText": "mL",
"decimals": 0
},
"mixes": {
"type": "list"
},
"soft_kind": {
"type": "text"
},
"soft_thumbnail": {
"type": "text",
"media": "image",
"hidden": true
},
"thumbnail": {
"type": "text",
"media": "image",
"hidden": true
},
"mesh": {
"type": "text",
"media": "mesh",
"hidden": true,
"note": "glTF binary, +Y up, metres (built by source/build.py)"
},
"colour_rgb": {
"type": "text",
"hidden": true
},
"mesh_view": {
"type": "text",
"hidden": true,
"note": "the poster's camera {dir, fov, box}: the live 3D starts where the poster was taken (CONTRACT §23, §29)"
},
"license": {
"type": "text"
},
"label_confidence": {
"type": "text"
}
},
"rows": [
{
"id": "egad_a0",
"kind": "instance",
"name": "EGAD A0",
"type": "unclassified",
"material": "unknown",
"form": "part",
"colour": "unknown",
"grade": "non-food",
"damage": "undamaged",
"rigidity": "rigid",
"brand": null,
"source": "egad",
"geometry": "real scan",
"size_class": "500ml",
"geometry_class": "cubic",
"fits_2f85": true,
"mass_g": {
"value": null,
"why": "not known (unknown)"
},
"length_mm": 100.073,
"width_mm": 92.273,
"height_mm": 84.591,
"bbox_volume_ml": 781.116,
"mixes": [
"recyc-quebec-municipal-2023"
],
"soft_kind": null,
"soft_thumbnail": null,
"thumbnail": "thumbs/egad_a0.webp",
"mesh": "meshes/egad_a0.glb",
"colour_rgb": "#9e9e9e",
"mesh_view": {
"dir": [
0.9,
0.8,
1.1
],
"fov": 30,
"camera": "scan",
"box": [
0.0039,
0.043,
0.9961,
0.9414
]
},
"license": "BSD-3-Clause (EGAD, Morrison/Corke/Leitner, QUT 2020)",
"label_confidence": "high"
},
{
"id": "egad_a1",
"kind": "instance",
"name": "EGAD A1",
"type": "unclassified",
"material": "unknown",
"form": "part",
"colour": "unknown",
"grade": "non-food",
"damage": "undamaged",
"rigidity": "rigid",
"brand": null,
"source": "egad",
"geometry": "real scan",
"size_class": "500ml",
"geometry_class": "cubic",
"fits_2f85": false,
"mass_g": {
"value": null,
"why": "not known (unknown)"
},
"length_mm": 100,
"width_mm": 99.999,
"height_mm": 92.506,
"bbox_volume_ml": 925.051,
"mixes": [
"recyc-quebec-municipal-2023"
],
"soft_kind": null,
"soft_thumbnail": null,
"thumbnail": "thumbs/egad_a1.webp",
"mesh": "meshes/egad_a1.glb",
"colour_rgb": "#9a9a9a",
"mesh_view": {
"dir": [
0.9,
0.8,
1.1
],
"fov": 30,
"camera": "scan",
"box": [
0.0039,
0.0273,
0.9961,
0.9727
]
},
"license": "BSD-3-Clause (EGAD, Morrison/Corke/Leitner, QUT 2020)",
"label_confidence": "high"
},
{
"id": "egad_a3",
"kind": "instance",
"name": "EGAD A3",
"type": "unclassified",
"material": "unknown",
"form": "part",
"colour": "unknown",
"grade": "non-food",
"damage": "undamaged",
"rigidity": "rigid",
"brand": null,
"source": "egad",
"geometry": "real scan",
"size_class": "750ml",
"geometry_class": "cubic",
"fits_2f85": false,
"mass_g": {
"value": null,
"why": "not known (unknown)"
},
"length_mm": 99.983,
"width_mm": 99.983,
"height_mm": 99.97,
"bbox_volume_ml": 999.36,
"mixes": [
"recyc-quebec-municipal-2023"
],
"soft_kind": null,
"soft_thumbnail": null,
"thumbnail": "thumbs/egad_a3.webp",
"mesh": "meshes/egad_a3.glb",
"colour_rgb": "#9b9b9b",
"mesh_view": {
"dir": [
0.9,
0.8,
1.1
],
"fov": 30,
"camera": "scan",
"box": [
0.0078,
0.0078,
0.9961,
0.9844
]
},
"license": "BSD-3-Clause (EGAD, Morrison/Corke/Leitner, QUT 2020)",
"label_confidence": "high"
}
]
}README.md
# Object library · the dataset's own Bases (proposal 2)
Table-first, and no new view design: the `.base` files `object-db bases` already writes (all but Customers, which is private) for Obsidian, read by
data-ui. Each needs two edits (a `data:` line added; the `file.inFolder(...)` clause commented out, because a data
file has no vault folders), and Types.base a third (its backlink formula becomes a precomputed column). The peek adds
the 3D orbit viewer on its own, from the field's `media: mesh`.
- **App:** object database
- **Replaces:** nothing: it is the same files, so Obsidian and data-ui show one library the same way. The verbatim copies are in `library/`.
- **Shows:** table, cards (the dataset's Cards, Real scans, Soft twins), the peek's 3D viewer, the measured gap between Obsidian's grammar and data-ui's (`file.*` and formulas)
- **Data:** `../object-db-shelf/objects.json`, `types.json`, `materials.json`, `mix_list.json` (a public-safe sample, built by `../object-db-shelf/source/build.py`; the library's Customers.base is not reproduced: customers are private)
- **Prior art:** Obsidian Bases (the files themselves), Airtable and Notion database tables, FiftyOne's sample table
On the public sample the dataset's "Real scans" view (GraspClutter6D and GraspNet-1B scans) shows no rows: those scans' licences keep them out of a published gallery. The view is kept as the dataset wrote it.
The original UI it replaces
nothing: it is the same files, so Obsidian and data-ui show one library the same way. The verbatim copies are in library/.
What it shows
table, cards (the dataset's Cards, Real scans, Soft twins), the peek's 3D viewer, the measured gap between Obsidian's grammar and data-ui's (file.* and formulas)
Data
../object-db-shelf/objects.json, types.json, materials.json, mix_list.json (a public-safe sample, built by ../object-db-shelf/source/build.py; the library's Customers.base is not reproduced: customers are private)