Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions data/main_fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
type: uuid
description:
- Universally unique identifier of the material.
- If not specified, can be deduced from `brand_uuid` + `material_name`.
- If not specified, can be deduced from `brand_uuid` + `material_name` + `color_name`.
- See _UUID_ section for more details.

- key: 3
Expand Down Expand Up @@ -81,16 +81,20 @@
- Coarse classification of the material.
- Useful for determining default parameters for preheat an such that are not explicitly specified in the data.
- If the material does not match any of the proposed material types, can be left unspecified.
- Also see Material naming guidelines.

- key: 10
name: material_name
type: string
max_length: 31
example: PC Blend Carbon Fiber Black
example: PC Blend Carbon Fiber
required: recommended
description:
- Brand-specific material display string/identifier.
- In the UI, brand_name + material_name should be displayed together, for example "Prusament PLA Galaxy Black".
- In the UI, `brand_name` + `material_name` + `color_name` should be displayed together, for example "Prusament PLA Carbon Fiber Black".
- MAY contain color name as well (for example `PC Blend Carbon Fiber Black`), but it is recommended to store the color name separate in the `color_name` field.
- Defaults to `material_abbreviation` if not present.
- Also see Material naming guidelines.

- key: 52
name: material_abbreviation
Expand Down Expand Up @@ -183,6 +187,16 @@
unit: g
description: Weight of the empty container.

- key: 57
name: color_name
type: string
max_length: 32
required: recommended
example: Galaxy Black
description:
- Display/brand/marketing name of the material color.
- Also see Material naming guidelines.

- key: 19
name: primary_color
type: color_rgba
Expand Down
34 changes: 32 additions & 2 deletions docs_src/nfc_data_format.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,21 @@ If a brand decides to change name but wants to keep the original `brand_uuid` th
1. `brand_name = Pepament` (present in the data), `brand_uuid = ae5ff34e-298e-50c9-8f77-92a97fb30b0` (present in the data)


### 3.2.1 UUID derivation algorithm
#### 3.2.1 UUID derivation algorithm
UUIDs are derived from the brand-specific IDs using UUIDv5 with the `SHA1` hash, as specified in [RFC 4122, section 4.3](https://datatracker.ietf.org/doc/html/rfc4122#section-4.3), according to the following table.
1. UUIDs are hashed in the binary form.
1. Strings are encoded as UTF-8.
1. Numbers are encoded as decimal strings.
1. `+` represents binary concatenation.
1. NFC tag UID is represented as a bytestream with the MSB being the first byte in the bytestream.
* **Important:** Various apps/readers report these UIDs in various byte orders, and sometimes as hex strings instead of bytestreams. For NFCV, the UID MUST be a 8 bytes long bytestream with `0xE0` as the **first** byte (SLIX2 then follows with `0x04, 0x01`).
1. If `material_name` is not present, it defaults to `material_abbreviation`, which in turn defaults to abbreviation of `material_type`.
1. The space between `material_name` and `color_name` SHALL be omitted if `color_name` is empty.

| UID | Derviation formula | Namespace (`N`) |
| --- | --- | --- |
| `brand_uuid` | `N + brand_name` | `5269dfb7-1559-440a-85be-aba5f3eff2d2` |
| `material_uuid` | `N + brand_uuid + material_name` | `616fc86d-7d99-4953-96c7-46d2836b9be9` |
| `material_uuid` | `N + brand_uuid + material_name + [" " + color_name]` | `616fc86d-7d99-4953-96c7-46d2836b9be9` |
| `package_uuid` | `N + brand_uuid + gtin` | `6f7d485e-db8d-4979-904e-a231cd6602b2` |
| `instance_uuid` | `N + nfc_tag_uid` | `31062f81-b5bd-4f86-a5f8-46367e841508` |

Expand All @@ -143,6 +145,12 @@ material_name = "PLA Prusa Galaxy Black"
material_uuid = generate_uuid(material_namespace, brand_uuid.bytes, material_name.encode("utf-8"))
print(f"material_uuid = {material_uuid}")

material_namespace = "616fc86d-7d99-4953-96c7-46d2836b9be9"
material_name = "PLA"
color_name = "Prusa Galaxy Black"
material_uuid = generate_uuid(material_namespace, brand_uuid.bytes, material_name.encode("utf-8"), " ".encode("utf-8"), color_name.encode("utf-8"))
print(f"material_uuid = {material_uuid}")

material_package_namespace = "6f7d485e-db8d-4979-904e-a231cd6602b2"
gtin = "1234"
material_package_uuid = generate_uuid(material_package_namespace, brand_uuid.bytes, gtin.encode("utf-8"))
Expand All @@ -154,6 +162,28 @@ material_package_instance_uuid = generate_uuid(material_package_instance_namespa
print(f"material_package_instance_uuid = {material_package_instance_uuid}")
{% endpython %}

### 3.3 Material naming guidelines
The full material name is defined as `brand_name + " " + material_name + " " + color_name`. For some materials, it can be difficult to determine how to split the full name to the individual fields. It is recommended to follow these guidelines:
1. Material "families" (such as PolyLite or PolySonic from Polymaker) SHOULD be part of `material_name`. One company SHOULD generally have a single `brand_name` entry.
1. __Note: This is to have a single `brand_uuid` for the brand__
1. `material_name` SHOULD contain terms that affect primarily material physical properties, such as "high speed", "carbon fiber", "recycled" and so on.
1. Case study: If the material name contains the "carbon fiber" term to indicate visual imitation without actually containing carbon fibers (should also be reflected by not having the `contains_carbon_fiber` tag), the term SHOULD be part of the `color_name` instead.
1. `color_name` SHOULD contain terms that affect primarily material visual properties, such as "matte", "silk", "glow", "rainbow" and individual color names.
1. If the separation between `material_name` and `color_name` is unclear or if the separation would break product name word order, `color_name` MAY be omitted and all terms (excluding brand name) MAY be stored in `material_name`.
1. Please note that the defaulting mechanics of `material_name` and `material_abbreviation` fields apply for both material name and UUID derivation.

#### 3.3.1 Naming examples
| `brand_name` | `material_name` | `color_name` | `abbreviation` | Notes |
| - | - | - | - |
| Prusament | PLA | Prusa Galaxy Black | PLA | |
| Prusament | PC Blend Cabron Fiber | Black | PCCF | |
| Prusament | rPLA | Algae Pigment | rPLA | |
| Prusament | PETG V0 | Natural | PETGV0 | |
| Prusament | PLA Recycled | | rPLA | It is unclear whether "Recycled" stands for color or material name → defaulting everything to `material_name` |
| Polymaker | PolyLite PLA | White | PLA |
| Polymaker | PolySonic PLA | White | PLA |
| Polymaker | PolyLite Luminous PLA Rainbow | | PLA | "Luminous" should technically be a part of `color_name`, defaulting everything to `material_name` to preserve word order. |

## 4. Meta section

The meta section allows defining of region offsets (within the NDEF payload) and sizes.
Expand Down
9 changes: 7 additions & 2 deletions tests/encode_decode/01_info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,15 @@ raw_data:
aux: a000000000000000000000000000000000000000000000000000000000000000000000
uri: https://3dtag.org/s/334c54f088
opt_check:
warnings: []
warnings:
- Missing recommended field 'color_name'
errors: []
notes: []
uuids:
deductions:
material_abbreviation: PLA
material_name: PLA Prusa Galaxy Black
extended_material_name: PLA Prusa Galaxy Black
full_material_name: Prusament PLA Prusa Galaxy Black
brand_uuid: ae5ff34e-298e-50c9-8f77-92a97fb30b09
material_uuid: 1aaca54a-431f-5601-adf5-85dd018f487f
package_uuid: 6e0aece2-1daf-5f2a-ba20-697968ec7d14
Expand Down
9 changes: 7 additions & 2 deletions tests/encode_decode/02_info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,15 @@ raw_data:
aux: a000000000000000000000000000000000000000000000000000000000000000000000
uri: https://3dtag.org/s/7ab2acb509
opt_check:
warnings: []
warnings:
- Missing recommended field 'color_name'
errors: []
notes: []
uuids:
deductions:
material_abbreviation: PETG
material_name: PETG Jet Black
extended_material_name: PETG Jet Black
full_material_name: Prusament PETG Jet Black
brand_uuid: ae5ff34e-298e-50c9-8f77-92a97fb30b09
material_uuid: 1378e978-35ed-534c-9dfa-a65525bf8649
package_uuid: 6f957b59-9725-5068-9102-15bb77807534
Expand Down
8 changes: 7 additions & 1 deletion tests/encode_decode/03_info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ uri: null
opt_check:
warnings:
- Missing recommended field 'brand_name'
- Missing recommended field 'color_name'
- Failed to deduce 'full_material_name'
errors:
- 'Fields preheat_temperature (300), min_print_temperature (240): a <= b'
- 'Fields preheat_temperature (300), max_print_temperature (210): a <= b'
Expand All @@ -70,7 +72,11 @@ opt_check:
- Failed to deduce material_uuid
- Failed to deduce package_uuid
notes: []
uuids:
deductions:
material_abbreviation: PETG
material_name: PETG Jet Black
extended_material_name: PETG Jet Black
full_material_name: null
brand_uuid: null
material_uuid: null
package_uuid: null
Expand Down
7 changes: 6 additions & 1 deletion tests/encode_decode/04_info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,16 @@ uri: https://www.3dxtech.com/
opt_check:
warnings:
- Missing recommended field 'gtin'
- Missing recommended field 'color_name'
- Missing recommended field 'preheat_temperature'
errors:
- Failed to deduce package_uuid
notes: []
uuids:
deductions:
material_abbreviation: PEKK-CF
material_name: CarbonX PEKK-A+CF15 Black
extended_material_name: CarbonX PEKK-A+CF15 Black
full_material_name: 3DXTech CarbonX PEKK-A+CF15 Black
brand_uuid: 0d616a90-9d18-567b-92f9-ce471171f898
material_uuid: 09d4c3e3-f13c-5867-bee3-88eeccb48c6f
package_uuid: null
Expand Down
Binary file added tests/encode_decode/05_data.bin
Binary file not shown.
76 changes: 76 additions & 0 deletions tests/encode_decode/05_info.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
regions:
meta:
payload_offset: 0
absolute_offset: 66
size: 4
used_size: 4
main:
payload_offset: 4
absolute_offset: 70
size: 206
used_size: 145
aux:
payload_offset: 210
absolute_offset: 276
size: 35
used_size: 1
root:
data_size: 312
payload_size: 245
overhead: 67
payload_used_size: 150
total_used_size: 217
data:
meta:
aux_region_offset: 210
main:
gtin: 8594173675001
brand_specific_instance_id: 334c54f088
material_class: FFF
material_type: PLA
brand_name: Prusament
manufactured_date: 1758709719
nominal_netto_full_weight: 1000
actual_netto_full_weight: 1012
empty_container_weight: 280
primary_color:
hex: 3d3e3d
tags:
- glitter
density: 1.24
min_print_temperature: 205
max_print_temperature: 225
preheat_temperature: 170
min_bed_temperature: 40
max_bed_temperature: 60
min_chamber_temperature: 18
max_chamber_temperature: 40
chamber_temperature: 20
container_width: 64
container_outer_diameter: 200
container_inner_diameter: 100
container_hole_diameter: 52
certifications:
- ul_2818
- ul_94_v0
color_name: Prusa Galaxy Black
aux: {}
raw_data:
meta: a10218d2
main: bf041b000007d0fcab45f9056a33333463353466303838080009000b6950727573616d656e740e1a68d3c7d7101903e8111903f41219011813433d3e3d181c9f17ff181df93cf6182218cd182318e1182418aa182518281826183c18271218281828182914182a1840182b18c8182c1864182d183418389f0001ff18397250727573612047616c61787920426c61636bff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
aux: a000000000000000000000000000000000000000000000000000000000000000000000
uri: https://3dtag.org/s/334c54f088
opt_check:
warnings:
- Missing recommended field 'material_name'
errors: []
notes: []
deductions:
material_abbreviation: PLA
material_name: PLA
extended_material_name: PLA Prusa Galaxy Black
full_material_name: Prusament PLA Prusa Galaxy Black
brand_uuid: ae5ff34e-298e-50c9-8f77-92a97fb30b09
material_uuid: 1aaca54a-431f-5601-adf5-85dd018f487f
package_uuid: 6e0aece2-1daf-5f2a-ba20-697968ec7d14
instance_uuid: bf63e92d-9ca5-53d7-9fab-ffdd0240c585
42 changes: 42 additions & 0 deletions tests/encode_decode/05_input.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
test_config:
uri: https://3dtag.org/s/334c54f088
tag_uid: E0040108662F6FBC
extra_required_fields: null
data:
main:
# Material information
material_class: FFF
material_type: PLA
brand_name: Prusament
color_name: Prusa Galaxy Black
primary_color:
hex: 3D3E3D
tags: [glitter]
certifications: [ul_2818, ul_94_v0]
density: 1.24

# Package-spcific fields
gtin: 8594173675001
nominal_netto_full_weight: 1000

# Instance-specific fields
brand_specific_instance_id: "334c54f088"
manufactured_date: 1758709719
actual_netto_full_weight: 1012

# Printing parameters
min_print_temperature: 205
max_print_temperature: 225
min_bed_temperature: 40
max_bed_temperature: 60
preheat_temperature: 170
chamber_temperature: 20
min_chamber_temperature: 18
max_chamber_temperature: 40

# Container info
empty_container_weight: 280
container_outer_diameter: 200
container_inner_diameter: 100
container_hole_diameter: 52
container_width: 64
Loading