diff --git a/dist/fs-helpers.js b/dist/fs-helpers.js new file mode 100644 index 0000000..f33232d --- /dev/null +++ b/dist/fs-helpers.js @@ -0,0 +1,148 @@ +/** + * Copyright 2019 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +'use strict'; + +/* exported getFileHandle, getNewFileHandle, readFile, verifyPermission, + writeFile */ + +/** + * Open a handle to an existing file on the local file system. + * + * @return {!Promise} Handle to the existing file. + */ +function getFileHandle() { + // For Chrome 86 and later... + if ('showOpenFilePicker' in window) { + return window.showOpenFilePicker().then((handles) => handles[0]); + } + // For Chrome 85 and earlier... + return window.chooseFileSystemEntries(); +} + +/** + * Create a handle to a new (text) file on the local file system. + * + * @return {!Promise} Handle to the new file. + */ +function getNewFileHandle() { + // For Chrome 86 and later... + if ('showSaveFilePicker' in window) { + const opts = { + types: [{ + description: 'Text file', + accept: {'text/plain': ['.txt']}, + }], + }; + return window.showSaveFilePicker(opts); + } + // For Chrome 85 and earlier... + const opts = { + type: 'save-file', + accepts: [{ + description: 'Text file', + extensions: ['txt'], + mimeTypes: ['text/plain'], + }], + }; + return window.chooseFileSystemEntries(opts); +} + +/** + * Reads the raw text from a file. + * + * @param {File} file + * @return {!Promise} A promise that resolves to the parsed string. + */ +function readFile(file) { + // If the new .text() reader is available, use it. + if (file.text) { + return file.text(); + } + // Otherwise use the traditional file reading technique. + return _readFileLegacy(file); +} + +/** + * Reads the raw text from a file. + * + * @private + * @param {File} file + * @return {Promise} A promise that resolves to the parsed string. + */ +function _readFileLegacy(file) { + return new Promise((resolve) => { + const reader = new FileReader(); + reader.addEventListener('loadend', (e) => { + const text = e.srcElement.result; + resolve(text); + }); + reader.readAsText(file); + }); +} + +/** + * Writes the contents to disk. + * + * @param {FileSystemFileHandle} fileHandle File handle to write to. + * @param {string} contents Contents to write. + */ +async function writeFile(fileHandle, contents) { + // Support for Chrome 82 and earlier. + if (fileHandle.createWriter) { + // Create a writer (request permission if necessary). + const writer = await fileHandle.createWriter(); + // Write the full length of the contents + await writer.write(0, contents); + // Close the file and write the contents to disk + await writer.close(); + return; + } + // For Chrome 83 and later. + // Create a FileSystemWritableFileStream to write to. + const writable = await fileHandle.createWritable(); + // Write the contents of the file to the stream. + await writable.write(contents); + // Close the file and write the contents to disk. + await writable.close(); +} + +/** + * Verify the user has granted permission to read or write to the file, if + * permission hasn't been granted, request permission. + * + * @param {FileSystemFileHandle} fileHandle File handle to check. + * @param {boolean} withWrite True if write permission should be checked. + * @return {boolean} True if the user has granted read/write permission. + */ +async function verifyPermission(fileHandle, withWrite) { + const opts = {}; + if (withWrite) { + opts.writable = true; + // For Chrome 86 and later... + opts.mode = 'readwrite'; + } + // Check if we already have permission, if so, return true. + if (await fileHandle.queryPermission(opts) === 'granted') { + return true; + } + // Request permission to the file, if the user grants permission, return true. + if (await fileHandle.requestPermission(opts) === 'granted') { + return true; + } + // The user did nt grant permission, return false. + return false; +} diff --git a/dist/index.html b/dist/index.html index fa709c0..7945992 100644 --- a/dist/index.html +++ b/dist/index.html @@ -25,6 +25,7 @@ + \ No newline at end of file diff --git a/example_parts/qwre b/example_parts/qwre new file mode 100644 index 0000000..8ec61e7 --- /dev/null +++ b/example_parts/qwre @@ -0,0 +1 @@ +[19,2,3,{"byId":{"s1":{"obj3d":{"metadata":{"version":4.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"B05A0EC3-CFAE-4913-983D-CA5C6562357C","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0,0,0],"normalized":false}},"boundingSphere":{"center":[0,0,0],"radius":0}}},{"uuid":"1BE834E5-22F5-473A-83C1-9A5DA734E534","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-4.171490669250488,2.7519092559814453,0],"normalized":false}},"boundingSphere":{"center":[-4.171490669250488,2.7519092559814453,0],"radius":0}}},{"uuid":"FAC9EB7A-BBC4-479F-A7AE-2AF1AC993CB8","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-0.7254766821861267,-5.5484819412231445,0],"normalized":false}},"boundingSphere":{"center":[-0.7254766821861267,-5.5484819412231445,0],"radius":0}}},{"uuid":"5476544B-E072-4E4C-A6EE-06741C087136","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-4.171490669250488,2.7519092559814453,0,-0.7254766821861267,-5.5484819412231445,0],"normalized":false}},"boundingSphere":{"center":[-2.4484836757183075,-1.3982863426208496,0],"radius":4.493648473837118}}},{"uuid":"05E9956B-6E05-4F9C-B2F5-086E3177196B","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-0.7254766821861267,-5.5484819412231445,0],"normalized":false}},"boundingSphere":{"center":[-0.7254766821861267,-5.5484819412231445,0],"radius":0}}},{"uuid":"10D41801-58B0-462A-A1EF-F8DA6F83E047","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[6.37059211730957,-0.8928415775299072,0],"normalized":false}},"boundingSphere":{"center":[6.37059211730957,-0.8928415775299072,0],"radius":0}}},{"uuid":"AEC6F4D0-AA0D-4322-80CB-A2328F63AED8","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-0.7254766821861267,-5.5484819412231445,0,6.37059211730957,-0.8928415775299072,0],"normalized":false}},"boundingSphere":{"center":[2.822557717561722,-3.220661759376526,0],"radius":4.243500312337269}}},{"uuid":"7096F37D-057A-477A-9DDD-B3E91119E81B","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[6.37059211730957,-0.8928415775299072,0],"normalized":false}},"boundingSphere":{"center":[6.37059211730957,-0.8928415775299072,0],"radius":0}}},{"uuid":"1ECA9003-6299-4773-B3F0-F9098ED2693D","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.443544387817383,5.465567111968994,0],"normalized":false}},"boundingSphere":{"center":[4.443544387817383,5.465567111968994,0],"radius":0}}},{"uuid":"CBC9D852-7F82-4C4C-8609-58BD34F9306B","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[6.37059211730957,-0.8928415775299072,0,4.443544387817383,5.465567111968994,0],"normalized":false}},"boundingSphere":{"center":[5.407068252563477,2.2863627672195435,0],"radius":3.32200519319417}}},{"uuid":"225177C1-4D12-4A0B-A259-487BFE7C0E0F","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.443544387817383,5.465567111968994,0],"normalized":false}},"boundingSphere":{"center":[4.443544387817383,5.465567111968994,0],"radius":0}}},{"uuid":"6651CBE3-3FD3-4E08-B784-66F7E2EBE20E","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-2.4797475337982178,5.920230388641357,0],"normalized":false}},"boundingSphere":{"center":[-2.4797475337982178,5.920230388641357,0],"radius":0}}},{"uuid":"946D02E2-A040-4F5E-9447-C856C4C0B56A","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.443544387817383,5.465567111968994,0,-2.4797475337982178,5.920230388641357,0],"normalized":false}},"boundingSphere":{"center":[0.9818984270095825,5.692898750305176,0],"radius":3.469102539817117}}},{"uuid":"8F002F3C-195B-4B95-BEA3-D57645E461C1","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-2.4797475337982178,5.920230388641357,0],"normalized":false}},"boundingSphere":{"center":[-2.4797475337982178,5.920230388641357,0],"radius":0}}},{"uuid":"85049FC3-48E4-4DB0-9CA0-857D1E695942","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-4.171490669250488,2.7519092559814453,0],"normalized":false}},"boundingSphere":{"center":[-4.171490669250488,2.7519092559814453,0],"radius":0}}},{"uuid":"2D116D7A-0129-4E9F-BBB5-67588C90AD81","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-2.4797475337982178,5.920230388641357,0,-4.171490669250488,2.7519092559814453,0],"normalized":false}},"boundingSphere":{"center":[-3.325619101524353,4.336069822311401,0],"radius":1.7958461540461412}}}],"materials":[{"uuid":"C29324C1-CD30-49DA-8AE8-297E5AA4C789","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"2DE30CFE-134F-4843-844F-111FA0D0540C","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"915D0F80-EAB8-414D-BF2B-B9123BF80342","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"D8969207-64C8-4E86-9744-82ED00D2EE6B","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"7756BC3E-D58F-48BE-BEBD-567F5AD16D6C","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"C74C7EF9-F266-4EC7-9725-35F25421249F","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"7E4D6255-619B-423D-AFDE-51505AA83A40","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"63427DC0-F5B5-4521-B884-EAFD50EE24F4","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"7C91E28A-1F60-4FA7-8B6A-D308E7743DDB","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"2B5453C0-4EF1-4F0C-AF2E-28D40EC261DF","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"F1CF038D-1C5E-498C-8E4C-A2666420D3D8","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"727829C0-A042-4E9E-8E37-2DD97B68BE7A","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"585BDD90-34AF-4260-BE90-A1AF60A7D87F","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"3AA5C82A-559C-4BC1-B809-C657D76D557D","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"24F6E42D-FDA6-4611-9F5F-A5EC98DE37B1","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"0627B25A-1DDB-4354-823A-D72FB4D4C121","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680}],"object":{"uuid":"3881757D-CF0E-4611-8EAF-3ACBC4C3AA38","type":"Group","name":"s1","visible":false,"userData":{"type":"sketch","geomStartIdx":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"children":[{"uuid":"BFC77E2C-8C0D-41D2-A4CD-DD2C92686BB7","type":"Group","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"D23A269E-05E6-4815-9C64-93A5FBF9F84E","type":"Points","name":"p0","userData":{"type":"point","constraints":[]},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"B05A0EC3-CFAE-4913-983D-CA5C6562357C","material":"C29324C1-CD30-49DA-8AE8-297E5AA4C789"},{"uuid":"1D9EE31D-449B-43B3-A4B9-193C675062BB","type":"Points","name":"p1","userData":{"type":"point","constraints":[7],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"1BE834E5-22F5-473A-83C1-9A5DA734E534","material":"2DE30CFE-134F-4843-844F-111FA0D0540C"},{"uuid":"525AED79-D711-42D7-B17D-E1166B653577","type":"Points","name":"p2","userData":{"type":"point","constraints":[2],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"FAC9EB7A-BBC4-479F-A7AE-2AF1AC993CB8","material":"915D0F80-EAB8-414D-BF2B-B9123BF80342"},{"uuid":"64C33834-9FBB-498F-A406-80A9CD2AE840","type":"Line","name":"l3","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"5476544B-E072-4E4C-A6EE-06741C087136","material":"D8969207-64C8-4E86-9744-82ED00D2EE6B"},{"uuid":"2370DA02-51C6-4547-9658-360E9DE83807","type":"Points","name":"p4","userData":{"type":"point","constraints":[2],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"05E9956B-6E05-4F9C-B2F5-086E3177196B","material":"7756BC3E-D58F-48BE-BEBD-567F5AD16D6C"},{"uuid":"84C6782F-0656-4CB3-B8F2-F7A069E29427","type":"Points","name":"p5","userData":{"type":"point","constraints":[3],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"10D41801-58B0-462A-A1EF-F8DA6F83E047","material":"C74C7EF9-F266-4EC7-9725-35F25421249F"},{"uuid":"614F23A1-DB33-410C-9B8B-03409236A105","type":"Line","name":"l6","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"AEC6F4D0-AA0D-4322-80CB-A2328F63AED8","material":"7E4D6255-619B-423D-AFDE-51505AA83A40"},{"uuid":"12EDB780-487C-4B50-B988-60CDB7FE87C1","type":"Points","name":"p7","userData":{"type":"point","constraints":[3],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"7096F37D-057A-477A-9DDD-B3E91119E81B","material":"63427DC0-F5B5-4521-B884-EAFD50EE24F4"},{"uuid":"91E96DE2-0887-4648-85CA-8DE9FF1FEA5E","type":"Points","name":"p8","userData":{"type":"point","constraints":[4],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"1ECA9003-6299-4773-B3F0-F9098ED2693D","material":"7C91E28A-1F60-4FA7-8B6A-D308E7743DDB"},{"uuid":"9766A340-D6E3-4674-910D-18BC4862D9EC","type":"Line","name":"l9","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"CBC9D852-7F82-4C4C-8609-58BD34F9306B","material":"2B5453C0-4EF1-4F0C-AF2E-28D40EC261DF"},{"uuid":"96A4E8F5-D3C2-4247-AB6D-C8242DD0E474","type":"Points","name":"p10","userData":{"type":"point","constraints":[4],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"225177C1-4D12-4A0B-A259-487BFE7C0E0F","material":"F1CF038D-1C5E-498C-8E4C-A2666420D3D8"},{"uuid":"B7774978-7DDD-4EBC-BF97-05C428CBA8EC","type":"Points","name":"p11","userData":{"type":"point","constraints":[5],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"6651CBE3-3FD3-4E08-B784-66F7E2EBE20E","material":"727829C0-A042-4E9E-8E37-2DD97B68BE7A"},{"uuid":"F157A728-E44F-4CA5-B92D-5150A3FF6B24","type":"Line","name":"l12","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"946D02E2-A040-4F5E-9447-C856C4C0B56A","material":"585BDD90-34AF-4260-BE90-A1AF60A7D87F"},{"uuid":"78141B16-A97B-41BE-A0F6-15D8AA2BC4B3","type":"Points","name":"p13","userData":{"type":"point","constraints":[5],"l_id":4},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"8F002F3C-195B-4B95-BEA3-D57645E461C1","material":"3AA5C82A-559C-4BC1-B809-C657D76D557D"},{"uuid":"012BA5DC-B622-4F36-8752-D589B7319064","type":"Points","name":"p14","userData":{"type":"point","constraints":[7],"l_id":4},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"85049FC3-48E4-4DB0-9CA0-857D1E695942","material":"24F6E42D-FDA6-4611-9F5F-A5EC98DE37B1"},{"uuid":"0467988C-9EA0-45E2-942E-0D04B34AE6BC","type":"Line","name":"l15","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":4},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"2D116D7A-0129-4E9F-BBB5-67588C90AD81","material":"0627B25A-1DDB-4354-823A-D72FB4D4C121"}]}},"objIdx":"{\"dataType\":\"Map\",\"value\":[[\"\",0],[\"p0\",1],[\"p1\",2],[\"p2\",3],[\"l3\",4],[\"p4\",5],[\"p5\",6],[\"l6\",7],[\"p7\",8],[\"p8\",9],[\"l9\",10],[\"p10\",11],[\"p11\",12],[\"l12\",13],[\"p13\",14],[\"p14\",15],[\"l15\",16]]}","linkedObjs":"{\"dataType\":\"Map\",\"value\":[[0,[\"line\",[\"p1\",\"p2\",\"l3\"]]],[1,[\"line\",[\"p4\",\"p5\",\"l6\"]]],[2,[\"line\",[\"p7\",\"p8\",\"l9\"]]],[3,[\"line\",[\"p10\",\"p11\",\"l12\"]]],[4,[\"line\",[\"p13\",\"p14\",\"l15\"]]]]}","l_id":6,"constraints":"{\"dataType\":\"Map\",\"value\":[[2,[\"points_coincident\",-1,[\"p2\",\"p4\",-1,-1]]],[3,[\"points_coincident\",-1,[\"p5\",\"p7\",-1,-1]]],[4,[\"points_coincident\",-1,[\"p8\",\"p10\",-1,-1]]],[5,[\"points_coincident\",-1,[\"p11\",\"p13\",-1,-1]]],[7,[\"points_coincident\",-1,[\"p1\",\"p14\",-1,-1]]]]}","c_id":7},"e1":{"metadata":{"version":4.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"6C449230-D63E-424F-8A4D-799AF6C3472E","type":"ExtrudeGeometry","shapes":["3762A917-D367-4E0D-BEA0-9F054C04D02E"],"options":{"depth":"1","bevelEnabled":false}}],"materials":[{"uuid":"D834E8D8-DFA3-4A19-9C92-5F8F33D2A68F","type":"MeshPhongMaterial","color":10342381,"emissive":468276,"specular":1118481,"shininess":30,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"57D5343A-FFD8-4E3A-9981-A8EDA116FA87","type":"PointsMaterial","color":16777215,"size":0,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680}],"shapes":[{"arcLengthDivisions":200,"type":"Shape","autoClose":false,"curves":[{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-4.171490669250488,2.7519092559814453],"v2":[-0.7254766821861267,-5.5484819412231445]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-0.7254766821861267,-5.5484819412231445],"v2":[-0.7254766821861267,-5.5484819412231445]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-0.7254766821861267,-5.5484819412231445],"v2":[6.37059211730957,-0.8928415775299072]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[6.37059211730957,-0.8928415775299072],"v2":[6.37059211730957,-0.8928415775299072]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[6.37059211730957,-0.8928415775299072],"v2":[4.443544387817383,5.465567111968994]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[4.443544387817383,5.465567111968994],"v2":[4.443544387817383,5.465567111968994]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[4.443544387817383,5.465567111968994],"v2":[-1.1108860969543457,4.043510437011719]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-1.1108860969543457,4.043510437011719],"v2":[-1.1108860969543457,4.043510437011719]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-1.1108860969543457,4.043510437011719],"v2":[-4.171490669250488,2.7519092559814453]}],"currentPoint":[-4.171490669250488,2.7519092559814453],"uuid":"3762A917-D367-4E0D-BEA0-9F054C04D02E","holes":[]}],"object":{"uuid":"D56BBBEB-A5D1-41B7-AADB-31E94134157F","type":"Mesh","name":"e1","userData":{"type":"mesh","featureInfo":["s1","1"]},"layers":3,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"6C449230-D63E-424F-8A4D-799AF6C3472E","material":"D834E8D8-DFA3-4A19-9C92-5F8F33D2A68F","children":[{"uuid":"6994AA5E-2933-4B4D-9ED3-7C9CFE4882AE","type":"Points","userData":{"type":"point"},"layers":3,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":"6C449230-D63E-424F-8A4D-799AF6C3472E","material":"57D5343A-FFD8-4E3A-9981-A8EDA116FA87"}]}}},"allIds":["s1","e1"],"tree":{"s1":{"e1":true},"e1":{}},"order":{"s1":0,"e1":1},"visible":{"s1":false,"e1":true},"activeSketchId":""}] \ No newline at end of file diff --git a/example_parts/test.json b/example_parts/test.json new file mode 100644 index 0000000..e69de29 diff --git a/example_parts/test2.json b/example_parts/test2.json new file mode 100644 index 0000000..8e24d34 --- /dev/null +++ b/example_parts/test2.json @@ -0,0 +1 @@ +[25,2,2,{"byId":{"s1":{"obj3d":{"metadata":{"version":4.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"2E5183E5-CCD8-450C-810E-5EC8B8FDF218","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0,0,0],"normalized":false}},"boundingSphere":{"center":[0,0,0],"radius":0}}},{"uuid":"4BC3EB66-E647-4682-837B-EE05D55F3F6C","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-2.952244758605957,0.8606668710708618,0],"normalized":false}},"boundingSphere":{"center":[-2.952244758605957,0.8606668710708618,0],"radius":0}}},{"uuid":"0EB869FB-B440-46E5-8007-08BEFFD08ADB","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-0.2720498740673065,-5.459075927734375,0],"normalized":false}},"boundingSphere":{"center":[-0.2720498740673065,-5.459075927734375,0],"radius":0}}},{"uuid":"BC8154EF-6563-4CD3-AC77-F3CA4EA331BE","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-2.952244758605957,0.8606668710708618,0,-0.2720498740673065,-5.459075927734375,0],"normalized":false}},"boundingSphere":{"center":[-1.6121473163366318,-2.2992045283317566,0],"radius":3.432294919662273}}},{"uuid":"BA7FE97B-0B0B-4A73-B4FD-89B2F3672A38","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-0.2720498740673065,-5.459075927734375,0],"normalized":false}},"boundingSphere":{"center":[-0.2720498740673065,-5.459075927734375,0],"radius":0}}},{"uuid":"470C7905-A494-4B8A-A14B-267EAF8441AC","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.201659202575684,-1.2859139442443848,0],"normalized":false}},"boundingSphere":{"center":[4.201659202575684,-1.2859139442443848,0],"radius":0}}},{"uuid":"A5827B5D-6FBE-48D9-AC3F-7C1265E00DF8","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-0.2720498740673065,-5.459075927734375,0,4.201659202575684,-1.2859139442443848,0],"normalized":false}},"boundingSphere":{"center":[1.9648046642541885,-3.37249493598938,0],"radius":3.0589767015655736}}},{"uuid":"AFF74C90-21F2-4345-A3ED-A024DEE8F20E","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.201659202575684,-1.2859139442443848,0],"normalized":false}},"boundingSphere":{"center":[4.201659202575684,-1.2859139442443848,0],"radius":0}}},{"uuid":"B51A9195-A954-4518-AB95-7B387385169A","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.866669654846191,-3.6330738067626953,0],"normalized":false}},"boundingSphere":{"center":[4.866669654846191,-3.6330738067626953,0],"radius":0}}},{"uuid":"9475E3E5-ECF9-4D34-A9BE-56855EBD031E","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.201659202575684,-1.2859139442443848,0,4.866669654846191,-3.6330738067626953,0],"normalized":false}},"boundingSphere":{"center":[4.5341644287109375,-2.45949387550354,0],"radius":1.2197743973626844}}},{"uuid":"2FA0001E-7F26-43D4-80FF-042A2F0DBB69","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.866669654846191,-3.6330738067626953,0],"normalized":false}},"boundingSphere":{"center":[4.866669654846191,-3.6330738067626953,0],"radius":0}}},{"uuid":"3B4830BB-D696-411E-A451-FC77425E3A48","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.5845441818237305,5.172445774078369,0],"normalized":false}},"boundingSphere":{"center":[4.5845441818237305,5.172445774078369,0],"radius":0}}},{"uuid":"1D5FB29C-2619-48D6-B9FD-42D7803511C1","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.866669654846191,-3.6330738067626953,0,4.5845441818237305,5.172445774078369,0],"normalized":false}},"boundingSphere":{"center":[4.725606918334961,0.7696859836578369,0],"radius":4.405019008787122}}},{"uuid":"CCB15268-B67E-4DE8-9418-D3EA3A963B1F","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.5845441818237305,5.172445774078369,0],"normalized":false}},"boundingSphere":{"center":[4.5845441818237305,5.172445774078369,0],"radius":0}}},{"uuid":"8411381C-BE51-49DA-AA87-7273C1A65AC8","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[3.4761927127838135,4.892796039581299,0],"normalized":false}},"boundingSphere":{"center":[3.4761927127838135,4.892796039581299,0],"radius":0}}},{"uuid":"E173ABB4-9DB5-433E-9E1C-E385CDDE12DD","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[4.5845441818237305,5.172445774078369,0,3.4761927127838135,4.892796039581299,0],"normalized":false}},"boundingSphere":{"center":[4.030368447303772,5.032620906829834,0],"radius":0.5715432951507751}}},{"uuid":"5E61BEC4-0DF3-4239-A8CF-11490BB4D875","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[3.4761927127838135,4.892796039581299,0],"normalized":false}},"boundingSphere":{"center":[3.4761927127838135,4.892796039581299,0],"radius":0}}},{"uuid":"0E021CE3-A752-46B0-B46C-4729B2023CC0","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[1.199034571647644,1.817215919494629,0],"normalized":false}},"boundingSphere":{"center":[1.199034571647644,1.817215919494629,0],"radius":0}}},{"uuid":"42C487C0-E276-4E00-9481-752ABD2DB2F5","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[3.4761927127838135,4.892796039581299,0,1.199034571647644,1.817215919494629,0],"normalized":false}},"boundingSphere":{"center":[2.3376136422157288,3.355005979537964,0],"radius":1.9134159424191508}}},{"uuid":"59A82F32-307A-4AFA-8B2D-2E2D9AB8899A","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[1.199034571647644,1.817215919494629,0],"normalized":false}},"boundingSphere":{"center":[1.199034571647644,1.817215919494629,0],"radius":0}}},{"uuid":"7235F4F4-1C86-4571-801C-3FA506E41FD7","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-2.952244758605957,0.8606668710708618,0],"normalized":false}},"boundingSphere":{"center":[-2.952244758605957,0.8606668710708618,0],"radius":0}}},{"uuid":"C68F7312-7119-48B0-AA7B-CC17C30414C5","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[1.199034571647644,1.817215919494629,0,-2.952244758605957,0.8606668710708618,0],"normalized":false}},"boundingSphere":{"center":[-0.8766050934791565,1.3389413952827454,0],"radius":2.1300297040083267}}}],"materials":[{"uuid":"EF94BAA8-7974-408C-A6DD-E9F70DD68D7D","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"ADAFCBBE-8E38-4B95-A6D4-5E38E942FBD8","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"AA18E130-CB5C-468D-9CAA-1F938238375F","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"0ACED629-146F-44CC-90DF-C32D9D007FAE","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"F659EF71-44F8-4E6B-812B-BC9B18CF8E7C","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"15B1A958-95BE-45BF-86ED-D744AEE7762C","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"3EC096F5-2BBA-4F18-B730-3E961799D005","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"E08DBADA-D64F-463F-A211-B834875D99CF","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"575BB009-D3EE-46F9-BBD8-17AE622AC566","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"F417CF61-FC59-4C81-A1E0-1FF1C2C71091","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"100F29CB-96D4-4EE9-BBA6-AF3FA07C0886","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"18EE5633-F0FB-4783-A79A-BDC4EFF55BBF","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"CE420671-1121-4B39-8D9B-EDAEE3D33F66","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"33A7E26F-92A1-45B9-95C8-4C9D52BAC70D","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"A42B4469-72D7-4818-93DA-7D7BDFA75D93","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"D0679AB0-889D-4DA9-AF2E-C40E55E1880D","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"C726045F-A45D-43F8-8DA1-A7012465B26B","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"DB8DF304-2738-40D0-9A6B-A1795FBA6199","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"B4379605-4819-4554-8872-4A750CC4FF27","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"E2E93935-167E-4F49-901E-DE1492010F94","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"DB5CF11F-BF95-4E17-9646-C6435A6EF279","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"7F23246D-29D9-443C-833C-5D3053AA9F26","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680}],"object":{"uuid":"843F8A95-B1B2-412B-B211-C547C802D508","type":"Group","name":"s1","visible":false,"userData":{"type":"sketch","geomStartIdx":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"children":[{"uuid":"BCEC4E11-919F-41D1-BA84-FBFD4673018F","type":"Group","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"C5F806E9-8762-49D0-9CFD-6BD71FF2A017","type":"Points","name":"p0","userData":{"type":"point","constraints":[]},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"2E5183E5-CCD8-450C-810E-5EC8B8FDF218","material":"EF94BAA8-7974-408C-A6DD-E9F70DD68D7D"},{"uuid":"FA8A3D9D-293A-4E50-A9E0-DEB8576F0244","type":"Points","name":"p1","userData":{"type":"point","constraints":[9],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"4BC3EB66-E647-4682-837B-EE05D55F3F6C","material":"ADAFCBBE-8E38-4B95-A6D4-5E38E942FBD8"},{"uuid":"1A150E41-F925-40E3-B8B0-A9BEA4D11A8F","type":"Points","name":"p2","userData":{"type":"point","constraints":[2],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"0EB869FB-B440-46E5-8007-08BEFFD08ADB","material":"AA18E130-CB5C-468D-9CAA-1F938238375F"},{"uuid":"EE8C5BF4-D955-49B7-909A-6D2B226A0D8D","type":"Line","name":"l3","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"BC8154EF-6563-4CD3-AC77-F3CA4EA331BE","material":"0ACED629-146F-44CC-90DF-C32D9D007FAE"},{"uuid":"ADCA60B0-D7F8-48A7-971F-5DFB0257ACDD","type":"Points","name":"p4","userData":{"type":"point","constraints":[2],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"BA7FE97B-0B0B-4A73-B4FD-89B2F3672A38","material":"F659EF71-44F8-4E6B-812B-BC9B18CF8E7C"},{"uuid":"7196B551-89D6-4B38-B5EF-66B26CF013BC","type":"Points","name":"p5","userData":{"type":"point","constraints":[3],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"470C7905-A494-4B8A-A14B-267EAF8441AC","material":"15B1A958-95BE-45BF-86ED-D744AEE7762C"},{"uuid":"485E69B7-B814-42EE-B401-948353B90CC4","type":"Line","name":"l6","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"A5827B5D-6FBE-48D9-AC3F-7C1265E00DF8","material":"3EC096F5-2BBA-4F18-B730-3E961799D005"},{"uuid":"1C1F6075-EA89-484F-9898-4016FFE023D9","type":"Points","name":"p7","userData":{"type":"point","constraints":[3],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"AFF74C90-21F2-4345-A3ED-A024DEE8F20E","material":"E08DBADA-D64F-463F-A211-B834875D99CF"},{"uuid":"C28F2556-8363-440D-A7C4-9E0844BEC427","type":"Points","name":"p8","userData":{"type":"point","constraints":[4],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"B51A9195-A954-4518-AB95-7B387385169A","material":"575BB009-D3EE-46F9-BBD8-17AE622AC566"},{"uuid":"E3A72F92-3144-481B-8B78-788C3AB87B8A","type":"Line","name":"l9","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"9475E3E5-ECF9-4D34-A9BE-56855EBD031E","material":"F417CF61-FC59-4C81-A1E0-1FF1C2C71091"},{"uuid":"395ABBA4-5ADF-468F-805C-026B532A3BCE","type":"Points","name":"p10","userData":{"type":"point","constraints":[4],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"2FA0001E-7F26-43D4-80FF-042A2F0DBB69","material":"100F29CB-96D4-4EE9-BBA6-AF3FA07C0886"},{"uuid":"4DFDA6DC-EB23-4B95-8325-62CB0E093CD9","type":"Points","name":"p11","userData":{"type":"point","constraints":[5],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"3B4830BB-D696-411E-A451-FC77425E3A48","material":"18EE5633-F0FB-4783-A79A-BDC4EFF55BBF"},{"uuid":"643F557A-C75F-4FF8-AD8F-7D55EB524ADB","type":"Line","name":"l12","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"1D5FB29C-2619-48D6-B9FD-42D7803511C1","material":"CE420671-1121-4B39-8D9B-EDAEE3D33F66"},{"uuid":"58090D3C-5480-481B-8878-22436F7C956F","type":"Points","name":"p13","userData":{"type":"point","constraints":[5],"l_id":4},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"CCB15268-B67E-4DE8-9418-D3EA3A963B1F","material":"33A7E26F-92A1-45B9-95C8-4C9D52BAC70D"},{"uuid":"434831CA-A938-410D-8C0F-F1018F7C0E44","type":"Points","name":"p14","userData":{"type":"point","constraints":[6],"l_id":4},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"8411381C-BE51-49DA-AA87-7273C1A65AC8","material":"A42B4469-72D7-4818-93DA-7D7BDFA75D93"},{"uuid":"BE3C2E5C-41CA-4B71-B900-FA1133BC977A","type":"Line","name":"l15","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":4},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"E173ABB4-9DB5-433E-9E1C-E385CDDE12DD","material":"D0679AB0-889D-4DA9-AF2E-C40E55E1880D"},{"uuid":"0ECF91ED-E54B-4474-B4CE-84E320950C07","type":"Points","name":"p16","userData":{"type":"point","constraints":[6],"l_id":5},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"5E61BEC4-0DF3-4239-A8CF-11490BB4D875","material":"C726045F-A45D-43F8-8DA1-A7012465B26B"},{"uuid":"4180ECC1-F30F-48A2-A5CC-445086306FB1","type":"Points","name":"p17","userData":{"type":"point","constraints":[7],"l_id":5},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"0E021CE3-A752-46B0-B46C-4729B2023CC0","material":"DB8DF304-2738-40D0-9A6B-A1795FBA6199"},{"uuid":"AF29B88A-1978-41A1-8A5F-93CE7D7F74D0","type":"Line","name":"l18","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":5},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"42C487C0-E276-4E00-9481-752ABD2DB2F5","material":"B4379605-4819-4554-8872-4A750CC4FF27"},{"uuid":"5884A2AC-7D70-4306-98EA-61C695C63D8B","type":"Points","name":"p19","userData":{"type":"point","constraints":[7],"l_id":6},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"59A82F32-307A-4AFA-8B2D-2E2D9AB8899A","material":"E2E93935-167E-4F49-901E-DE1492010F94"},{"uuid":"94964470-FE18-4976-9AAD-4DEB0FB5501A","type":"Points","name":"p20","userData":{"type":"point","constraints":[9],"l_id":6},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"7235F4F4-1C86-4571-801C-3FA506E41FD7","material":"DB5CF11F-BF95-4E17-9646-C6435A6EF279"},{"uuid":"C630A375-B1B5-4C8B-83DB-4E1C25714A05","type":"Line","name":"l21","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":6},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"C68F7312-7119-48B0-AA7B-CC17C30414C5","material":"7F23246D-29D9-443C-833C-5D3053AA9F26"}]}},"objIdx":"{\"dataType\":\"Map\",\"value\":[[\"\",0],[\"p0\",1],[\"p1\",2],[\"p2\",3],[\"l3\",4],[\"p4\",5],[\"p5\",6],[\"l6\",7],[\"p7\",8],[\"p8\",9],[\"l9\",10],[\"p10\",11],[\"p11\",12],[\"l12\",13],[\"p13\",14],[\"p14\",15],[\"l15\",16],[\"p16\",17],[\"p17\",18],[\"l18\",19],[\"p19\",20],[\"p20\",21],[\"l21\",22]]}","linkedObjs":"{\"dataType\":\"Map\",\"value\":[[0,[\"line\",[\"p1\",\"p2\",\"l3\"]]],[1,[\"line\",[\"p4\",\"p5\",\"l6\"]]],[2,[\"line\",[\"p7\",\"p8\",\"l9\"]]],[3,[\"line\",[\"p10\",\"p11\",\"l12\"]]],[4,[\"line\",[\"p13\",\"p14\",\"l15\"]]],[5,[\"line\",[\"p16\",\"p17\",\"l18\"]]],[6,[\"line\",[\"p19\",\"p20\",\"l21\"]]]]}","l_id":8,"constraints":"{\"dataType\":\"Map\",\"value\":[[2,[\"points_coincident\",-1,[\"p2\",\"p4\",-1,-1]]],[3,[\"points_coincident\",-1,[\"p5\",\"p7\",-1,-1]]],[4,[\"points_coincident\",-1,[\"p8\",\"p10\",-1,-1]]],[5,[\"points_coincident\",-1,[\"p11\",\"p13\",-1,-1]]],[6,[\"points_coincident\",-1,[\"p14\",\"p16\",-1,-1]]],[7,[\"points_coincident\",-1,[\"p17\",\"p19\",-1,-1]]],[9,[\"points_coincident\",-1,[\"p20\",\"p1\",-1,-1]]]]}","c_id":9},"e1":{"metadata":{"version":4.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"217C9B14-AA67-4566-B2C7-C0CBBCFF6B73","type":"ExtrudeGeometry","shapes":["F4AAD0D1-9554-486E-B8DC-0CA3D42A22A7"],"options":{"depth":"1","bevelEnabled":false}}],"materials":[{"uuid":"C796B0DC-7AFC-4292-9907-F0E27085C8C8","type":"MeshPhongMaterial","color":10342381,"emissive":468276,"specular":1118481,"shininess":30,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"2E1F9533-B6B3-4B91-8B8A-9DA7C59D29D5","type":"PointsMaterial","color":16777215,"size":0,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680}],"shapes":[{"arcLengthDivisions":200,"type":"Shape","autoClose":false,"curves":[{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-2.952244758605957,0.8606668710708618],"v2":[-0.2720498740673065,-5.459075927734375]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-0.2720498740673065,-5.459075927734375],"v2":[-0.2720498740673065,-5.459075927734375]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-0.2720498740673065,-5.459075927734375],"v2":[4.201659202575684,-1.2859139442443848]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[4.201659202575684,-1.2859139442443848],"v2":[4.201659202575684,-1.2859139442443848]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[4.201659202575684,-1.2859139442443848],"v2":[4.866669654846191,-3.6330738067626953]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[4.866669654846191,-3.6330738067626953],"v2":[4.866669654846191,-3.6330738067626953]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[4.866669654846191,-3.6330738067626953],"v2":[4.5845441818237305,5.172445774078369]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[4.5845441818237305,5.172445774078369],"v2":[4.5845441818237305,5.172445774078369]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[4.5845441818237305,5.172445774078369],"v2":[3.4761927127838135,4.892796039581299]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[3.4761927127838135,4.892796039581299],"v2":[3.4761927127838135,4.892796039581299]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[3.4761927127838135,4.892796039581299],"v2":[1.199034571647644,1.817215919494629]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[1.199034571647644,1.817215919494629],"v2":[1.199034571647644,1.817215919494629]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[1.199034571647644,1.817215919494629],"v2":[-2.952244758605957,0.8606668710708618]}],"currentPoint":[-2.952244758605957,0.8606668710708618],"uuid":"F4AAD0D1-9554-486E-B8DC-0CA3D42A22A7","holes":[]}],"object":{"uuid":"8F0AE06D-8D9B-4862-A3A5-E9DD8D5B0F79","type":"Mesh","name":"e1","userData":{"type":"mesh","featureInfo":["s1","1"]},"layers":3,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"217C9B14-AA67-4566-B2C7-C0CBBCFF6B73","material":"C796B0DC-7AFC-4292-9907-F0E27085C8C8","children":[{"uuid":"717D8CCB-F4F9-46E4-AA95-C49A55A528D4","type":"Points","userData":{"type":"point"},"layers":3,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":"217C9B14-AA67-4566-B2C7-C0CBBCFF6B73","material":"2E1F9533-B6B3-4B91-8B8A-9DA7C59D29D5"}]}}},"allIds":["s1","e1"],"tree":{"s1":{"e1":true},"e1":{}},"order":{"s1":0,"e1":1},"visible":{"s1":false,"e1":true,"":false},"activeSketchId":""}] \ No newline at end of file diff --git a/example_parts/testt.json b/example_parts/testt.json new file mode 100644 index 0000000..e69de29 diff --git a/example_parts/uncomp_2021-04-18T00-32-36.json b/example_parts/uncomp_2021-04-18T00-32-36.json new file mode 100644 index 0000000..a630708 --- /dev/null +++ b/example_parts/uncomp_2021-04-18T00-32-36.json @@ -0,0 +1 @@ +[25,2,2,{"byId":{"s1":{"obj3d":{"metadata":{"version":4.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"39436898-7ED0-4904-BA76-EF812E23CE12","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0,0,0],"normalized":false}},"boundingSphere":{"center":[0,0,0],"radius":0}}},{"uuid":"47F6DF85-E6A2-46FE-864E-39581170F9AF","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-3.8086981773376465,-2.288435220718384,0],"normalized":false}},"boundingSphere":{"center":[-3.8086981773376465,-2.288435220718384,0],"radius":0}}},{"uuid":"569C1239-1A2A-4BD4-8A3C-C7A8CABEF519","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[3.5265722274780273,-3.1735494136810303,0],"normalized":false}},"boundingSphere":{"center":[3.5265722274780273,-3.1735494136810303,0],"radius":0}}},{"uuid":"C3C4E99A-2D94-44FB-8124-BC4159CBC716","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-3.8086981773376465,-2.288435220718384,0,3.5265722274780273,-3.1735494136810303,0],"normalized":false}},"boundingSphere":{"center":[-0.14106297492980957,-2.730992317199707,0],"radius":3.694239402311003}}},{"uuid":"B1BE1034-2AD9-4FF6-B8E3-885E07A6E4AC","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[3.5265722274780273,-3.1735494136810303,0],"normalized":false}},"boundingSphere":{"center":[3.5265722274780273,-3.1735494136810303,0],"radius":0}}},{"uuid":"5A20C7E4-818F-4259-984A-1D91BAA4CF95","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[5.017808437347412,3.8264338970184326,0],"normalized":false}},"boundingSphere":{"center":[5.017808437347412,3.8264338970184326,0],"radius":0}}},{"uuid":"1ACEEBBE-FD66-4972-BD21-AE12F304DB19","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[3.5265722274780273,-3.1735494136810303,0,5.017808437347412,3.8264338970184326,0],"normalized":false}},"boundingSphere":{"center":[4.27219033241272,0.32644224166870117,0],"radius":3.578531534851154}}},{"uuid":"4CB09544-B7FE-492B-8C38-C469F820823E","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[5.017808437347412,3.8264338970184326,0],"normalized":false}},"boundingSphere":{"center":[5.017808437347412,3.8264338970184326,0],"radius":0}}},{"uuid":"2C7C31D3-980A-4D91-AA0B-98F71A62AD6B","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[2.0957915782928467,0.30272528529167175,0],"normalized":false}},"boundingSphere":{"center":[2.0957915782928467,0.30272528529167175,0],"radius":0}}},{"uuid":"E62D4926-6511-4A4D-AC2B-6BBDCDB47596","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[5.017808437347412,3.8264338970184326,0,2.0957915782928467,0.30272528529167175,0],"normalized":false}},"boundingSphere":{"center":[3.5568000078201294,2.064579591155052,0],"radius":2.2888154635616895}}},{"uuid":"05F1910E-6420-4C0C-ACEA-4D1413691F91","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[2.0957915782928467,0.30272528529167175,0],"normalized":false}},"boundingSphere":{"center":[2.0957915782928467,0.30272528529167175,0],"radius":0}}},{"uuid":"680A19A6-CDB8-400F-911B-5901D8B43062","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[1.813665747642517,5.27939510345459,0],"normalized":false}},"boundingSphere":{"center":[1.813665747642517,5.27939510345459,0],"radius":0}}},{"uuid":"CF607357-432B-4A0A-8640-915EE8BBAEA0","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[2.0957915782928467,0.30272528529167175,0,1.813665747642517,5.27939510345459,0],"normalized":false}},"boundingSphere":{"center":[1.9547286629676819,2.791060194373131,0],"radius":2.4923301077171676}}},{"uuid":"B211F19D-36DF-4C6D-BB15-0E0D60E5BCD0","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[1.813665747642517,5.27939510345459,0],"normalized":false}},"boundingSphere":{"center":[1.813665747642517,5.27939510345459,0],"radius":0}}},{"uuid":"DE4590D4-4C74-41F2-BC3E-F2182EA671FD","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0.020151842385530472,1.0738649368286133,0],"normalized":false}},"boundingSphere":{"center":[0.020151842385530472,1.0738649368286133,0],"radius":0}}},{"uuid":"091F8A7B-4347-4703-B965-DCA5526EE28F","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[1.813665747642517,5.27939510345459,0,0.020151842385530472,1.0738649368286133,0],"normalized":false}},"boundingSphere":{"center":[0.9169087950140238,3.1766300201416016,0],"radius":2.2859995686105936}}},{"uuid":"891C669F-99DB-4A4E-B3F8-E98B4AB9FF60","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0.020151842385530472,1.0738649368286133,0],"normalized":false}},"boundingSphere":{"center":[0.020151842385530472,1.0738649368286133,0],"radius":0}}},{"uuid":"3A6ECD8C-3495-4B78-920D-627D8D1DFDC2","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-1.7935138940811157,4.338850975036621,0],"normalized":false}},"boundingSphere":{"center":[-1.7935138940811157,4.338850975036621,0],"radius":0}}},{"uuid":"C858A16C-9D38-49F0-A379-F14DC097785D","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0.020151842385530472,1.0738649368286133,0,-1.7935138940811157,4.338850975036621,0],"normalized":false}},"boundingSphere":{"center":[-0.8866810258477926,2.706357955932617,0],"radius":1.8674526254584296}}},{"uuid":"E779FFC1-2C26-470E-B3AF-9356E3B4E029","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-1.7935138940811157,4.338850975036621,0],"normalized":false}},"boundingSphere":{"center":[-1.7935138940811157,4.338850975036621,0],"radius":0}}},{"uuid":"0E97BDF6-AF12-438B-9962-C551D6B31531","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-3.8086981773376465,-2.288435220718384,0],"normalized":false}},"boundingSphere":{"center":[-3.8086981773376465,-2.288435220718384,0],"radius":0}}},{"uuid":"3FDAD952-0BDC-4875-96FA-4E2C9264F510","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-1.7935138940811157,4.338850975036621,0,-3.8086981773376465,-2.288435220718384,0],"normalized":false}},"boundingSphere":{"center":[-2.801106035709381,1.0252078771591187,0],"radius":3.4634480657261553}}}],"materials":[{"uuid":"4DD400B4-44FB-4604-B4E3-BF6AA3AB67BC","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"F5A4F88C-826E-4862-83B7-754F1D4B7EA2","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"D970C2DD-F851-4538-B8DD-B379FB65BBBF","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"D24205E7-21F1-49C2-8890-186108C231A7","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"008EC6F2-8E25-4499-B308-835246077568","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"814D9AC5-5864-4D7C-B982-6C84D5089693","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"1FE08704-DA35-40F0-9E08-B99BB17E3732","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"6D2779E0-E4EB-452C-BEFF-C273053B18DC","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"195BF710-8B69-44BD-8E2A-77CA1ECE2E78","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"7C9A4215-5191-462B-AF31-75C971590E5A","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"60952D35-EFFE-4CDC-AFC9-975E63F8A9B0","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"A9ACC437-6DE4-4762-B9E9-2FC83EB8A8B5","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"727ADEC7-883D-46A3-8530-C006C6A4FDC6","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"90E3BF15-1F27-4D55-A543-9293D7D2BBAA","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"C8701881-4D59-4EDB-848A-8C38FDDD6B1D","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"4E78080D-8B3B-4147-ACB7-21BCC5C49F99","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"F777B810-E665-4783-93C4-5599EB7FFAEC","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"6F3F4E08-96D9-4601-B910-7B35F43A6B4E","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"402709B0-A66E-41BE-893B-57EB5C781A7B","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"8939DCD6-400D-41ED-BC29-46E590DD8FC0","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"1B5A376D-B208-4A05-B8B0-C434FBD9BBCF","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"D51AAD57-A775-4D93-B459-A87E7BE34F50","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680}],"object":{"uuid":"1FE72007-37A6-4635-9BE8-475C3A0F9CF4","type":"Group","name":"s1","visible":false,"userData":{"type":"sketch","geomStartIdx":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"children":[{"uuid":"3BDAEBB6-DC17-47AC-B885-7DA651EF21A3","type":"Group","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"78D2A2EA-A09C-4706-848A-D8AE416BC308","type":"Points","name":"p0","userData":{"type":"point","constraints":[]},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"39436898-7ED0-4904-BA76-EF812E23CE12","material":"4DD400B4-44FB-4604-B4E3-BF6AA3AB67BC"},{"uuid":"A3B1B63C-41A9-493E-9FA1-A0F2576ADAE0","type":"Points","name":"p1","userData":{"type":"point","constraints":[9],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"47F6DF85-E6A2-46FE-864E-39581170F9AF","material":"F5A4F88C-826E-4862-83B7-754F1D4B7EA2"},{"uuid":"81CBF106-7424-4183-8F5C-708DF1944576","type":"Points","name":"p2","userData":{"type":"point","constraints":[2],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"569C1239-1A2A-4BD4-8A3C-C7A8CABEF519","material":"D970C2DD-F851-4538-B8DD-B379FB65BBBF"},{"uuid":"4EE51561-324D-485F-8B2C-733B66709757","type":"Line","name":"l3","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"C3C4E99A-2D94-44FB-8124-BC4159CBC716","material":"D24205E7-21F1-49C2-8890-186108C231A7"},{"uuid":"F73E1741-5CAD-4B87-A712-27B59C1C677C","type":"Points","name":"p4","userData":{"type":"point","constraints":[2],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"B1BE1034-2AD9-4FF6-B8E3-885E07A6E4AC","material":"008EC6F2-8E25-4499-B308-835246077568"},{"uuid":"91380C5F-35FD-4C56-9144-B901C9AFDAB2","type":"Points","name":"p5","userData":{"type":"point","constraints":[3],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"5A20C7E4-818F-4259-984A-1D91BAA4CF95","material":"814D9AC5-5864-4D7C-B982-6C84D5089693"},{"uuid":"E7F5465A-791E-4E55-B35E-EE566EDEF234","type":"Line","name":"l6","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"1ACEEBBE-FD66-4972-BD21-AE12F304DB19","material":"1FE08704-DA35-40F0-9E08-B99BB17E3732"},{"uuid":"C3E9354E-B12C-4DCB-9C98-EDCB1C34B50E","type":"Points","name":"p7","userData":{"type":"point","constraints":[3],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"4CB09544-B7FE-492B-8C38-C469F820823E","material":"6D2779E0-E4EB-452C-BEFF-C273053B18DC"},{"uuid":"AE2C2B28-BE0C-435E-B436-990C151950D9","type":"Points","name":"p8","userData":{"type":"point","constraints":[4],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"2C7C31D3-980A-4D91-AA0B-98F71A62AD6B","material":"195BF710-8B69-44BD-8E2A-77CA1ECE2E78"},{"uuid":"57CAA5B8-966F-4029-9A5E-3DBC4B6F6330","type":"Line","name":"l9","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"E62D4926-6511-4A4D-AC2B-6BBDCDB47596","material":"7C9A4215-5191-462B-AF31-75C971590E5A"},{"uuid":"CD6FC608-2086-4EA8-BAFB-0B5D74FA64CF","type":"Points","name":"p10","userData":{"type":"point","constraints":[4],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"05F1910E-6420-4C0C-ACEA-4D1413691F91","material":"60952D35-EFFE-4CDC-AFC9-975E63F8A9B0"},{"uuid":"232992EF-FE50-4025-8B18-C9CC2A3C04FC","type":"Points","name":"p11","userData":{"type":"point","constraints":[5],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"680A19A6-CDB8-400F-911B-5901D8B43062","material":"A9ACC437-6DE4-4762-B9E9-2FC83EB8A8B5"},{"uuid":"E7B59333-3AC1-4968-A70A-892F5834FD6B","type":"Line","name":"l12","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"CF607357-432B-4A0A-8640-915EE8BBAEA0","material":"727ADEC7-883D-46A3-8530-C006C6A4FDC6"},{"uuid":"EBF511CF-CBB2-4E00-AB89-A33A1C4D43B4","type":"Points","name":"p13","userData":{"type":"point","constraints":[5],"l_id":4},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"B211F19D-36DF-4C6D-BB15-0E0D60E5BCD0","material":"90E3BF15-1F27-4D55-A543-9293D7D2BBAA"},{"uuid":"B1FCE07C-9E6D-47AE-A90F-4C26A1783AD9","type":"Points","name":"p14","userData":{"type":"point","constraints":[6],"l_id":4},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"DE4590D4-4C74-41F2-BC3E-F2182EA671FD","material":"C8701881-4D59-4EDB-848A-8C38FDDD6B1D"},{"uuid":"7649079E-BEEC-4358-81C4-2FC704FB541D","type":"Line","name":"l15","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":4},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"091F8A7B-4347-4703-B965-DCA5526EE28F","material":"4E78080D-8B3B-4147-ACB7-21BCC5C49F99"},{"uuid":"1B47E7FB-D39E-497E-B354-15FFDEB9746E","type":"Points","name":"p16","userData":{"type":"point","constraints":[6],"l_id":5},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"891C669F-99DB-4A4E-B3F8-E98B4AB9FF60","material":"F777B810-E665-4783-93C4-5599EB7FFAEC"},{"uuid":"B26E5522-49CB-4EC9-9F82-50DB81E57DD3","type":"Points","name":"p17","userData":{"type":"point","constraints":[7],"l_id":5},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"3A6ECD8C-3495-4B78-920D-627D8D1DFDC2","material":"6F3F4E08-96D9-4601-B910-7B35F43A6B4E"},{"uuid":"9B9DF95D-DA7C-4D4B-BA1D-37EBF2A037D9","type":"Line","name":"l18","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":5},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"C858A16C-9D38-49F0-A379-F14DC097785D","material":"402709B0-A66E-41BE-893B-57EB5C781A7B"},{"uuid":"835E7F64-4D63-4602-BB7C-C65BE684F82A","type":"Points","name":"p19","userData":{"type":"point","constraints":[7],"l_id":6},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"E779FFC1-2C26-470E-B3AF-9356E3B4E029","material":"8939DCD6-400D-41ED-BC29-46E590DD8FC0"},{"uuid":"BB729CA6-9371-4BA3-9358-D96FDC93D822","type":"Points","name":"p20","userData":{"type":"point","constraints":[9],"l_id":6},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"0E97BDF6-AF12-438B-9962-C551D6B31531","material":"1B5A376D-B208-4A05-B8B0-C434FBD9BBCF"},{"uuid":"13260527-3BD9-4EE9-87ED-EE0D113D186C","type":"Line","name":"l21","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":6},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"3FDAD952-0BDC-4875-96FA-4E2C9264F510","material":"D51AAD57-A775-4D93-B459-A87E7BE34F50"}]}},"objIdx":"{\"dataType\":\"Map\",\"value\":[[\"\",0],[\"p0\",1],[\"p1\",2],[\"p2\",3],[\"l3\",4],[\"p4\",5],[\"p5\",6],[\"l6\",7],[\"p7\",8],[\"p8\",9],[\"l9\",10],[\"p10\",11],[\"p11\",12],[\"l12\",13],[\"p13\",14],[\"p14\",15],[\"l15\",16],[\"p16\",17],[\"p17\",18],[\"l18\",19],[\"p19\",20],[\"p20\",21],[\"l21\",22]]}","linkedObjs":"{\"dataType\":\"Map\",\"value\":[[0,[\"line\",[\"p1\",\"p2\",\"l3\"]]],[1,[\"line\",[\"p4\",\"p5\",\"l6\"]]],[2,[\"line\",[\"p7\",\"p8\",\"l9\"]]],[3,[\"line\",[\"p10\",\"p11\",\"l12\"]]],[4,[\"line\",[\"p13\",\"p14\",\"l15\"]]],[5,[\"line\",[\"p16\",\"p17\",\"l18\"]]],[6,[\"line\",[\"p19\",\"p20\",\"l21\"]]]]}","l_id":8,"constraints":"{\"dataType\":\"Map\",\"value\":[[2,[\"points_coincident\",-1,[\"p2\",\"p4\",-1,-1]]],[3,[\"points_coincident\",-1,[\"p5\",\"p7\",-1,-1]]],[4,[\"points_coincident\",-1,[\"p8\",\"p10\",-1,-1]]],[5,[\"points_coincident\",-1,[\"p11\",\"p13\",-1,-1]]],[6,[\"points_coincident\",-1,[\"p14\",\"p16\",-1,-1]]],[7,[\"points_coincident\",-1,[\"p17\",\"p19\",-1,-1]]],[9,[\"points_coincident\",-1,[\"p1\",\"p20\",-1,-1]]]]}","c_id":9},"e1":{"metadata":{"version":4.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"9F7264B1-B33F-4DF7-98C4-756A8CDA83DB","type":"ExtrudeGeometry","shapes":["52655637-F02B-43FA-9D5B-9A6208BC0C9C"],"options":{"depth":"3.8","bevelEnabled":false}}],"materials":[{"uuid":"F67E31CA-0FF0-4C16-B46E-B7E6545279DA","type":"MeshPhongMaterial","color":10342381,"emissive":468276,"specular":1118481,"shininess":30,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"0484940F-F53B-4CB7-85F9-C61A302EB8B5","type":"PointsMaterial","color":16777215,"size":0,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680}],"shapes":[{"arcLengthDivisions":200,"type":"Shape","autoClose":false,"curves":[{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-3.8086981773376465,-2.288435220718384],"v2":[3.5265722274780273,-3.1735494136810303]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[3.5265722274780273,-3.1735494136810303],"v2":[3.5265722274780273,-3.1735494136810303]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[3.5265722274780273,-3.1735494136810303],"v2":[5.017808437347412,3.8264338970184326]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[5.017808437347412,3.8264338970184326],"v2":[5.017808437347412,3.8264338970184326]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[5.017808437347412,3.8264338970184326],"v2":[2.0957915782928467,0.30272528529167175]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[2.0957915782928467,0.30272528529167175],"v2":[2.0957915782928467,0.30272528529167175]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[2.0957915782928467,0.30272528529167175],"v2":[1.813665747642517,5.27939510345459]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[1.813665747642517,5.27939510345459],"v2":[1.813665747642517,5.27939510345459]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[1.813665747642517,5.27939510345459],"v2":[0.020151842385530472,1.0738649368286133]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[0.020151842385530472,1.0738649368286133],"v2":[0.020151842385530472,1.0738649368286133]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[0.020151842385530472,1.0738649368286133],"v2":[-1.7935138940811157,4.338850975036621]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-1.7935138940811157,4.338850975036621],"v2":[-1.7935138940811157,4.338850975036621]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-1.7935138940811157,4.338850975036621],"v2":[-3.8086981773376465,-2.288435220718384]}],"currentPoint":[-3.8086981773376465,-2.288435220718384],"uuid":"52655637-F02B-43FA-9D5B-9A6208BC0C9C","holes":[]}],"object":{"uuid":"A1AE096C-4E9F-4A11-A6F6-A24E38660343","type":"Mesh","name":"e1","userData":{"type":"mesh","featureInfo":["s1","3.8"]},"layers":3,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"9F7264B1-B33F-4DF7-98C4-756A8CDA83DB","material":"F67E31CA-0FF0-4C16-B46E-B7E6545279DA","children":[{"uuid":"095C6FAA-0E8E-4818-B6EB-7D4940E54CF1","type":"Points","userData":{"type":"point"},"layers":3,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":"9F7264B1-B33F-4DF7-98C4-756A8CDA83DB","material":"0484940F-F53B-4CB7-85F9-C61A302EB8B5"}]}}},"allIds":["s1","e1"],"tree":{"s1":{"e1":true},"e1":{}},"order":{"s1":0,"e1":1},"visible":{"s1":false,"e1":true,"":false},"activeSketchId":""}] \ No newline at end of file diff --git a/example_parts/uncomp_2021-04-18T00-33-34.json b/example_parts/uncomp_2021-04-18T00-33-34.json new file mode 100644 index 0000000..f406dd5 --- /dev/null +++ b/example_parts/uncomp_2021-04-18T00-33-34.json @@ -0,0 +1 @@ +[16,2,2,{"byId":{"s1":{"obj3d":{"metadata":{"version":4.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"BB1BA5D3-F84B-42BC-87BD-13CB62F26A46","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0,0,0],"normalized":false}},"boundingSphere":{"center":[0,0,0],"radius":0}}},{"uuid":"6CF8E8A7-5E1C-490A-8A96-03E82F443AFA","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-3.6584134101867676,2.66790509223938,8.123309603173573e-16],"normalized":false}},"boundingSphere":{"center":[-3.6584134101867676,2.66790509223938,8.123309603173573e-16],"radius":0}}},{"uuid":"986EA02A-EC99-4584-8DF0-EEC9AE07529A","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0.49596744775772095,-4.708676815032959,-1.1012689599303925e-16],"normalized":false}},"boundingSphere":{"center":[0.49596744775772095,-4.708676815032959,-1.1012689599303925e-16],"radius":0}}},{"uuid":"08737D39-FEA2-4F1C-B97B-B0994AD1BA20","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-3.6584134101867676,2.66790509223938,8.123309603173573e-16,0.49596744775772095,-4.708676815032959,-1.1012689599303925e-16],"normalized":false}},"boundingSphere":{"center":[-1.5812229812145233,-1.0203858613967896,3.5110203216215903e-16],"radius":4.232990696527492}}},{"uuid":"9B46451E-5C15-4B71-B4AF-9BF51E3B9E0B","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0.49596744775772095,-4.708676815032959,-1.1012689599303925e-16],"normalized":false}},"boundingSphere":{"center":[0.49596744775772095,-4.708676815032959,-1.1012689599303925e-16],"radius":0}}},{"uuid":"0543CF64-606A-43F7-BFCD-404C62BB6D0A","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[6.493009090423584,2.6586976051330566,-1.4417376382577416e-15],"normalized":false}},"boundingSphere":{"center":[6.493009090423584,2.6586976051330566,-1.4417376382577416e-15],"radius":0}}},{"uuid":"8F6401A5-3320-4980-A786-6871AB1EDAA4","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0.49596744775772095,-4.708676815032959,-1.1012689599303925e-16,6.493009090423584,2.6586976051330566,-1.4417376382577416e-15],"normalized":false}},"boundingSphere":{"center":[3.4944882690906525,-1.0249896049499512,-7.759322671253904e-16],"radius":4.74980826746683}}},{"uuid":"E0955A74-6357-47D9-A339-F01CCF18DBAD","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[6.493009090423584,2.6586976051330566,-1.4417376382577416e-15],"normalized":false}},"boundingSphere":{"center":[6.493009090423584,2.6586976051330566,-1.4417376382577416e-15],"radius":0}}},{"uuid":"BBB96621-881E-4F65-AFCF-B7FCAF9437C1","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0.6389902234077454,-1.8591113090515137,-1.418843317075303e-16],"normalized":false}},"boundingSphere":{"center":[0.6389902234077454,-1.8591113090515137,-1.418843317075303e-16],"radius":0}}},{"uuid":"26539B99-D7C6-4E02-A338-44AAA6C5DD7B","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[6.493009090423584,2.6586976051330566,-1.4417376382577416e-15,0.6389902234077454,-1.8591113090515137,-1.418843317075303e-16],"normalized":false}},"boundingSphere":{"center":[3.5659996569156647,0.3997931480407715,-7.91810984982636e-16],"radius":3.6973008492839394}}},{"uuid":"0DFE52FE-28CB-4D9B-8288-5504B12B0E46","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0.6389902234077454,-1.8591113090515137,-1.418843317075303e-16],"normalized":false}},"boundingSphere":{"center":[0.6389902234077454,-1.8591113090515137,-1.418843317075303e-16],"radius":0}}},{"uuid":"7D80EEEB-6016-4020-84CE-FB8939958D35","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[-3.6584134101867676,2.66790509223938,6.793868099051899e-16],"normalized":false}},"boundingSphere":{"center":[-3.6584134101867676,2.66790509223938,6.793868099051899e-16],"radius":0}}},{"uuid":"F4E9BE14-0905-4BBE-9134-98E28D976F9B","type":"BufferGeometry","data":{"attributes":{"position":{"itemSize":3,"type":"Float32Array","array":[0.6389902234077454,-1.8591113090515137,-1.418843317075303e-16,-3.6584134101867676,2.66790509223938,6.793868099051899e-16],"normalized":false}},"boundingSphere":{"center":[-1.509711593389511,0.4043968915939331,2.687512390988298e-16],"radius":3.1209596075401262}}}],"materials":[{"uuid":"F293FA74-99FE-427F-8D19-25CCCCD7EF55","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"FEEE9C6D-ABF7-4342-B473-EA95B84B950B","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"A8209307-1682-4E96-AFAC-7FE98CC69639","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"E74A7D1C-541A-4397-94C5-E2418CF96910","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"EDAEFA88-975F-4048-8085-0E20D3238D82","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"F57CE13C-D6EC-475D-80AB-BE81CA833339","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"EBDD5620-8A76-43C1-A60F-EE726B4FDC06","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"2FA078A9-54C5-47AE-92DC-266EC81C29A4","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"50B89415-0808-44D0-B8CD-D959141F8703","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"49678374-2CC3-4B99-A01B-291D496434A1","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"9CFC460C-C0F6-472A-9FC4-9B29ECD02B75","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"E3B1CB4D-45B9-4BDB-9AD5-EA7B6625E513","type":"PointsMaterial","color":16777215,"size":4,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"E058E709-0AA8-4597-9812-BDB2F9BF78D8","type":"LineBasicMaterial","color":16777215,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680}],"object":{"uuid":"13E078AF-5D21-46B8-8A57-41B206F02D09","type":"Group","name":"s1","visible":false,"userData":{"type":"sketch","geomStartIdx":1},"layers":1,"matrix":[2.220446049250313e-16,0,-1,0,0,1,0,0,1,0,2.220446049250313e-16,0,0,0,0,1],"matrixAutoUpdate":false,"children":[{"uuid":"54242691-B95D-4444-964E-2C9E917E9093","type":"Group","layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},{"uuid":"B2CC52C0-794B-4A29-B4FB-171371AF8182","type":"Points","name":"p0","userData":{"type":"point","constraints":[]},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"BB1BA5D3-F84B-42BC-87BD-13CB62F26A46","material":"F293FA74-99FE-427F-8D19-25CCCCD7EF55"},{"uuid":"9BBB7950-CEB3-4FBC-A5BF-B03EB5BF7758","type":"Points","name":"p1","userData":{"type":"point","constraints":[6],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"6CF8E8A7-5E1C-490A-8A96-03E82F443AFA","material":"FEEE9C6D-ABF7-4342-B473-EA95B84B950B"},{"uuid":"21CA18C0-14A0-4AF3-A711-29E79C40005A","type":"Points","name":"p2","userData":{"type":"point","constraints":[2],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"986EA02A-EC99-4584-8DF0-EEC9AE07529A","material":"A8209307-1682-4E96-AFAC-7FE98CC69639"},{"uuid":"17803D5A-F01C-4B32-B12B-4491C34807C1","type":"Line","name":"l3","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":0},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"08737D39-FEA2-4F1C-B97B-B0994AD1BA20","material":"E74A7D1C-541A-4397-94C5-E2418CF96910"},{"uuid":"3B97223F-8BD8-48FB-80DF-BF4437EE59A3","type":"Points","name":"p4","userData":{"type":"point","constraints":[2],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"9B46451E-5C15-4B71-B4AF-9BF51E3B9E0B","material":"EDAEFA88-975F-4048-8085-0E20D3238D82"},{"uuid":"4975261C-E282-4354-B323-6AD272896A3F","type":"Points","name":"p5","userData":{"type":"point","constraints":[3],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"0543CF64-606A-43F7-BFCD-404C62BB6D0A","material":"F57CE13C-D6EC-475D-80AB-BE81CA833339"},{"uuid":"2F1DC4E3-58D7-4549-A326-B39B9AB1791F","type":"Line","name":"l6","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":1},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"8F6401A5-3320-4980-A786-6871AB1EDAA4","material":"EBDD5620-8A76-43C1-A60F-EE726B4FDC06"},{"uuid":"D414C7A0-CF2C-4E6C-9F88-41FC20DDB500","type":"Points","name":"p7","userData":{"type":"point","constraints":[3],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"E0955A74-6357-47D9-A339-F01CCF18DBAD","material":"2FA078A9-54C5-47AE-92DC-266EC81C29A4"},{"uuid":"D9D3C4BE-F212-41CA-9B85-EDFA808338F0","type":"Points","name":"p8","userData":{"type":"point","constraints":[4],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"BBB96621-881E-4F65-AFCF-B7FCAF9437C1","material":"50B89415-0808-44D0-B8CD-D959141F8703"},{"uuid":"9B792A72-8A0C-4096-98A5-2008DD3278F1","type":"Line","name":"l9","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":2},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"26539B99-D7C6-4E02-A338-44AAA6C5DD7B","material":"49678374-2CC3-4B99-A01B-291D496434A1"},{"uuid":"D5D3A9B7-5A07-496F-AEE5-9C2F761B49FB","type":"Points","name":"p10","userData":{"type":"point","constraints":[4],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"0DFE52FE-28CB-4D9B-8288-5504B12B0E46","material":"9CFC460C-C0F6-472A-9FC4-9B29ECD02B75"},{"uuid":"7F00B757-1A73-49C9-BE3A-A2C14D527E2F","type":"Points","name":"p11","userData":{"type":"point","constraints":[6],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"7D80EEEB-6016-4020-84CE-FB8939958D35","material":"E3B1CB4D-45B9-4BDB-9AD5-EA7B6625E513"},{"uuid":"4D083D4C-8C7A-4AD2-90DA-DFD6EE6D71F3","type":"Line","name":"l12","frustumCulled":false,"userData":{"type":"line","constraints":[],"l_id":3},"layers":1,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"F4E9BE14-0905-4BBE-9134-98E28D976F9B","material":"E058E709-0AA8-4597-9812-BDB2F9BF78D8"}]}},"objIdx":"{\"dataType\":\"Map\",\"value\":[[\"\",0],[\"p0\",1],[\"p1\",2],[\"p2\",3],[\"l3\",4],[\"p4\",5],[\"p5\",6],[\"l6\",7],[\"p7\",8],[\"p8\",9],[\"l9\",10],[\"p10\",11],[\"p11\",12],[\"l12\",13]]}","linkedObjs":"{\"dataType\":\"Map\",\"value\":[[0,[\"line\",[\"p1\",\"p2\",\"l3\"]]],[1,[\"line\",[\"p4\",\"p5\",\"l6\"]]],[2,[\"line\",[\"p7\",\"p8\",\"l9\"]]],[3,[\"line\",[\"p10\",\"p11\",\"l12\"]]]]}","l_id":5,"constraints":"{\"dataType\":\"Map\",\"value\":[[2,[\"points_coincident\",-1,[\"p2\",\"p4\",-1,-1]]],[3,[\"points_coincident\",-1,[\"p5\",\"p7\",-1,-1]]],[4,[\"points_coincident\",-1,[\"p8\",\"p10\",-1,-1]]],[6,[\"points_coincident\",-1,[\"p11\",\"p1\",-1,-1]]]]}","c_id":6},"e1":{"metadata":{"version":4.5,"type":"Object","generator":"Object3D.toJSON"},"geometries":[{"uuid":"8AD1B009-7142-47B6-9A9D-10728917A600","type":"ExtrudeGeometry","shapes":["DD9E8CB5-9EFB-411A-8B9F-054AAC458686"],"options":{"depth":"2.5","bevelEnabled":false}}],"materials":[{"uuid":"0CD81874-63DE-4A46-BF8C-290DD1482E23","type":"MeshPhongMaterial","color":10342381,"emissive":468276,"specular":1118481,"shininess":30,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680},{"uuid":"DAB6A3BE-8809-4FE2-8156-1F3CF4A488A4","type":"PointsMaterial","color":16777215,"size":0,"sizeAttenuation":true,"depthFunc":3,"depthTest":true,"depthWrite":true,"stencilWrite":false,"stencilWriteMask":255,"stencilFunc":519,"stencilRef":0,"stencilFuncMask":255,"stencilFail":7680,"stencilZFail":7680,"stencilZPass":7680}],"shapes":[{"arcLengthDivisions":200,"type":"Shape","autoClose":false,"curves":[{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[-3.6584134101867676,2.66790509223938],"v2":[0.49596744775772095,-4.708676815032959]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[0.49596744775772095,-4.708676815032959],"v2":[0.49596744775772095,-4.708676815032959]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[0.49596744775772095,-4.708676815032959],"v2":[6.493009090423584,2.6586976051330566]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[6.493009090423584,2.6586976051330566],"v2":[6.493009090423584,2.6586976051330566]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[6.493009090423584,2.6586976051330566],"v2":[0.6389902234077454,-1.8591113090515137]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[0.6389902234077454,-1.8591113090515137],"v2":[0.6389902234077454,-1.8591113090515137]},{"metadata":{"version":4.5,"type":"Curve","generator":"Curve.toJSON"},"arcLengthDivisions":200,"type":"LineCurve","v1":[0.6389902234077454,-1.8591113090515137],"v2":[-3.6584134101867676,2.66790509223938]}],"currentPoint":[-3.6584134101867676,2.66790509223938],"uuid":"DD9E8CB5-9EFB-411A-8B9F-054AAC458686","holes":[]}],"object":{"uuid":"B9DF7FF3-7CE8-4BEE-AD90-284B7B8C2698","type":"Mesh","name":"e1","userData":{"type":"mesh","featureInfo":["s1","2.5"]},"layers":3,"matrix":[2.220446049250313e-16,0,-1,0,0,1,0,0,1,0,2.220446049250313e-16,0,0,0,0,1],"matrixAutoUpdate":false,"geometry":"8AD1B009-7142-47B6-9A9D-10728917A600","material":"0CD81874-63DE-4A46-BF8C-290DD1482E23","children":[{"uuid":"25EC6A8A-1164-4A26-99B2-0AA1A6F63DD4","type":"Points","userData":{"type":"point"},"layers":3,"matrix":[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],"geometry":"8AD1B009-7142-47B6-9A9D-10728917A600","material":"DAB6A3BE-8809-4FE2-8156-1F3CF4A488A4"}]}}},"allIds":["s1","e1"],"tree":{"s1":{"e1":true},"e1":{}},"order":{"s1":0,"e1":1},"visible":{"s1":false,"e1":true,"":false},"activeSketchId":""}] \ No newline at end of file diff --git a/example_parts/webpack.prod.js b/example_parts/webpack.prod.js new file mode 100644 index 0000000..1d1feb9 --- /dev/null +++ b/example_parts/webpack.prod.js @@ -0,0 +1,10 @@ +const { merge } = require('webpack-merge'); + +const common = require('./webpack.common.js'); + + +module.exports = merge(common, { + + mode: 'production', + +}); \ No newline at end of file diff --git a/localhost-key.pem b/localhost-key.pem new file mode 100644 index 0000000..1793617 --- /dev/null +++ b/localhost-key.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDyMGwhoISvPn3Q +QBJbSHZSTM8mGgK4DwY0REvnzvZPycGOdqBRumPqDExUmDGZehDvPB9KS5rITIac +sDe/IkNB438tyvjxpwT959G0DaGf282/KsT1V7NlkHp6voP5NfzJLl4h2suzzTrF +bYiftcaTn86PhaTpHnInBOiNrDcOv3vJmDn0fUICiGD3m0q6i7G3dsNuJDCMOXMi +oCL46g4WIUiLU3uTfhHaKzDsUW+gKu6Q0sEwVd1GzTz7S4Xde77hUAjapHOFuFT8 +D8WF4Ze7pZNfKx3CnQmY3dyHWjZu0GgQuypF2IXk93Q9IYts3U3phq0WzPcq4L3d +6qVsZsbbAgMBAAECggEAa5QUxA8gQROaIUIEpWWXoVEbBsqxAH8z+02HBg4JnUF6 +Z8TLy+HmddVGpqEADzOIiCwFniPdOjG77afc61rV01Oxb27ki7rr3bj2jmsrqu2h +A9SErpJpTqkRrqonxzAy/E5LY/BjYZe9DmtsL7032uU2hMwRh7eNb0Wf4yZnQnXw +2aGajqF7i1R50B1uBlh/EeS+3+nR9O5YSi9abyHsYxGz8l+wSvA5uLv0dkP7xWBb +8PmMN87wEbZDV4jJyyJw4VhaFvMgjwwboTDcOgOnrGOAN31991LtBAt6ypSeOndo +Tvl4xfYA1Gs6mgCx+LtRnSoPVKj3ziLw/tdezgsT4QKBgQD4YizViNoD4HqwnDdQ +NopSMSw0gJGRw4NFvAm1Ci2WjOv1cBQaorRwu+nYfyaRlkaHcG3dHr24DW4VcUY8 +VnZBRq6SvmmuXCenHXiXOykWFXFfxZSJT1svfllpAXdAPcQm5luIIYV/eGg8gBJt +OjECNFYObDMGrM03A2G3i+jxUQKBgQD5nZ8Lz5ANhZd9DEu7hJcIiBh6m7Z3JujW +U9DTDvZ51MzThgJRC2A6dU8mcJfZo3Wa+Pv1xsz0OjjG+83bMNJB0OVff5laaU50 +eApOp5XsNHGzcjYoxSxxztCd7UFtf4Bu33yGDN91B8WQY1c++BpZQ4XCG8AKFzdI +HqQAAaDKawKBgQCzRvFDYxaxK6qCpQ6LmAI4lwNoFdB8HFk40SNUh7cl7is1qSLp +oryIjimYORZWiNf5VB4INvMK0K6/TVY7oNCUBvdkNYnD7wIz7eKnjWz3YpzFWq/+ +d8fCPPk+AG/Zb3uP9D7mwANCYV8jI/Go4xKSm8HtgQ1HaRxp88fpGlQVMQKBgQD3 +uAxR/VAZiz2WtPAnjWMR7XZVn1iKkQu7P/zaqFvE9oG7XZ/I7EA4Y5kELfMU4tpg +zL3H4N4fdfRIzTYzVBUliflIN+ppxl48ybB49Gmdu0Incq368gq0eymfwQgQcdt0 +rMf4hKfyjZ7sNxorfK8xbQg+ZanEmdub8ASTmQoINwKBgHnT+FJyuhvrcnMMhS4Q +G8wvL1gbnQCBUd8+ouc9vbfE8eXFQVyGuqjToPQcKxl9rjha4X9gNw9yWa5zxOhX +5LEmewUMo1LfaryhBt08Mc2CeIbFTEveqj3Ajhn1t9wW03X7+8A8E0sPBLzpDnr0 +yRyKZKdn91/5P6r1MztY2LQh +-----END PRIVATE KEY----- diff --git a/localhost.pem b/localhost.pem new file mode 100644 index 0000000..72055a9 --- /dev/null +++ b/localhost.pem @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID9DCCAlygAwIBAgIQKfKuWsppHxEm8FuAqgxhpjANBgkqhkiG9w0BAQsFADBP +MR4wHAYDVQQKExVta2NlcnQgZGV2ZWxvcG1lbnQgQ0ExEjAQBgNVBAsMCWhvd2Fy +ZEBocDEZMBcGA1UEAwwQbWtjZXJ0IGhvd2FyZEBocDAeFw0yMTA0MTgwNjIxMjZa +Fw0yMzA3MTgwNjIxMjZaMD0xJzAlBgNVBAoTHm1rY2VydCBkZXZlbG9wbWVudCBj +ZXJ0aWZpY2F0ZTESMBAGA1UECwwJaG93YXJkQGhwMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA8jBsIaCErz590EASW0h2UkzPJhoCuA8GNERL5872T8nB +jnagUbpj6gxMVJgxmXoQ7zwfSkuayEyGnLA3vyJDQeN/Lcr48acE/efRtA2hn9vN +vyrE9VezZZB6er6D+TX8yS5eIdrLs806xW2In7XGk5/Oj4Wk6R5yJwTojaw3Dr97 +yZg59H1CAohg95tKuouxt3bDbiQwjDlzIqAi+OoOFiFIi1N7k34R2isw7FFvoCru +kNLBMFXdRs08+0uF3Xu+4VAI2qRzhbhU/A/FheGXu6WTXysdwp0JmN3ch1o2btBo +ELsqRdiF5Pd0PSGLbN1N6YatFsz3KuC93eqlbGbG2wIDAQABo14wXDAOBgNVHQ8B +Af8EBAMCBaAwEwYDVR0lBAwwCgYIKwYBBQUHAwEwHwYDVR0jBBgwFoAU1LipvY+p +DhxjE8UP8QpCiAfmI3kwFAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEB +CwUAA4IBgQAaGHY+H63/Q7MQmRyKG3eTaW8al2pzd7MejiNSDt9R+2KeiMwmzvC8 +OlslfNviatLfMqaOA5WrdpifblVRqjXZyblqeaswlA5S0gzx4JLr7yKtb4FVlwpa +Iv3/cOJB0HXEhJoWKTSKAFXgjqxUSaRbSX2tQRiRNE72shc9J5cYP3AMCloC3PUG +pbEyo+08cEHIUoZBMmjSFB2cB8JQijs3iDSCCGILCzjV0/33I0RfoFWIZZPIYFON +1zDYmaXWmpd7GAsl1rHE9o835HnyqGFy+IOovxVufSqzzRX8JlOzCzKioIfq4EjC +FLpNlZ0snDovZ6AmmH3UL1Nk2N/0WaLrrgnr58qtBqao1x1DdhcjGymjPFRyqItI +4yNnlKpaYHk5W/Z8zm8Pb1b/tCBmdlFyYyBmqkRSOqcwS/eGmV9BFZJrdU1XM4fH +0kyIOt9bDZcZWvwOcD94TUz9FNu18GDUhqBrqPAYSMlaJpe60pPiPcsE21/2usqi +H6s/L19rZxE= +-----END CERTIFICATE----- diff --git a/src/Scene.js b/src/Scene.js index 54a81df..02a5cfb 100644 --- a/src/Scene.js +++ b/src/Scene.js @@ -24,8 +24,8 @@ window.loader = new THREE.ObjectLoader(); window.STLexp = new STLExporter(); window.id = 0 -window.sid = 1 -window.mid = 1 +// window.sid = 1 +// window.mid = 1 const pointMaterial = new THREE.PointsMaterial({ @@ -62,7 +62,14 @@ export class Scene { controls.target.set(0, 0, 0); controls.update(); - this.obj3d = new THREE.Scene() + + + + + + + + this.obj3d = new THREE.Scene() /////// // this.obj3d.background = new THREE.Color(color.background); const helpersGroup = new THREE.Group(); @@ -170,21 +177,30 @@ export class Scene { return needResize; } - saveState() { - localStorage.setItem( - 'sv2', JSON.stringify([id, this.sid, this.mid, this.store.getState().treeEntries]) - ) - - } - - saveString() { + saveScene() { return JSON.stringify([id, this.sid, this.mid, this.store.getState().treeEntries]) } - loadState() { //uglyyy + + clearScene() { + const deleted = this.obj3d.children.splice(1) + console.log(deleted) + + for (let i = 0; i < deleted.length; i++) { + deleted[i].traverse((obj) => { + if (obj.geometry) obj.geometry.dispose() + if (obj.material) obj.material.dispose() + }) + } + } + + loadState(file) { //uglyyy + + this.clearScene() + const [curid, cursid, curmid, state] = JSON.parse( - localStorage.getItem('sv2') + file ) window.id = curid @@ -234,27 +250,6 @@ export class Scene { return entry } - // clearSelection() { - // for (let x = 0, obj; x < this.selected.length; x++) { - // obj = this.selected[x] - // if (obj.userData.type == 'selpoint') { - // obj.visible = false - // } else { - // setHover(obj, 0) - // } - // } - // this.selected = [] - - // for (let x = 0; x < this.hovered.length; x++) { - - // const obj = this.hovered[x] - // setHover(obj, 0) - - - // } - - // } - boolOp(m1, m2, op, refresh = false) { let bspA = CSG.fromMesh(m1) @@ -425,7 +420,7 @@ async function addSketch() { } window.sc = new Scene(store) -sc.loadState() +// sc.loadState() diff --git a/src/react/app.jsx b/src/react/app.jsx index d12a23f..4120d03 100644 --- a/src/react/app.jsx +++ b/src/react/app.jsx @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom' import React, { } from 'react' import { createStore, applyMiddleware } from 'redux' -import { Provider } from 'react-redux' +import { Provider, useSelector } from 'react-redux' import { reducer } from './reducer' import logger from 'redux-logger' @@ -32,13 +32,13 @@ const store = createStore(reducer, {}, applyMiddleware(logger)) // const store = createStore(reducer, sc.loadState(), applyMiddleware(logger)) -const App = ({ store }) => ( - +const App = ({ store }) => { + return -) +} document.addEventListener('DOMContentLoaded', () => { ReactDOM.render(, document.getElementById('react')); diff --git a/src/react/dialog.jsx b/src/react/dialog.jsx index 0234d75..2836e94 100644 --- a/src/react/dialog.jsx +++ b/src/react/dialog.jsx @@ -44,7 +44,7 @@ export const Dialog = () => { switch (dialog.action) { case 'extrude': return <> - + ref.current.value *= -1} /> @@ -58,7 +58,7 @@ export const Dialog = () => { case 'extrude-edit': return <> - + ref.current.value *= -1} /> diff --git a/src/react/fileExporter.js b/src/react/fileExporter.js index 1e9a465..2d61107 100644 --- a/src/react/fileExporter.js +++ b/src/react/fileExporter.js @@ -1,6 +1,6 @@ -const link = document.createElement( 'a' ); +const link = document.createElement('a'); link.style.display = 'none'; -document.body.appendChild( link ); +document.body.appendChild(link); function save(blob, filename) { @@ -11,30 +11,147 @@ function save(blob, filename) { } -function saveArrayBuffer( buffer, filename ) { +function saveArrayBuffer(buffer, filename) { // save( new Blob( [ buffer ], { type: 'application/octet-stream' } ), filename ); - save( new Blob( [ buffer ], { type: 'model/stl' } ), filename ); + save(new Blob([buffer], { type: 'model/stl' }), filename); } -function saveString( text, filename ) { +function saveString(text, filename) { // save( new Blob( [ text ], { type: 'text/plain' } ), filename ); - save( new Blob( [ text ], { type: 'application/json' } ), filename ); + save(new Blob([text], { type: 'application/json' }), filename); } export function STLExport() { if (sc.selected[0] && sc.selected[0].userData.type == 'mesh') { - const result = STLexp.parse( sc.selected[0], { binary: true } ); - saveArrayBuffer( result, 'box.stl' ); + const result = STLexp.parse(sc.selected[0], { binary: true }); + saveArrayBuffer(result, 'box.stl'); } } -export function savePart() { +export async function saveFile(fileHandle, file, dispatch) { + try { + if (!fileHandle) { + return await saveFileAs(file, dispatch); + } + await writeFile(fileHandle, file); - saveString( sc.saveString(), 'uncomp.json' ); + dispatch({ type: 'set-modified', status: false }) + } catch (ex) { + const msg = 'Unable to save file'; + console.error(msg, ex); + alert(msg); + } + // app.setFocus(); +}; -} \ No newline at end of file +export async function saveFileAs(file, dispatch) { + let fileHandle; + try { + + const opts = { + types: [{ + // description: 'Text file', + accept: { 'application/json': ['.json'] }, + }], + }; + fileHandle = await showSaveFilePicker(opts) + + + } catch (ex) { + if (ex.name === 'AbortError') { + return; + } + const msg = 'An error occured trying to open the file.'; + console.error(msg, ex); + alert(msg); + return; + } + + try { + const writable = await fileHandle.createWritable(); + // Write the contents of the file to the stream. + await writable.write(file); + // Close the file and write the contents to disk. + await writable.close() + + dispatch({ type: 'set-file-handle', fileHandle, modified: false }) + + } catch (ex) { + + const msg = 'Unable to save file.'; + console.error(msg, ex); + alert(msg); + return; + } + + // app.setFocus(); +}; + + +async function verifyPermission(fileHandle, withWrite) { + const opts = {}; + if (withWrite) { + opts.writable = true; + // For Chrome 86 and later... + opts.mode = 'readwrite'; + } + // Check if we already have permission, if so, return true. + if (await fileHandle.queryPermission(opts) === 'granted') { + return true; + } + // Request permission to the file, if the user grants permission, return true. + if (await fileHandle.requestPermission(opts) === 'granted') { + return true; + } + // The user did nt grant permission, return false. + return false; +} + + +export async function openFile(dispatch) { + // if (!app.confirmDiscard()) { + // return; + // } + let fileHandle + + // If a fileHandle is provided, verify we have permission to read/write it, + // otherwise, show the file open prompt and allow the user to select the file. + try { + fileHandle = await getFileHandle(); + } catch (ex) { + if (ex.name === 'AbortError') { + return; + } + const msg = 'An error occured trying to open the file.'; + console.error(msg, ex); + alert(msg); + } + + if (!fileHandle) { + return; + } + const file = await fileHandle.getFile(); + + readFile(file, fileHandle, dispatch); + + + + try { + const text = await readFile(file); + sc.loadState(text) + dispatch({ type: 'set-file-handle', fileHandle }) + // app.setModified(false); + // app.setFocus(true); + } catch (ex) { + const msg = `An error occured reading ${fileHandle}`; + console.error(msg, ex); + alert(msg); + } + + +}; diff --git a/src/react/navBar.jsx b/src/react/navBar.jsx index 461ba6c..b55c682 100644 --- a/src/react/navBar.jsx +++ b/src/react/navBar.jsx @@ -4,33 +4,13 @@ import React, { useEffect, useReducer } from 'react'; import { useDispatch, useSelector } from 'react-redux' -import { FaEdit } from 'react-icons/fa' -import { MdSave } from 'react-icons/md' -import { FaFolderOpen } from 'react-icons/fa' +import { FaEdit, FaFileDownload } from 'react-icons/fa' +import { MdSave, MdFolder, MdFileUpload, MdInsertDriveFile } from 'react-icons/md' +import { FaRegFolderOpen, FaFile } from 'react-icons/fa' import * as Icon from "./icons"; import { Dialog } from './dialog' -import { STLExport, savePart } from './fileExporter' - - -const link = document.createElement('a'); -link.style.display = 'none'; -document.body.appendChild(link); - -function save(blob, filename) { - - link.href = URL.createObjectURL(blob); - link.download = filename; - link.click(); - -} - - -function saveArrayBuffer(buffer, filename) { - - save(new Blob([buffer], { type: 'application/octet-stream' }), filename); - -} +import { STLExport, savePart, saveFile, openFile } from './fileExporter' @@ -39,6 +19,7 @@ export const NavBar = () => { const dispatch = useDispatch() const activeSketchId = useSelector(state => state.treeEntries.activeSketchId) const treeEntriesById = useSelector(state => state.treeEntries.byId) + const fileHandle = useSelector(state => state.ui.fileHandle) const boolOp = (code) => { if (sc.selected.length != 2 || !sc.selected.every(e => e.userData.type == 'mesh')) return @@ -55,6 +36,9 @@ export const NavBar = () => { forceUpdate() } + + + useEffect(() => { // hacky way to handle mounting and unmounting mouse listeners for feature mode if (!activeSketchId) { sc.canvas.addEventListener('pointermove', sc.onHover) @@ -79,6 +63,7 @@ export const NavBar = () => { [Icon.Vertical, () => sc.activeSketch.command('v'), 'Vertical [v]'], [Icon.Horizontal, () => sc.activeSketch.command('h'), 'Horizontal [h]'], [Icon.Tangent, () => sc.activeSketch.command('t'), 'Tangent [t]'], + [Icon.Tangent, () => sc.activeSketch.command('t'), 'Tangent [t]'], ] @@ -91,8 +76,11 @@ export const NavBar = () => { [Icon.Union, () => boolOp('u'), 'Union'], [Icon.Subtract, () => boolOp('s'), 'Subtract'], [Icon.Intersect, () => boolOp('i'), 'Intersect'], - [MdSave, savePart, 'Save [ctrl+s]'], - [FaFolderOpen, () => boolOp('i'), 'Load'], + [MdInsertDriveFile, savePart, 'New [ctrl+n]'], + [MdSave, () => { + saveFile(fileHandle, sc.saveScene(), dispatch) + }, 'Save [ctrl+s]'], + [MdFolder, () => openFile(dispatch), 'Open'], [Icon.Stl, STLExport, 'Export STL'], ] @@ -123,4 +111,26 @@ export const NavBar = () => { -} \ No newline at end of file +} + + +// app.saveFile = async () => { +// try { +// if (!app.file.handle) { +// return await app.saveFileAs(); +// } +// gaEvent('FileAction', 'Save'); +// await writeFile(app.file.handle, app.getText()); +// app.setModified(false); +// } catch (ex) { +// gaEvent('Error', 'FileSave', ex.name); +// const msg = 'Unable to save file'; +// console.error(msg, ex); +// alert(msg); +// } +// app.setFocus(); +// }; + + + + diff --git a/src/react/reducer.js b/src/react/reducer.js index 413a33c..e63c706 100644 --- a/src/react/reducer.js +++ b/src/react/reducer.js @@ -105,7 +105,7 @@ export function treeEntries(state = defaultState, action) { } } -export function ui(state = { dialog: {} }, action) { +export function ui(state = { dialog: {}, filePane: false }, action) { switch (action.type) { case 'set-dialog': @@ -116,6 +116,11 @@ export function ui(state = { dialog: {} }, action) { return update(state, { dialog: { $set: {} }, }) + case 'set-file-handle': + return update(state, { + fileHandle: { $set: action.fileHandle }, + modified: { $set: false }, + }) default: return state } diff --git a/src/react/tree.jsx b/src/react/tree.jsx index 9da94bb..ea2b6c3 100644 --- a/src/react/tree.jsx +++ b/src/react/tree.jsx @@ -1,6 +1,6 @@ -import React, { useReducer, useState } from 'react'; +import React, { useReducer, useState, useRef } from 'react'; import { useDispatch, useSelector } from 'react-redux' import { MdVisibilityOff, MdVisibility, MdDelete, MdRefresh } from 'react-icons/md' @@ -8,8 +8,10 @@ import { FaCube, FaEdit } from 'react-icons/fa' export const Tree = () => { const treeEntries = useSelector(state => state.treeEntries) + const ref = useRef() return
+ {treeEntries.allIds.map((entId, idx) => ( ))} diff --git a/todo.txt b/todo.txt index 3c0d59f..0d84cdd 100644 --- a/todo.txt +++ b/todo.txt @@ -34,17 +34,19 @@ loopfind especially arc, // fixed for single looop, good enough, maybe stretch g dim tag delete //resolved auto update extrude // done extrude edit dialog // done +file save, stl export// done -sometimes unable to hit return and change dimensionk -unable to delete arc hover not clearing sometimes in sketch 0.000 artifact +lighting messed up - -file save, stl export +seperate scene from init logic only init cam and rendere reattach sketch +auto snap highlight button to indicate active mode @@ -53,7 +55,6 @@ highlight button to indicate active mode add cancle soft button for line arc -auto snap constraint labels,equal add download button, different from save button diff --git a/webpack.dev.js b/webpack.dev.js index 55ac5c8..360dc83 100644 --- a/webpack.dev.js +++ b/webpack.dev.js @@ -2,6 +2,7 @@ const { merge } = require('webpack-merge'); const common = require('./webpack.common.js'); const path = require('path'); +const fs = require('fs'); module.exports = merge(common, { @@ -12,5 +13,11 @@ module.exports = merge(common, { contentBase: path.join(__dirname, 'dist'), compress: true, port: 9000, + https: { + key: fs.readFileSync('./localhost-key.pem'), + cert: fs.readFileSync('./localhost.pem'), + ca: fs.readFileSync('/home/howard/.local/share/mkcert/rootCA.pem'), + }, }, + }) \ No newline at end of file