mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-14 20:33:30 +01:00
split up solving
This commit is contained in:
parent
86be093faf
commit
7ebfcd008e
2 changed files with 10 additions and 3 deletions
|
|
@ -693,6 +693,7 @@ TCAD.TWO.DragTool.prototype.mousewheel = function(e) {
|
|||
|
||||
TCAD.TWO.DragTool.prototype.solveRequest = function(fineLevel) {
|
||||
this.solver.solve(fineLevel);
|
||||
this.solver.sync();
|
||||
};
|
||||
|
||||
TCAD.TWO.DragTool.prototype.prepareSolver = function() {
|
||||
|
|
|
|||
|
|
@ -227,7 +227,9 @@ TCAD.TWO.ParametricManager.prototype.solve1 = function(locked, onSolved) {
|
|||
};
|
||||
|
||||
TCAD.TWO.ParametricManager.prototype.solve = function(locked, fineLevel, alg) {
|
||||
this.prepare(locked, alg).solve(fineLevel);
|
||||
var solver = this.prepare(locked, alg);
|
||||
solver.solve(fineLevel);
|
||||
solver.sync()
|
||||
};
|
||||
|
||||
TCAD.TWO.ParametricManager.prototype.prepare = function(locked, alg) {
|
||||
|
|
@ -291,12 +293,14 @@ TCAD.TWO.ParametricManager.prototype.prepare = function(locked, alg) {
|
|||
_p.set(_p._backingParam.get());
|
||||
}
|
||||
solver.solveSystem(fineLevel);
|
||||
}
|
||||
|
||||
function sync() {
|
||||
for (p in pdict) {
|
||||
_p = pdict[p];
|
||||
_p._backingParam.set(_p.get());
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Make sure all equal constraints are equal
|
||||
for (i = 0; i < equals.length; ++i) {
|
||||
var ec = equals[i];
|
||||
|
|
@ -312,7 +316,9 @@ TCAD.TWO.ParametricManager.prototype.prepare = function(locked, alg) {
|
|||
slave.set( master.get() );
|
||||
}
|
||||
}
|
||||
|
||||
solver.solve = solve;
|
||||
solver.sync = sync;
|
||||
return solver;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue