Skip to content

Commit 49e1faf

Browse files
committed
Add material certifications
BFW-8077
1 parent bfbab19 commit 49e1faf

8 files changed

Lines changed: 43 additions & 5 deletions

File tree

data/main_fields.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,13 @@
244244
required: recommended
245245
description: Properties of the material. Can have multiple tags at once.
246246

247+
- key: 56
248+
name: certifications
249+
type: enum_array
250+
items_file: material_certifications_enum.yaml
251+
example: "`ul_2818`"
252+
description: Certifications the material has.
253+
247254
- key: 29
248255
name: density
249256
type: number
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
- key: 0
2+
name: ul_2818
3+
display_name: UL 2818
4+
description:
5+
- GREENGUARD Certification Program For Chemical Emissions For Building Materials, Finishes And Furnishings.
6+
7+
- key: 1
8+
name: ul_94_v0
9+
display_name: UL 94 V0
10+
description:
11+
- Standard for Safety of Flammability of Plastic Materials for Parts in Devices and Appliances testing.
12+
- Indicates a flame-retardant material.

docs_src/_sidebar.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- [Data format](/nfc_data_format)
44
- [Material types](/material_types)
55
- [Material tags](/material_tags)
6+
- [Material certifications](/material_certifications)
67
- [Technical details](/nfc_technical_details)
78
- [Examples](/examples)
89
- [Contributing](/contributing)

docs_src/generate.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ def gen_material_tag_table():
7373
Column(field="description", title="Description"),
7474
]
7575

76+
env.globals["material_certification_columns"] = [
77+
Column(field="key", title="Key"),
78+
Column(field="name", title="Name", transform=lambda x: f"`{x}`"),
79+
Column(field="display_name", title="Display name"),
80+
Column(field="description", title="Description"),
81+
]
82+
7683
gen_doc_file("_navbar")
7784
gen_doc_file("_sidebar")
7885
gen_doc_file("README")
@@ -82,7 +89,8 @@ def gen_material_tag_table():
8289
gen_doc_file("nfc_technical_details")
8390
gen_doc_file("examples")
8491
gen_doc_file("contributing")
85-
gen_doc_file("material_tags")
8692
gen_doc_file("material_types")
93+
gen_doc_file("material_tags")
94+
gen_doc_file("material_certifications")
8795

8896
shutil.copyfile(f"{dir}/class_diagram.svg", f"{out_dir}/class_diagram.svg")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Material certifications
2+
Material certifications allow expressing what certificates a material has.
3+
4+
The certifications are stored as an enum on the tag to reduce memory usage and promote standard encoding. If there is a certification missing in the enum, please create a PR or file an issue in the [OpenPrintTag repository]({{repo}}).
5+
6+
{{ enum_table("material_certifications_enum", material_certification_columns) }}

tests/encode_decode/01_data.bin

0 Bytes
Binary file not shown.

tests/encode_decode/01_info.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ regions:
88
payload_offset: 4
99
absolute_offset: 70
1010
size: 206
11-
used_size: 142
11+
used_size: 148
1212
aux:
1313
payload_offset: 210
1414
absolute_offset: 276
@@ -18,8 +18,8 @@ root:
1818
data_size: 312
1919
payload_size: 245
2020
overhead: 67
21-
payload_used_size: 147
22-
total_used_size: 214
21+
payload_used_size: 153
22+
total_used_size: 220
2323
data:
2424
meta:
2525
aux_region_offset: 210
@@ -51,10 +51,13 @@ data:
5151
container_outer_diameter: 200
5252
container_inner_diameter: 100
5353
container_hole_diameter: 52
54+
certifications:
55+
- ul_2818
56+
- ul_94_v0
5457
aux: {}
5558
raw_data:
5659
meta: a10218d2
57-
main: bf041b000007d0fcab45f9056a33333463353466303838080009000a76504c412050727573612047616c61787920426c61636b0b6950727573616d656e740e1a68d3c7d7101903e8111903f41219011813433d3e3d181c9f17ff181df93cf6182218cd182318e1182418aa182518281826183c18271218281828182914182a1840182b18c8182c1864182d1834ff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
60+
main: bf041b000007d0fcab45f9056a33333463353466303838080009000a76504c412050727573612047616c61787920426c61636b0b6950727573616d656e740e1a68d3c7d7101903e8111903f41219011813433d3e3d181c9f17ff181df93cf6182218cd182318e1182418aa182518281826183c18271218281828182914182a1840182b18c8182c1864182d183418389f0001ffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
5861
aux: a000000000000000000000000000000000000000000000000000000000000000000000
5962
uri: https://3dtag.org/s/334c54f088
6063
opt_check:

tests/encode_decode/01_input.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ data:
1111
primary_color:
1212
hex: 3D3E3D
1313
tags: [glitter]
14+
certifications: [ul_2818, ul_94_v0]
1415
density: 1.24
1516

1617
# Package-spcific fields

0 commit comments

Comments
 (0)