mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-24 01:15:25 +01:00
update webpack and babel
This commit is contained in:
parent
611d85d903
commit
a4b9a96ac0
11 changed files with 3173 additions and 1996 deletions
7
.babelrc
7
.babelrc
|
|
@ -1,4 +1,7 @@
|
|||
{
|
||||
"presets": ["es2015", "stage-2", "react", "flow"],
|
||||
"plugins": ["transform-decorators-legacy"]
|
||||
"presets": ["@babel/env", "@babel/react", "@babel/flow"],
|
||||
"plugins": [
|
||||
"@babel/proposal-class-properties",
|
||||
["@babel/plugin-proposal-decorators", { "legacy": true }]
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import {CombineStream} from './combine';
|
||||
import {StateStream} from './state';
|
||||
import {Emitter} from './emitter';
|
||||
import {FilterStream, MapStream} from './base';
|
||||
import {ExternalStateStream} from './external';
|
||||
import {MergeStream} from './merge';
|
||||
import {NeverStream} from './never';
|
||||
import {ConstantStream} from './constant';
|
||||
import {MapStream} from './map';
|
||||
import {FilterStream} from './filter';
|
||||
|
||||
export function stream() {
|
||||
return new Emitter();
|
||||
|
|
|
|||
5083
package-lock.json
generated
5083
package-lock.json
generated
File diff suppressed because it is too large
Load diff
31
package.json
31
package.json
|
|
@ -24,16 +24,18 @@
|
|||
},
|
||||
"homepage": "https://github.com/xibyte/jsketcher",
|
||||
"devDependencies": {
|
||||
"babel-cli": "6.26.0",
|
||||
"babel-core": "6.26.0",
|
||||
"babel-eslint": "8.0.2",
|
||||
"babel-loader": "7.1.2",
|
||||
"babel-plugin-transform-decorators-legacy": "1.3.5",
|
||||
"babel-polyfill": "6.26.0",
|
||||
"babel-preset-es2015": "6.24.1",
|
||||
"babel-preset-flow": "6.23.0",
|
||||
"babel-preset-react": "6.24.1",
|
||||
"babel-preset-stage-2": "6.24.1",
|
||||
"@babel/cli": "^7.0.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.1.0",
|
||||
"@babel/plugin-proposal-decorators": "^7.1.6",
|
||||
"@babel/preset-env": "^7.0.0",
|
||||
"@babel/preset-flow": "^7.0.0",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@babel/preset-stage-2": "^7.0.0",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-loader": "^8.0.4",
|
||||
"babel-plugin-transform-decorators-legacy": "^1.3.5",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"css-loader": "0.28.7",
|
||||
"eslint": "4.13.1",
|
||||
"eslint-plugin-babel": "4.1.2",
|
||||
|
|
@ -41,10 +43,11 @@
|
|||
"eslint-plugin-react": "7.5.1",
|
||||
"grunt": "^1.0.3",
|
||||
"grunt-contrib-copy": "1.0.0",
|
||||
"less-loader": "4.0.5",
|
||||
"less-loader": "^4.1.0",
|
||||
"style-loader": "0.13.1",
|
||||
"webpack": "3.10.0",
|
||||
"webpack-dev-server": "2.9.7"
|
||||
"webpack": "^4.26.1",
|
||||
"webpack-cli": "^3.1.2",
|
||||
"webpack-dev-server": "^3.1.10"
|
||||
},
|
||||
"dependencies": {
|
||||
"classnames": "2.2.5",
|
||||
|
|
@ -55,7 +58,7 @@
|
|||
"handlebars-loader": "1.6.0",
|
||||
"jquery": "^3.3.1",
|
||||
"json-loader": "0.5.4 ",
|
||||
"less": "^3.0.4",
|
||||
"less": "^3.8.1",
|
||||
"libtess": "1.2.2",
|
||||
"mousetrap": "1.6.1",
|
||||
"numeric": "1.2.6",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import {checkForSelectedFaces} from './actions/actionHelpers';
|
||||
import {surfaceToThreeGeom, triangulateToThree} from './scene/wrappers/brepSceneObject';
|
||||
import {brepFaceToGeom, surfaceToThreeGeom} from './scene/wrappers/brepSceneObject';
|
||||
import {createSolidMaterial} from './scene/wrappers/sceneObject';
|
||||
import DPR from 'dpr';
|
||||
import Vector from 'math/vector';
|
||||
|
|
@ -112,6 +112,7 @@ function addGlobalDebugActions({viewer, cadScene, cadRegistry}) {
|
|||
AddVolume: (shell, color) => {
|
||||
color = color || 0xffffff;
|
||||
const geometry = new THREE.Geometry();
|
||||
shell.faces.forEach(f => brepFaceToGeom(f, geometry));
|
||||
triangulateToThree(shell, geometry);
|
||||
const mesh = new THREE.Mesh(geometry, createSolidMaterial({
|
||||
color,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import * as BREPPrimitives from '../brep/brep-primitives'
|
|||
import BrepCurve from '../brep/geom/curves/brepCurve';
|
||||
import NurbsCurve from "../brep/geom/curves/nurbsCurve";
|
||||
import {surfaceIntersect} from '../brep/geom/intersection/surfaceSurface';
|
||||
import {closestToCurveParam, findClosestToCurveParamRoughly} from '../brep/geom/curves/closestPoint';
|
||||
import {closestToCurveParam} from '../brep/geom/curves/closestPoint';
|
||||
import NurbsSurface from '../brep/geom/surfaces/nurbsSurface';
|
||||
import DatumObject3D from './craft/datum/datumObject';
|
||||
import CSys from '../math/csys';
|
||||
|
|
@ -224,15 +224,15 @@ export function runSandbox({bus, services, services: { viewer, cadScene, cadRegi
|
|||
let curve = new BrepCurve(ic);
|
||||
let pt = [-50, 220, 0];
|
||||
__DEBUG__.AddPoint3(pt, 0x0000ff);
|
||||
let u = findClosestToCurveParamRoughly(curve.impl.approx, pt);
|
||||
let exactU = closestToCurveParam(curve.impl.approx, pt);
|
||||
|
||||
let clPt = curve.impl.approx.point(u);
|
||||
let exactPt = curve.impl.approx.point(exactU);
|
||||
__DEBUG__.AddPoint3(clPt, 0xffff00);
|
||||
__DEBUG__.AddPoint3(exactPt, 0xff0000);
|
||||
// let u = findClosestToCurveParamRoughly(curve.impl.approx, pt);
|
||||
// let exactU = closestToCurveParam(curve.impl.approx, pt);
|
||||
//
|
||||
// let clPt = curve.impl.approx.point(u);
|
||||
// let exactPt = curve.impl.approx.point(exactU);
|
||||
// __DEBUG__.AddPoint3(clPt, 0xffff00);
|
||||
// __DEBUG__.AddPoint3(exactPt, 0xff0000);
|
||||
// console.dir(curve);
|
||||
__DEBUG__.HideSolids();
|
||||
// __DEBUG__.HideSolids();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,13 +8,15 @@ import {getAttribute} from '../../../../../modules/scene/objectData';
|
|||
//todo: rename to shell
|
||||
export class SceneSolid {
|
||||
|
||||
ID = 0;
|
||||
|
||||
constructor(type, id, skin) {
|
||||
this.tCadType = type || 'SHELL';
|
||||
|
||||
this.cadGroup = new THREE.Object3D();
|
||||
setAttribute(this.cadGroup, 'shell', this);
|
||||
|
||||
this.tCadId = genSolidId();
|
||||
this.tCadId = SceneSolid.ID++;
|
||||
this.id = id === undefined ? this.tCadId : id; // to keep identity through the history
|
||||
this.faceCounter = 0;
|
||||
this.edgeCounter = 0;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import {createPrism} from '../../brep/brep-enclose'
|
|||
import * as BREPBool from '../../brep/operations/boolean'
|
||||
import * as IO from '../../brep/io/brepLoopsFormat'
|
||||
import {BREPValidator} from '../../brep/brep-validator'
|
||||
import {HalfEdge, Edge} from '../../brep/topo/edge';
|
||||
import {Edge} from '../../brep/topo/edge';
|
||||
import {Loop} from '../../brep/topo/loop';
|
||||
import {Face} from '../../brep/topo/face';
|
||||
import {Shell} from '../../brep/topo/shell';
|
||||
|
|
@ -29,7 +29,7 @@ export default {
|
|||
Point, BrepCurve, Plane, createBoundingSurface
|
||||
},
|
||||
topo: {
|
||||
HalfEdge, Edge, Loop, Face, Shell, Vertex
|
||||
Edge, Loop, Face, Shell, Vertex
|
||||
},
|
||||
IO,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -139,6 +139,8 @@ export function create(dim) {
|
|||
return out;
|
||||
}
|
||||
|
||||
export {create as newVector};
|
||||
|
||||
const sq = v => v * v;
|
||||
|
||||
export function distanceSq(v1, v2) {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import QR from '../../math/qr'
|
|||
import LMOptimizer from '../../math/lm'
|
||||
import {ConstantWrapper, EqualsTo} from './constraints'
|
||||
import {dog_leg} from '../../math/optim'
|
||||
import {newVector} from '../../math/vec';
|
||||
|
||||
/** @constructor */
|
||||
function Param(id, value, readOnly) {
|
||||
|
|
@ -291,7 +292,7 @@ var prepare = function(constrs, locked) {
|
|||
};
|
||||
|
||||
var solve_lm = function(sys, model, jacobian, rough) {
|
||||
var opt = new LMOptimizer(sys.getParams(), math.vec(sys.constraints.length), model, jacobian);
|
||||
var opt = new LMOptimizer(sys.getParams(), newVector(sys.constraints.length), model, jacobian);
|
||||
opt.evalMaximalCount = 100 * sys.params.length;
|
||||
var eps = rough ? 0.001 : 0.00000001;
|
||||
opt.init0(eps, eps, eps);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ const INTEGRATION_TESTS = path.join(__dirname, 'web/test');
|
|||
const GLOBAL_CSS = path.join(__dirname, 'web/css');
|
||||
|
||||
module.exports = {
|
||||
mode: 'development',
|
||||
devtool: 'source-map',
|
||||
entry: {
|
||||
index: ['babel-polyfill', './web/app/index'],
|
||||
|
|
@ -72,5 +73,15 @@ module.exports = {
|
|||
devServer: {
|
||||
hot: false,
|
||||
inline: false,
|
||||
before: function(app) {
|
||||
app.get('*.wasm', function(req, res) {
|
||||
res.sendFile(req.url, {
|
||||
root: path.join(__dirname, 'web'),
|
||||
headers: {
|
||||
'Content-Type': 'application/wasm'
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue