howard 2021-04-23 03:56:23 -07:00
parent 975ce83234
commit c2a9e4a543
18 changed files with 6 additions and 32597 deletions

View File

@ -1 +0,0 @@
(self.webpackChunk=self.webpackChunk||[]).push([[102],{102:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>r});const r=async(e={})=>(e.recursive=e.recursive||!1,new Promise(((n,t)=>{const r=document.createElement("input");r.type="file",r.webkitdirectory=!0;const i=()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerdown",i),window.removeEventListener("keydown",i),t(new DOMException("The user aborted a request.","AbortError"))};window.addEventListener("pointermove",i),window.addEventListener("pointerdown",i),window.addEventListener("keydown",i),r.addEventListener("change",(()=>{window.removeEventListener("pointermove",i),window.removeEventListener("pointerdown",i),window.removeEventListener("keydown",i);let t=Array.from(r.files);e.recursive||(t=t.filter((e=>2===e.webkitRelativePath.split("/").length))),n(t)})),r.click()})))}}]);

View File

@ -1 +0,0 @@
(self.webpackChunk=self.webpackChunk||[]).push([[112],{112:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>n});const i=async e=>{const s=await e.getFile();return s.handle=e,s},n=async(e={})=>{const s={};e.mimeTypes?e.mimeTypes.map((t=>{s[t]=e.extensions||[]})):s["*/*"]=e.extensions||[];const t=await window.showOpenFilePicker({types:[{description:e.description||"",accept:s}],multiple:e.multiple||!1}),n=await Promise.all(t.map(i));return e.multiple?n:n[0]}}}]);

View File

@ -1 +0,0 @@
(self.webpackChunk=self.webpackChunk||[]).push([[146],{146:(e,t,c)=>{"use strict";c.r(t),c.d(t,{default:()=>n});const n=async(e,t={})=>{const c=document.createElement("a");c.download=t.fileName||"Untitled",c.href=URL.createObjectURL(e),c.addEventListener("click",(()=>{setTimeout((()=>URL.revokeObjectURL(c.href)),3e4)})),c.click()}}}]);

View File

@ -1 +0,0 @@
(self.webpackChunk=self.webpackChunk||[]).push([[229],{229:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>s});const s=async(e,t={},i=null)=>{t.fileName=t.fileName||"Untitled",i=i||await window.chooseFileSystemEntries({type:"save-file",accepts:[{description:t.description||"",mimeTypes:[e.type],extensions:t.extensions||[""]}]});const s=await i.createWritable();return await s.write(e),await s.close(),i}}}]);

View File

@ -1 +0,0 @@
(self.webpackChunk=self.webpackChunk||[]).push([[583],{583:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});const s=async(e,t,r=e.name)=>{const i=[],a=[];for await(const n of e.getEntries()){const e=`${r}/${n.name}`;n.isFile?a.push(n.getFile().then((t=>Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>e})))):n.isDirectory&&t&&i.push(s(n,t,e))}return[...(await Promise.all(i)).flat(),...await Promise.all(a)]},i=async(e={})=>{e.recursive=e.recursive||!1;const t=await window.chooseFileSystemEntries({type:"open-directory"});return s(t,e.recursive)}}}]);

View File

@ -1 +0,0 @@
(self.webpackChunk=self.webpackChunk||[]).push([[6],{6:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});const a=async(e,t,r=e.name)=>{const i=[],s=[];for await(const n of e.values()){const e=`${r}/${n.name}`;"file"===n.kind?s.push(n.getFile().then((t=>Object.defineProperty(t,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>e})))):"directory"===n.kind&&t&&i.push(a(n,t,e))}return[...(await Promise.all(i)).flat(),...await Promise.all(s)]},i=async(e={})=>{e.recursive=e.recursive||!1;const t=await window.showDirectoryPicker();return a(t,e.recursive)}}}]);

View File

@ -1 +0,0 @@
(self.webpackChunk=self.webpackChunk||[]).push([[635],{635:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>a});const a=async(e,t={},i=null,a=!1)=>{t.fileName=t.fileName||"Untitled",console.log(t.fileName,"ddddddddddd");const s={};if(t.mimeTypes?(t.mimeTypes.push(e.type),t.mimeTypes.map((e=>{s[e]=t.extensions||[]}))):s[e.type]=t.extensions||[],i)try{await i.getFile()}catch(e){if(i=null,a)throw e}const d=i||await window.showSaveFilePicker({suggestedName:t.fileName,types:[{description:t.description||"",accept:s}]}),l=await d.createWritable();return await l.write(e),await l.close(),d}}}]);

View File

@ -1 +0,0 @@
(self.webpackChunk=self.webpackChunk||[]).push([[751],{751:(e,n,t)=>{"use strict";t.r(n),t.d(n,{default:()=>o});const o=async(e={})=>new Promise(((n,t)=>{const o=document.createElement("input");o.type="file";const i=[...e.mimeTypes?e.mimeTypes:[],e.extensions?e.extensions:[]].join();o.multiple=e.multiple||!1,o.accept=i||"";const r=()=>{window.removeEventListener("pointermove",r),window.removeEventListener("pointerdown",r),window.removeEventListener("keydown",r),t(new DOMException("The user aborted a request.","AbortError"))};window.addEventListener("pointermove",r),window.addEventListener("pointerdown",r),window.addEventListener("keydown",r),o.addEventListener("change",(()=>{window.removeEventListener("pointermove",r),window.removeEventListener("pointerdown",r),window.removeEventListener("keydown",r),n(o.multiple?o.files:o.files[0])})),o.click()}))}}]);

View File

@ -1 +0,0 @@
(self.webpackChunk=self.webpackChunk||[]).push([[799],{799:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>n});const i=async e=>{const s=await e.getFile();return s.handle=e,s},n=async(e={})=>{const s=await window.chooseFileSystemEntries({accepts:[{description:e.description||"",mimeTypes:e.mimeTypes||["*/*"],extensions:e.extensions||[""]}],multiple:e.multiple||!1});return e.multiple?Promise.all(s.map(i)):i(s)}}}]);

File diff suppressed because one or more lines are too long

29930
bundle.js

File diff suppressed because one or more lines are too long

View File

@ -1,148 +0,0 @@
/**
* 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<FileSystemFileHandle>} 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<FileSystemFileHandle>} 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<string>} 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<string>} 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;
}

File diff suppressed because one or more lines are too long

View File

@ -1,41 +0,0 @@
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
/** @license React v0.20.2
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/** @license React v17.0.2
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

View File

@ -6,15 +6,15 @@
<link rel="icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta property="og:title" content="CAD Tool" />
<meta property="og:description" content="Three.js CAD tool" />
<meta property="og:title" content="three.cad" />
<meta property="og:description" content="CAD in the browser" />
<meta property="og:url" content="" />
<meta property="og:image" content="" />
<link rel="apple-touch-icon" href="icon-192.png" />
<link rel="manifest" href="manifest.json" />
<!-- app.css references the css imported into app.jsx -->
<link rel="stylesheet" href="app.css">
<title>CAD Tool</title>
<title>three.cad</title>
</head>
<body>
@ -25,7 +25,6 @@
<script src="app.bundle.js"></script>
<script src="scene.bundle.js"></script>
<script src="solver.js"></script>
<script src="fs-helpers.js"></script>
</body>
</html>

1
lz-string.min.js vendored
View File

@ -1 +0,0 @@
var LZString=function(){function o(o,r){if(!t[o]){t[o]={};for(var n=0;n<o.length;n++)t[o][o.charAt(n)]=n}return t[o][r]}var r=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",t={},i={compressToBase64:function(o){if(null==o)return"";var r=i._compress(o,6,function(o){return n.charAt(o)});switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(r){return null==r?"":""==r?null:i._decompress(r.length,32,function(e){return o(n,r.charAt(e))})},compressToUTF16:function(o){return null==o?"":i._compress(o,15,function(o){return r(o+32)})+" "},decompressFromUTF16:function(o){return null==o?"":""==o?null:i._decompress(o.length,16384,function(r){return o.charCodeAt(r)-32})},compressToUint8Array:function(o){for(var r=i.compress(o),n=new Uint8Array(2*r.length),e=0,t=r.length;t>e;e++){var s=r.charCodeAt(e);n[2*e]=s>>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null===o||void 0===o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;t>e;e++)n[e]=256*o[2*e]+o[2*e+1];var s=[];return n.forEach(function(o){s.push(r(o))}),i.decompress(s.join(""))},compressToEncodedURIComponent:function(o){return null==o?"":i._compress(o,6,function(o){return e.charAt(o)})},decompressFromEncodedURIComponent:function(r){return null==r?"":""==r?null:(r=r.replace(/ /g,"+"),i._decompress(r.length,32,function(n){return o(e,r.charAt(n))}))},compress:function(o){return i._compress(o,16,function(o){return r(o)})},_compress:function(o,r,n){if(null==o)return"";var e,t,i,s={},p={},u="",c="",a="",l=2,f=3,h=2,d=[],m=0,v=0;for(i=0;i<o.length;i+=1)if(u=o.charAt(i),Object.prototype.hasOwnProperty.call(s,u)||(s[u]=f++,p[u]=!0),c=a+u,Object.prototype.hasOwnProperty.call(s,c))a=c;else{if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++),s[c]=f++,a=String(u)}if(""!==a){if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(n(m));break}v++}return d.join("")},decompress:function(o){return null==o?"":""==o?null:i._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(o,n,e){var t,i,s,p,u,c,a,l,f=[],h=4,d=4,m=3,v="",w=[],A={val:e(0),position:n,index:1};for(i=0;3>i;i+=1)f[i]=i;for(p=0,c=Math.pow(2,2),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(t=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 2:return""}for(f[3]=l,s=l,w.push(l);;){if(A.index>o)return"";for(p=0,c=Math.pow(2,m),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(l=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 2:return w.join("")}if(0==h&&(h=Math.pow(2,m),m++),f[l])v=f[l];else{if(l!==d)return null;v=s+s.charAt(0)}w.push(v),f[d++]=s+v.charAt(0),h--,s=v,0==h&&(h=Math.pow(2,m),m++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module&&(module.exports=LZString);

File diff suppressed because one or more lines are too long

2461
solver.js

File diff suppressed because one or more lines are too long