remodelled headphone stand

master
howard 2021-04-23 03:54:55 -07:00
parent 0258bb39bd
commit 6db59c5758
25 changed files with 164 additions and 17 deletions

3
.gitignore vendored
View File

@ -1,4 +1,3 @@
node_modules/ node_modules/
dist/*bundle.js* dist/
dist/app.css
stats.json stats.json

View File

@ -1 +0,0 @@
[0,1,1,{"byId":{},"allIds":[],"tree":{},"order":{},"visible":{}}]

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -16,4 +16,4 @@ done
convert $out favicon.ico convert $out favicon.ico
mv favicon.ico icon-192.png icon-512.png ../dist mv favicon.ico icon-192.png icon-512.png ../static

143
package-lock.json generated
View File

@ -9,6 +9,7 @@
"@tailwindcss/jit": "^0.1.18", "@tailwindcss/jit": "^0.1.18",
"babel-loader": "^8.2.2", "babel-loader": "^8.2.2",
"browser-fs-access": "^0.16.4", "browser-fs-access": "^0.16.4",
"copy-webpack-plugin": "^8.1.1",
"css-loader": "^5.1.3", "css-loader": "^5.1.3",
"gh-pages": "^3.1.0", "gh-pages": "^3.1.0",
"immutability-helper": "^3.1.1", "immutability-helper": "^3.1.1",
@ -1935,6 +1936,60 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/copy-webpack-plugin": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-8.1.1.tgz",
"integrity": "sha512-rYM2uzRxrLRpcyPqGceRBDpxxUV8vcDqIKxAUKfcnFpcrPxT5+XvhTxv7XLjo5AvEJFPdAE3zCogG2JVahqgSQ==",
"dev": true,
"dependencies": {
"fast-glob": "^3.2.5",
"glob-parent": "^5.1.1",
"globby": "^11.0.3",
"normalize-path": "^3.0.0",
"p-limit": "^3.1.0",
"schema-utils": "^3.0.0",
"serialize-javascript": "^5.0.1"
},
"engines": {
"node": ">= 10.13.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/webpack"
},
"peerDependencies": {
"webpack": "^5.1.0"
}
},
"node_modules/copy-webpack-plugin/node_modules/array-union": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/copy-webpack-plugin/node_modules/globby": {
"version": "11.0.3",
"resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz",
"integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==",
"dev": true,
"dependencies": {
"array-union": "^2.1.0",
"dir-glob": "^3.0.1",
"fast-glob": "^3.1.1",
"ignore": "^5.1.4",
"merge2": "^1.3.0",
"slash": "^3.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/core-util-is": { "node_modules/core-util-is": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
@ -2316,6 +2371,18 @@
"integrity": "sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=", "integrity": "sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=",
"dev": true "dev": true
}, },
"node_modules/dir-glob": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
"integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
"dev": true,
"dependencies": {
"path-type": "^4.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/dlv": { "node_modules/dlv": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz",
@ -3641,6 +3708,15 @@
"postcss": "^8.1.0" "postcss": "^8.1.0"
} }
}, },
"node_modules/ignore": {
"version": "5.1.8",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz",
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==",
"dev": true,
"engines": {
"node": ">= 4"
}
},
"node_modules/immutability-helper": { "node_modules/immutability-helper": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/immutability-helper/-/immutability-helper-3.1.1.tgz", "resolved": "https://registry.npmjs.org/immutability-helper/-/immutability-helper-3.1.1.tgz",
@ -6470,6 +6546,15 @@
"node": ">= 10" "node": ">= 10"
} }
}, },
"node_modules/slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/snapdragon": { "node_modules/snapdragon": {
"version": "0.8.2", "version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
@ -10065,6 +10150,43 @@
"integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=",
"dev": true "dev": true
}, },
"copy-webpack-plugin": {
"version": "8.1.1",
"resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-8.1.1.tgz",
"integrity": "sha512-rYM2uzRxrLRpcyPqGceRBDpxxUV8vcDqIKxAUKfcnFpcrPxT5+XvhTxv7XLjo5AvEJFPdAE3zCogG2JVahqgSQ==",
"dev": true,
"requires": {
"fast-glob": "^3.2.5",
"glob-parent": "^5.1.1",
"globby": "^11.0.3",
"normalize-path": "^3.0.0",
"p-limit": "^3.1.0",
"schema-utils": "^3.0.0",
"serialize-javascript": "^5.0.1"
},
"dependencies": {
"array-union": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz",
"integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==",
"dev": true
},
"globby": {
"version": "11.0.3",
"resolved": "https://registry.npmjs.org/globby/-/globby-11.0.3.tgz",
"integrity": "sha512-ffdmosjA807y7+lA1NM0jELARVmYul/715xiILEjo3hBLPTcirgQNnXECn5g3mtR8TOLCVbkfua1Hpen25/Xcg==",
"dev": true,
"requires": {
"array-union": "^2.1.0",
"dir-glob": "^3.0.1",
"fast-glob": "^3.1.1",
"ignore": "^5.1.4",
"merge2": "^1.3.0",
"slash": "^3.0.0"
}
}
}
},
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
@ -10357,6 +10479,15 @@
"integrity": "sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=", "integrity": "sha1-6S7f2tplN9SE1zwBcv0eugxJdv8=",
"dev": true "dev": true
}, },
"dir-glob": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz",
"integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==",
"dev": true,
"requires": {
"path-type": "^4.0.0"
}
},
"dlv": { "dlv": {
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz", "resolved": "https://registry.npmjs.org/dlv/-/dlv-1.1.3.tgz",
@ -11426,6 +11557,12 @@
"dev": true, "dev": true,
"requires": {} "requires": {}
}, },
"ignore": {
"version": "5.1.8",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz",
"integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==",
"dev": true
},
"immutability-helper": { "immutability-helper": {
"version": "3.1.1", "version": "3.1.1",
"resolved": "https://registry.npmjs.org/immutability-helper/-/immutability-helper-3.1.1.tgz", "resolved": "https://registry.npmjs.org/immutability-helper/-/immutability-helper-3.1.1.tgz",
@ -13595,6 +13732,12 @@
"totalist": "^1.0.0" "totalist": "^1.0.0"
} }
}, },
"slash": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz",
"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==",
"dev": true
},
"snapdragon": { "snapdragon": {
"version": "0.8.2", "version": "0.8.2",
"resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",

View File

@ -10,6 +10,7 @@
"@tailwindcss/jit": "^0.1.18", "@tailwindcss/jit": "^0.1.18",
"babel-loader": "^8.2.2", "babel-loader": "^8.2.2",
"browser-fs-access": "^0.16.4", "browser-fs-access": "^0.16.4",
"copy-webpack-plugin": "^8.1.1",
"css-loader": "^5.1.3", "css-loader": "^5.1.3",
"gh-pages": "^3.1.0", "gh-pages": "^3.1.0",
"immutability-helper": "^3.1.1", "immutability-helper": "^3.1.1",

View File

@ -296,7 +296,8 @@ export class Scene {
mesh.name = `(${m1.name} ${opChar} ${m2.name})` mesh.name = `(${m1.name} ${opChar} ${m2.name})`
mesh.layers.enable(1) mesh.layers.enable(1)
const vertices = new THREE.Points(mesh.geometry, new THREE.PointsMaterial({ size: 0 })); const vertices = new THREE.Points(mesh.geometry, new THREE.PointsMaterial());
vertices.visible = false
vertices.userData.type = 'point' vertices.userData.type = 'point'
vertices.layers.enable(1) vertices.layers.enable(1)

View File

@ -40,8 +40,6 @@ export const DropDown = () => {
.then(res => res.text()) .then(res => res.text())
.then(text => { .then(text => {
dispatch({ type: 'restore-state', state: sc.loadState(text) }) dispatch({ type: 'restore-state', state: sc.loadState(text) })
fileHandle.name = 'something'
console.log(fileHandle.name)
sc.render() sc.render()
}) })
} }

View File

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

View File

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

View File

@ -1,2 +1,5 @@
this wasm backend is based on the SolveSpace geometric constraint solver: this wasm backend is based on the SolveSpace geometric constraint solver:
https://github.com/solvespace/solvespace https://github.com/solvespace/solvespace
compile command
`emcc ./wasm/solver.c ./wasm/libslvs.a -L./wasm/ -lslvs -o ./static/solver.js -s TOTAL_MEMORY=134217728 -s EXPORTED_FUNCTIONS='[_main, _solver, _free]'`

View File

@ -10,6 +10,7 @@ module.exports = {
output: { output: {
filename: '[name].bundle.js', filename: '[name].bundle.js',
path: path.resolve(__dirname, 'dist'), path: path.resolve(__dirname, 'dist'),
clean: true,
}, },
plugins: [new MiniCssExtractPlugin()], plugins: [new MiniCssExtractPlugin()],
module: { module: {

View File

@ -3,6 +3,7 @@ const { merge } = require('webpack-merge');
const common = require('./webpack.common.js'); const common = require('./webpack.common.js');
const webpack = require('webpack') const webpack = require('webpack')
const TerserPlugin = require("terser-webpack-plugin"); const TerserPlugin = require("terser-webpack-plugin");
const CopyPlugin = require("copy-webpack-plugin");
module.exports = merge(common, { module.exports = merge(common, {
@ -12,7 +13,12 @@ module.exports = merge(common, {
'process.env.NODE_ENV': JSON.stringify('production') 'process.env.NODE_ENV': JSON.stringify('production')
// 'process.env.NODE_ENV': 'production' // 'process.env.NODE_ENV': 'production'
}), }),
new webpack.IgnorePlugin(/redux-logger/) new webpack.IgnorePlugin(/redux-logger/),
new CopyPlugin({
patterns: [
{ from: "static", to: "" },
],
}),
], ],
optimization: { optimization: {
minimize: true, minimize: true,