diff --git a/content/kcl-test-outputs/models/serial_test_example_fn_std-gdt-annotation0_output.gltf b/content/kcl-test-outputs/models/serial_test_example_fn_std-gdt-annotation0_output.gltf new file mode 100644 index 00000000..ac483198 --- /dev/null +++ b/content/kcl-test-outputs/models/serial_test_example_fn_std-gdt-annotation0_output.gltf @@ -0,0 +1,1040 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0, + 0, + -0 + ], + "max": [ + 0.009999999776482582, + 0.004999999888241291, + -0 + ] + }, + { + "bufferView": 0, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0.009999999776482582, + 0, + -0.009999999776482582 + ], + "max": [ + 0.009999999776482582, + 0.004999999888241291, + -0 + ] + }, + { + "bufferView": 1, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + }, + { + "bufferView": 2, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0, + 0, + -0.009999999776482582 + ], + "max": [ + 0.009999999776482582, + 0.004999999888241291, + -0.009999999776482582 + ] + }, + { + "bufferView": 2, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0, + 0, + -0.009999999776482582 + ], + "max": [ + 0, + 0.004999999888241291, + -0 + ] + }, + { + "bufferView": 3, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0, + 0, + -0.009999999776482582 + ], + "max": [ + 0.009999999776482582, + 0, + -0 + ] + }, + { + "bufferView": 4, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + }, + { + "bufferView": 5, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0, + 0.004999999888241291, + -0.009999999776482582 + ], + "max": [ + 0.009999999776482582, + 0.004999999888241291, + -0 + ] + }, + { + "bufferView": 5, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + } + ], + "asset": { + "generator": "zoo.dev", + "version": "2.0" + }, + "buffers": [ + { + "byteLength": 864, + "uri": "data:application/octet-stream;base64,AAAAAArXozsAAACAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAACAAAAAAAAAAAAAAIA/CtcjPArXozsAAACAAAAAAAAAAAAAAIA/CtcjPArXozsAAACAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAACAAAAAAAAAAAAAAIA/CtcjPAAAAAAAAACAAAAAAAAAAAAAAIA/CtcjPArXozsAAACAAACAPwAAAAAAAAAACtcjPAAAAAAAAACAAACAPwAAAAAAAAAACtcjPArXozsK1yO8AACAPwAAAAAAAAAACtcjPArXozsK1yO8AACAPwAAAAAAAAAACtcjPAAAAAAAAACAAACAPwAAAAAAAAAACtcjPAAAAAAK1yO8AACAPwAAAAAAAAAACtcjPArXozsK1yO8AAAAAAAAAAAAAIC/CtcjPAAAAAAK1yO8AAAAAAAAAAAAAIC/AAAAAArXozsK1yO8AAAAAAAAAAAAAIC/AAAAAArXozsK1yO8AAAAAAAAAAAAAIC/CtcjPAAAAAAK1yO8AAAAAAAAAAAAAIC/AAAAAAAAAAAK1yO8AAAAAAAAAAAAAIC/AAAAAArXozsK1yO8AACAvwAAAAAAAAAAAAAAAAAAAAAK1yO8AACAvwAAAAAAAAAAAAAAAArXozsAAACAAACAvwAAAAAAAAAAAAAAAArXozsAAACAAACAvwAAAAAAAAAAAAAAAAAAAAAK1yO8AACAvwAAAAAAAAAAAAAAAAAAAAAAAACAAACAvwAAAAAAAAAAAAAAAAAAAAAK1yO8AAAAgAAAgL8AAACACtcjPAAAAAAK1yO8AAAAgAAAgL8AAACAAAAAAAAAAAAAAACAAAAAgAAAgL8AAACACtcjPAAAAAAK1yO8AAAAgAAAgL8AAACACtcjPAAAAAAAAACAAAAAgAAAgL8AAACAAAAAAAAAAAAAAACAAAAAgAAAgL8AAACAAAAAAArXozsK1yO8AAAAAAAAgD8AAAAAAAAAAArXozsAAACAAAAAAAAAgD8AAAAACtcjPArXozsK1yO8AAAAAAAAgD8AAAAACtcjPArXozsK1yO8AAAAAAAAgD8AAAAAAAAAAArXozsAAACAAAAAAAAAgD8AAAAACtcjPArXozsAAACAAAAAAAAAgD8AAAAA" + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 0, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 144, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 288, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 432, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 576, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 720, + "byteStride": 24, + "target": 34962 + } + ], + "scene": 0, + "extensions": { + "KITTYCAD_boundary_representation": { + "solids": [ + { + "shells": [ + [ + 0, + 1 + ] + ], + "mesh": 0, + "extras": { + "KITTYCAD": { + "material": 0 + } + } + } + ], + "shells": [ + { + "faces": [ + [ + 0, + 1 + ], + [ + 1, + 1 + ], + [ + 2, + 1 + ], + [ + 3, + 1 + ], + [ + 4, + 1 + ], + [ + 5, + 1 + ] + ] + } + ], + "faces": [ + { + "surface": [ + 0, + 1 + ], + "loops": [ + [ + 0, + 1 + ] + ] + }, + { + "surface": [ + 1, + 1 + ], + "loops": [ + [ + 1, + 1 + ] + ] + }, + { + "surface": [ + 2, + 1 + ], + "loops": [ + [ + 2, + 1 + ] + ] + }, + { + "surface": [ + 3, + 1 + ], + "loops": [ + [ + 3, + 1 + ] + ] + }, + { + "surface": [ + 4, + -1 + ], + "loops": [ + [ + 4, + 1 + ] + ] + }, + { + "surface": [ + 5, + 1 + ], + "loops": [ + [ + 5, + 1 + ] + ] + } + ], + "loops": [ + { + "edges": [ + [ + 0, + 1 + ], + [ + 1, + 1 + ], + [ + 2, + -1 + ], + [ + 3, + -1 + ] + ] + }, + { + "edges": [ + [ + 4, + 1 + ], + [ + 5, + 1 + ], + [ + 6, + -1 + ], + [ + 1, + -1 + ] + ] + }, + { + "edges": [ + [ + 7, + 1 + ], + [ + 8, + 1 + ], + [ + 9, + -1 + ], + [ + 5, + -1 + ] + ] + }, + { + "edges": [ + [ + 10, + 1 + ], + [ + 3, + 1 + ], + [ + 11, + -1 + ], + [ + 8, + -1 + ] + ] + }, + { + "edges": [ + [ + 10, + -1 + ], + [ + 7, + -1 + ], + [ + 4, + -1 + ], + [ + 0, + -1 + ] + ] + }, + { + "edges": [ + [ + 2, + 1 + ], + [ + 6, + 1 + ], + [ + 9, + 1 + ], + [ + 11, + 1 + ] + ] + } + ], + "edges": [ + { + "curve": [ + 0, + 1 + ], + "start": 0, + "end": 1, + "t": [ + 0, + 0.01 + ] + }, + { + "curve": [ + 1, + 1 + ], + "start": 1, + "end": 2, + "t": [ + 0, + 0.005 + ] + }, + { + "curve": [ + 2, + 1 + ], + "start": 3, + "end": 2, + "t": [ + 0, + 0.01 + ] + }, + { + "curve": [ + 3, + 1 + ], + "start": 0, + "end": 3, + "t": [ + 0, + 0.005 + ] + }, + { + "curve": [ + 4, + 1 + ], + "start": 1, + "end": 4, + "t": [ + 0, + 0.01 + ] + }, + { + "curve": [ + 5, + 1 + ], + "start": 4, + "end": 5, + "t": [ + 0, + 0.005 + ] + }, + { + "curve": [ + 6, + 1 + ], + "start": 2, + "end": 5, + "t": [ + 0, + 0.01 + ] + }, + { + "curve": [ + 7, + 1 + ], + "start": 4, + "end": 6, + "t": [ + 0, + 0.01 + ] + }, + { + "curve": [ + 8, + 1 + ], + "start": 6, + "end": 7, + "t": [ + 0, + 0.005 + ] + }, + { + "curve": [ + 9, + 1 + ], + "start": 5, + "end": 7, + "t": [ + 0, + 0.01 + ] + }, + { + "curve": [ + 10, + 1 + ], + "start": 6, + "end": 0, + "t": [ + 0, + 0.01 + ] + }, + { + "curve": [ + 11, + 1 + ], + "start": 7, + "end": 3, + "t": [ + 0, + 0.01 + ] + } + ], + "vertices": [ + [ + 0, + 0, + -0 + ], + [ + 0.01, + 0, + -0 + ], + [ + 0.01, + 0.005, + -0 + ], + [ + 0, + 0.005, + -0 + ], + [ + 0.01, + 0, + -0.01 + ], + [ + 0.01, + 0.005, + -0.01 + ], + [ + 0, + 0, + -0.01 + ], + [ + 0, + 0.005, + -0.01 + ] + ], + "surfaces": [ + { + "type": "plane", + "plane": { + "xAxis": [ + 1, + 0, + -0 + ], + "yAxis": [ + -0, + 1, + 0 + ], + "origin": [ + 0.005, + 0.0025, + -0 + ] + } + }, + { + "type": "plane", + "plane": { + "xAxis": [ + -0, + 1, + 0 + ], + "yAxis": [ + 0, + -0, + 1 + ], + "origin": [ + 0.01, + 0.0025, + -0.005 + ] + } + }, + { + "type": "plane", + "plane": { + "xAxis": [ + 1, + 0, + 0 + ], + "yAxis": [ + 0, + -1, + 0 + ], + "origin": [ + 0.005, + 0.0025, + -0.01 + ] + } + }, + { + "type": "plane", + "plane": { + "xAxis": [ + 0, + 1, + 0 + ], + "yAxis": [ + 0, + 0, + -1 + ], + "origin": [ + 0, + 0.0025, + -0.005 + ] + } + }, + { + "type": "plane", + "plane": { + "xAxis": [ + 1, + 0, + 0 + ], + "yAxis": [ + 0, + 0, + -1 + ], + "origin": [ + 0, + 0, + -0 + ] + } + }, + { + "type": "plane", + "plane": { + "xAxis": [ + 1, + 0, + 0 + ], + "yAxis": [ + 0, + 0, + -1 + ], + "origin": [ + 0, + 0.005, + -0 + ] + } + } + ], + "curves3D": [ + { + "type": "line", + "line": { + "origin": [ + 0, + 0, + -0 + ], + "direction": [ + 1, + 0, + -0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0, + -0 + ], + "direction": [ + 0, + 1, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0, + 0.005, + -0 + ], + "direction": [ + 1, + 0, + -0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0, + 0, + -0 + ], + "direction": [ + 0, + 1, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0, + -0 + ], + "direction": [ + 0, + 0, + -1 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0, + -0.01 + ], + "direction": [ + 0, + 1, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0.005, + -0 + ], + "direction": [ + 0, + 0, + -1 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0, + -0.01 + ], + "direction": [ + -1, + 0, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0, + 0, + -0.01 + ], + "direction": [ + 0, + 1, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0.005, + -0.01 + ], + "direction": [ + -1, + 0, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0, + 0, + -0.01 + ], + "direction": [ + 0, + 0, + 1 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0, + 0.005, + -0.01 + ], + "direction": [ + 0, + 0, + 1 + ] + } + } + ] + } + }, + "extensionsUsed": [ + "KITTYCAD_boundary_representation" + ], + "materials": [ + { + "alphaMode": "OPAQUE", + "doubleSided": false, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.9, + 0.9, + 0.9, + 1 + ], + "metallicFactor": 1, + "roughnessFactor": 1 + }, + "emissiveFactor": [ + 0, + 0, + 0 + ] + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "NORMAL": 1 + }, + "material": 0 + }, + { + "attributes": { + "POSITION": 2, + "NORMAL": 3 + }, + "material": 0 + }, + { + "attributes": { + "POSITION": 4, + "NORMAL": 5 + }, + "material": 0 + }, + { + "attributes": { + "POSITION": 6, + "NORMAL": 7 + }, + "material": 0 + }, + { + "attributes": { + "POSITION": 8, + "NORMAL": 9 + }, + "material": 0 + }, + { + "attributes": { + "POSITION": 10, + "NORMAL": 11 + }, + "material": 0 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1 + ] + }, + { + "children": [ + 2 + ] + }, + { + "extensions": { + "KITTYCAD_boundary_representation": { + "solid": 0 + } + }, + "mesh": 0 + } + ], + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} \ No newline at end of file diff --git a/content/kcl-test-outputs/models/serial_test_example_fn_std-gdt-annotation1_output.gltf b/content/kcl-test-outputs/models/serial_test_example_fn_std-gdt-annotation1_output.gltf new file mode 100644 index 00000000..a26696fd --- /dev/null +++ b/content/kcl-test-outputs/models/serial_test_example_fn_std-gdt-annotation1_output.gltf @@ -0,0 +1,1040 @@ +{ + "accessors": [ + { + "bufferView": 0, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0.009999999776482582, + 0, + -0.006000000052154064 + ], + "max": [ + 0.009999999776482582, + 0.004000000189989805, + -0 + ] + }, + { + "bufferView": 0, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + }, + { + "bufferView": 1, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0, + 0, + -0.006000000052154064 + ], + "max": [ + 0.009999999776482582, + 0.004000000189989805, + -0.006000000052154064 + ] + }, + { + "bufferView": 1, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + }, + { + "bufferView": 2, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0, + 0, + -0.006000000052154064 + ], + "max": [ + 0, + 0.004000000189989805, + -0 + ] + }, + { + "bufferView": 2, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + }, + { + "bufferView": 3, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0, + 0, + -0 + ], + "max": [ + 0.009999999776482582, + 0.004000000189989805, + -0 + ] + }, + { + "bufferView": 3, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + }, + { + "bufferView": 4, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0, + 0, + -0.006000000052154064 + ], + "max": [ + 0.009999999776482582, + 0, + -0 + ] + }, + { + "bufferView": 4, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + }, + { + "bufferView": 5, + "byteOffset": 0, + "count": 6, + "componentType": 5126, + "type": "VEC3", + "min": [ + 0, + 0.004000000189989805, + -0.006000000052154064 + ], + "max": [ + 0.009999999776482582, + 0.004000000189989805, + -0 + ] + }, + { + "bufferView": 5, + "byteOffset": 12, + "count": 6, + "componentType": 5126, + "type": "VEC3" + } + ], + "asset": { + "generator": "zoo.dev", + "version": "2.0" + }, + "buffers": [ + { + "byteLength": 864, + "uri": "data:application/octet-stream;base64,CtcjPG8SgzsAAACAAACAPwAAAAAAAAAACtcjPAAAAAAAAACAAACAPwAAAAAAAAAACtcjPG8Sgzumm8S7AACAPwAAAAAAAAAACtcjPG8Sgzumm8S7AACAPwAAAAAAAAAACtcjPAAAAAAAAACAAACAPwAAAAAAAAAACtcjPAAAAACmm8S7AACAPwAAAAAAAAAACtcjPG8Sgzumm8S7AAAAAAAAAAAAAIC/CtcjPAAAAACmm8S7AAAAAAAAAAAAAIC/AAAAAG8Sgzumm8S7AAAAAAAAAAAAAIC/AAAAAG8Sgzumm8S7AAAAAAAAAAAAAIC/CtcjPAAAAACmm8S7AAAAAAAAAAAAAIC/AAAAAAAAAACmm8S7AAAAAAAAAAAAAIC/AAAAAG8Sgzumm8S7AACAvwAAAAAAAAAAAAAAAAAAAACmm8S7AACAvwAAAAAAAAAAAAAAAG8SgzsAAACAAACAvwAAAAAAAAAAAAAAAG8SgzsAAACAAACAvwAAAAAAAAAAAAAAAAAAAACmm8S7AACAvwAAAAAAAAAAAAAAAAAAAAAAAACAAACAvwAAAAAAAAAAAAAAAG8SgzsAAACAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAACAAAAAAAAAAAAAAIA/CtcjPG8SgzsAAACAAAAAAAAAAAAAAIA/CtcjPG8SgzsAAACAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAACAAAAAAAAAAAAAAIA/CtcjPAAAAAAAAACAAAAAAAAAAAAAAIA/AAAAAAAAAAAAAACAAAAAgAAAgL8AAACAAAAAAAAAAACmm8S7AAAAgAAAgL8AAACACtcjPAAAAAAAAACAAAAAgAAAgL8AAACAAAAAAAAAAACmm8S7AAAAgAAAgL8AAACACtcjPAAAAACmm8S7AAAAgAAAgL8AAACACtcjPAAAAAAAAACAAAAAgAAAgL8AAACAAAAAAG8SgzsAAACAAAAAAAAAgD8AAAAACtcjPG8SgzsAAACAAAAAAAAAgD8AAAAAAAAAAG8Sgzumm8S7AAAAAAAAgD8AAAAAAAAAAG8Sgzumm8S7AAAAAAAAgD8AAAAACtcjPG8SgzsAAACAAAAAAAAAgD8AAAAACtcjPG8Sgzumm8S7AAAAAAAAgD8AAAAA" + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 0, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 144, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 288, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 432, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 576, + "byteStride": 24, + "target": 34962 + }, + { + "buffer": 0, + "byteLength": 144, + "byteOffset": 720, + "byteStride": 24, + "target": 34962 + } + ], + "scene": 0, + "extensions": { + "KITTYCAD_boundary_representation": { + "solids": [ + { + "shells": [ + [ + 0, + 1 + ] + ], + "mesh": 0, + "extras": { + "KITTYCAD": { + "material": 0 + } + } + } + ], + "shells": [ + { + "faces": [ + [ + 0, + 1 + ], + [ + 1, + 1 + ], + [ + 2, + 1 + ], + [ + 3, + 1 + ], + [ + 4, + 1 + ], + [ + 5, + 1 + ] + ] + } + ], + "faces": [ + { + "surface": [ + 0, + 1 + ], + "loops": [ + [ + 0, + 1 + ] + ] + }, + { + "surface": [ + 1, + 1 + ], + "loops": [ + [ + 1, + 1 + ] + ] + }, + { + "surface": [ + 2, + 1 + ], + "loops": [ + [ + 2, + 1 + ] + ] + }, + { + "surface": [ + 3, + 1 + ], + "loops": [ + [ + 3, + 1 + ] + ] + }, + { + "surface": [ + 4, + -1 + ], + "loops": [ + [ + 4, + 1 + ] + ] + }, + { + "surface": [ + 5, + 1 + ], + "loops": [ + [ + 5, + 1 + ] + ] + } + ], + "loops": [ + { + "edges": [ + [ + 0, + 1 + ], + [ + 1, + 1 + ], + [ + 2, + -1 + ], + [ + 3, + -1 + ] + ] + }, + { + "edges": [ + [ + 4, + 1 + ], + [ + 5, + 1 + ], + [ + 6, + -1 + ], + [ + 1, + -1 + ] + ] + }, + { + "edges": [ + [ + 7, + 1 + ], + [ + 8, + 1 + ], + [ + 9, + -1 + ], + [ + 5, + -1 + ] + ] + }, + { + "edges": [ + [ + 10, + 1 + ], + [ + 3, + 1 + ], + [ + 11, + -1 + ], + [ + 8, + -1 + ] + ] + }, + { + "edges": [ + [ + 10, + -1 + ], + [ + 7, + -1 + ], + [ + 4, + -1 + ], + [ + 0, + -1 + ] + ] + }, + { + "edges": [ + [ + 2, + 1 + ], + [ + 6, + 1 + ], + [ + 9, + 1 + ], + [ + 11, + 1 + ] + ] + } + ], + "edges": [ + { + "curve": [ + 0, + 1 + ], + "start": 0, + "end": 1, + "t": [ + 0, + 0.006 + ] + }, + { + "curve": [ + 1, + 1 + ], + "start": 1, + "end": 2, + "t": [ + 0, + 0.004 + ] + }, + { + "curve": [ + 2, + 1 + ], + "start": 3, + "end": 2, + "t": [ + 0, + 0.006 + ] + }, + { + "curve": [ + 3, + 1 + ], + "start": 0, + "end": 3, + "t": [ + 0, + 0.004 + ] + }, + { + "curve": [ + 4, + 1 + ], + "start": 1, + "end": 4, + "t": [ + 0, + 0.01 + ] + }, + { + "curve": [ + 5, + 1 + ], + "start": 4, + "end": 5, + "t": [ + 0, + 0.004 + ] + }, + { + "curve": [ + 6, + 1 + ], + "start": 2, + "end": 5, + "t": [ + 0, + 0.01 + ] + }, + { + "curve": [ + 7, + 1 + ], + "start": 4, + "end": 6, + "t": [ + 0, + 0.006 + ] + }, + { + "curve": [ + 8, + 1 + ], + "start": 6, + "end": 7, + "t": [ + 0, + 0.004 + ] + }, + { + "curve": [ + 9, + 1 + ], + "start": 5, + "end": 7, + "t": [ + 0, + 0.006 + ] + }, + { + "curve": [ + 10, + 1 + ], + "start": 6, + "end": 0, + "t": [ + 0, + 0.01 + ] + }, + { + "curve": [ + 11, + 1 + ], + "start": 7, + "end": 3, + "t": [ + 0, + 0.01 + ] + } + ], + "vertices": [ + [ + 0.01, + 0, + -0 + ], + [ + 0.01, + 0, + -0.006 + ], + [ + 0.01, + 0.004, + -0.006 + ], + [ + 0.01, + 0.004, + -0 + ], + [ + 0, + 0, + -0.006 + ], + [ + 0, + 0.004, + -0.006 + ], + [ + 0, + 0, + -0 + ], + [ + 0, + 0.004, + -0 + ] + ], + "surfaces": [ + { + "type": "plane", + "plane": { + "xAxis": [ + -0, + 1, + 0 + ], + "yAxis": [ + 0, + -0, + 1 + ], + "origin": [ + 0.01, + 0.002, + -0.003 + ] + } + }, + { + "type": "plane", + "plane": { + "xAxis": [ + 1, + 0, + 0 + ], + "yAxis": [ + 0, + -1, + 0 + ], + "origin": [ + 0.005, + 0.002, + -0.006 + ] + } + }, + { + "type": "plane", + "plane": { + "xAxis": [ + 0, + 1, + 0 + ], + "yAxis": [ + 0, + 0, + -1 + ], + "origin": [ + 0, + 0.002, + -0.003 + ] + } + }, + { + "type": "plane", + "plane": { + "xAxis": [ + 1, + 0, + -0 + ], + "yAxis": [ + -0, + 1, + 0 + ], + "origin": [ + 0.005, + 0.002, + -0 + ] + } + }, + { + "type": "plane", + "plane": { + "xAxis": [ + 1, + 0, + 0 + ], + "yAxis": [ + 0, + 0, + -1 + ], + "origin": [ + 0, + 0, + -0 + ] + } + }, + { + "type": "plane", + "plane": { + "xAxis": [ + 1, + 0, + 0 + ], + "yAxis": [ + 0, + 0, + -1 + ], + "origin": [ + 0, + 0.004, + -0 + ] + } + } + ], + "curves3D": [ + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0, + -0 + ], + "direction": [ + 0, + 0, + -1 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0, + -0.006 + ], + "direction": [ + 0, + 1, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0.004, + -0 + ], + "direction": [ + 0, + 0, + -1 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0, + -0 + ], + "direction": [ + 0, + 1, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0, + -0.006 + ], + "direction": [ + -1, + 0, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0, + 0, + -0.006 + ], + "direction": [ + 0, + 1, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0.01, + 0.004, + -0.006 + ], + "direction": [ + -1, + 0, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0, + 0, + -0.006 + ], + "direction": [ + 0, + 0, + 1 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0, + 0, + -0 + ], + "direction": [ + 0, + 1, + 0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0, + 0.004, + -0.006 + ], + "direction": [ + 0, + 0, + 1 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0, + 0, + -0 + ], + "direction": [ + 1, + 0, + -0 + ] + } + }, + { + "type": "line", + "line": { + "origin": [ + 0, + 0.004, + -0 + ], + "direction": [ + 1, + 0, + -0 + ] + } + } + ] + } + }, + "extensionsUsed": [ + "KITTYCAD_boundary_representation" + ], + "materials": [ + { + "alphaMode": "OPAQUE", + "doubleSided": false, + "pbrMetallicRoughness": { + "baseColorFactor": [ + 0.9, + 0.9, + 0.9, + 1 + ], + "metallicFactor": 1, + "roughnessFactor": 1 + }, + "emissiveFactor": [ + 0, + 0, + 0 + ] + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 0, + "NORMAL": 1 + }, + "material": 0 + }, + { + "attributes": { + "POSITION": 2, + "NORMAL": 3 + }, + "material": 0 + }, + { + "attributes": { + "POSITION": 4, + "NORMAL": 5 + }, + "material": 0 + }, + { + "attributes": { + "POSITION": 6, + "NORMAL": 7 + }, + "material": 0 + }, + { + "attributes": { + "POSITION": 8, + "NORMAL": 9 + }, + "material": 0 + }, + { + "attributes": { + "POSITION": 10, + "NORMAL": 11 + }, + "material": 0 + } + ] + } + ], + "nodes": [ + { + "children": [ + 1 + ] + }, + { + "children": [ + 2 + ] + }, + { + "extensions": { + "KITTYCAD_boundary_representation": { + "solid": 0 + } + }, + "mesh": 0 + } + ], + "scenes": [ + { + "nodes": [ + 0 + ] + } + ] +} \ No newline at end of file diff --git a/content/kcl-test-outputs/serial_test_example_fn_std-gdt-annotation0.png b/content/kcl-test-outputs/serial_test_example_fn_std-gdt-annotation0.png new file mode 100644 index 00000000..becb90d8 Binary files /dev/null and b/content/kcl-test-outputs/serial_test_example_fn_std-gdt-annotation0.png differ diff --git a/content/kcl-test-outputs/serial_test_example_fn_std-gdt-annotation1.png b/content/kcl-test-outputs/serial_test_example_fn_std-gdt-annotation1.png new file mode 100644 index 00000000..a7c7b40c Binary files /dev/null and b/content/kcl-test-outputs/serial_test_example_fn_std-gdt-annotation1.png differ diff --git a/content/pages/docs/kcl-std/functions/std-gdt-annotation.md b/content/pages/docs/kcl-std/functions/std-gdt-annotation.md new file mode 100644 index 00000000..c343a8c1 --- /dev/null +++ b/content/pages/docs/kcl-std/functions/std-gdt-annotation.md @@ -0,0 +1,103 @@ +--- +title: "gdt::annotation" +subtitle: "Function in std::gdt" +excerpt: "GD&T annotation for attaching manufacturing text to faces or edges." +layout: manual +--- + +**WARNING:** This function is experimental and may change or be removed. + +GD&T annotation for attaching manufacturing text to faces or edges. + +```kcl +gdt::annotation( + annotation: string, + faces?: [TaggedFace; 1+], + edges?: [Edge; 1+], + framePosition?: Point2d, + framePlane?: Plane, + leaderScale?: number(_), + fontPointSize?: number(_), + fontScale?: number(_), +): [GdtAnnotation; 1+] +``` + +This is part of model-based definition (MBD). + +### Arguments + +| Name | Type | Description | Required | +|----------|------|-------------|----------| +| `annotation` | [`string`](/docs/kcl-std/types/std-types-string) | The annotation text to display. | Yes | +| `faces` | [[`TaggedFace`](/docs/kcl-std/types/std-types-TaggedFace); 1+] | The faces to be annotated. | No | +| `edges` | [[`Edge`](/docs/kcl-std/types/std-types-Edge); 1+] | The edges to be annotated. | No | +| `framePosition` | [`Point2d`](/docs/kcl-std/types/std-types-Point2d) | The position of the annotation relative to the leader arrow. The default is `[100mm, 100mm]`. | No | +| `framePlane` | [`Plane`](/docs/kcl-std/types/std-types-Plane) | The plane in which to display the annotation. The default is `XY`. Other standard planes like `XZ` and `YZ` can also be used. The annotation may be displayed in a plane parallel to the given plane. | No | +| `leaderScale` | [`number(_)`](/docs/kcl-std/types/std-types-number) | Scale of the leader. The default is `1.0`. Must be greater than `0`. | No | +| `fontPointSize` | [`number(_)`](/docs/kcl-std/types/std-types-number) | The font point size to use for the annotation text rendering. The default is `36`. | No | +| `fontScale` | [`number(_)`](/docs/kcl-std/types/std-types-number) | Scale to use for the annotation text after rendering with the point size. The default is `1.0`. Must be greater than `0`. | No | + +### Returns + +[[`GdtAnnotation`](/docs/kcl-std/types/std-types-GdtAnnotation); 1+] + + +### Examples + +```kcl +@settings(experimentalFeatures = allow) + +startSketchOn(XY) + |> startProfile(at = [0, 0]) + |> line(end = [10, 0], tag = $side) + |> line(end = [0, 10]) + |> line(end = [-10, 0]) + |> line(end = [0, -10]) + |> close() + |> extrude(length = 5, tagEnd = $top) + +gdt::annotation( + faces = [top], + annotation = "Break all sharp edges", + framePosition = [12mm, 8mm], + framePlane = XZ, +) + +``` + + +![Rendered example of gdt::annotation 0](/kcl-test-outputs/serial_test_example_fn_std-gdt-annotation0.png) + +```kcl +@settings(experimentalFeatures = allow) + +blockProfile = sketch(on = XY) { + edge1 = line(start = [var 0mm, var 0mm], end = [var 10mm, var 0mm]) + edge2 = line(start = [var 10mm, var 0mm], end = [var 10mm, var 6mm]) + edge3 = line(start = [var 10mm, var 6mm], end = [var 0mm, var 6mm]) + edge4 = line(start = [var 0mm, var 6mm], end = [var 0mm, var 0mm]) + coincident([edge1.end, edge2.start]) + coincident([edge2.end, edge3.start]) + coincident([edge3.end, edge4.start]) + coincident([edge4.end, edge1.start]) + horizontal(edge1) + vertical(edge2) + horizontal(edge3) + vertical(edge4) +} + +block = extrude(region(point = [5mm, 3mm], sketch = blockProfile), length = 4mm, tagEnd = $top) +sideEdge = getCommonEdge(faces = [block.sketch.tags.edge1, top]) +gdt::annotation( + edges = [sideEdge], + annotation = "Deburr edge", + framePosition = [12mm, 8mm], + framePlane = XZ, +) + +``` + + +![Rendered example of gdt::annotation 1](/kcl-test-outputs/serial_test_example_fn_std-gdt-annotation1.png) + + diff --git a/content/pages/docs/kcl-std/index.md b/content/pages/docs/kcl-std/index.md index 91280da7..86f3cbbb 100644 --- a/content/pages/docs/kcl-std/index.md +++ b/content/pages/docs/kcl-std/index.md @@ -28,6 +28,7 @@ layout: manual * [`reduce`](/docs/kcl-std/functions/std-array-reduce) * [`slice`](/docs/kcl-std/functions/std-array-slice) * [**std::gdt**](/docs/kcl-std/modules/std-gdt) + * [`gdt::annotation`](/docs/kcl-std/functions/std-gdt-annotation) * [`gdt::datum`](/docs/kcl-std/functions/std-gdt-datum) * [`gdt::flatness`](/docs/kcl-std/functions/std-gdt-flatness) * [`gdt::parallelism`](/docs/kcl-std/functions/std-gdt-parallelism) diff --git a/content/pages/docs/kcl-std/modules/std-gdt.md b/content/pages/docs/kcl-std/modules/std-gdt.md index d819c104..30047866 100644 --- a/content/pages/docs/kcl-std/modules/std-gdt.md +++ b/content/pages/docs/kcl-std/modules/std-gdt.md @@ -12,6 +12,7 @@ Functions for working with geometric dimensioning and tolerancing (GD&T). This c ## Functions and constants +* [`gdt::annotation`](/docs/kcl-std/functions/std-gdt-annotation) * [`gdt::datum`](/docs/kcl-std/functions/std-gdt-datum) * [`gdt::flatness`](/docs/kcl-std/functions/std-gdt-flatness) * [`gdt::parallelism`](/docs/kcl-std/functions/std-gdt-parallelism)