mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +01:00
multi solve
This commit is contained in:
parent
cf891ba43e
commit
57f9fcdf9b
2 changed files with 5 additions and 5 deletions
|
|
@ -175,7 +175,7 @@ public class App2DCtrl implements Initializable {
|
|||
};
|
||||
|
||||
|
||||
List<Constraint> constrs = Arrays.<Constraint>asList(parallel);
|
||||
List<Constraint> constrs = Arrays.<Constraint>asList(p2l2, parallel, perpendicular, p2l1);
|
||||
// List<Constraint> constrs = Arrays.<Constraint>asList(p2l1);
|
||||
Solver.SubSystem subSystem = new Solver.SubSystem(constrs);
|
||||
// Solver.optimize(subSystem);
|
||||
|
|
@ -186,8 +186,8 @@ public class App2DCtrl implements Initializable {
|
|||
globalSolve(subSystem, () -> Platform.runLater(update));
|
||||
if (true) return;
|
||||
while (subSystem.error() > 0.0001) {
|
||||
Solver.solve_LM(subSystem);
|
||||
// solveLM_COMMONS(subSystem);
|
||||
// Solver.solve_LM(subSystem);
|
||||
solveLM_COMMONS(subSystem);
|
||||
// Solver.solve_DL(subSystem);
|
||||
// Solver.solve_BFGS(subSystem, true);
|
||||
Platform.runLater(update);
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public class P2LDistance implements Constraint {
|
|||
|
||||
}
|
||||
|
||||
public void gradient(double[] out) {
|
||||
public void gradient2(double[] out) {
|
||||
double x0 = p0x(), x1 = p1x(), x2 = p2x();
|
||||
double y0 = p0y(), y1 = p1y(), y2 = p2y();
|
||||
double dx = x2 - x1;
|
||||
|
|
@ -157,7 +157,7 @@ public class P2LDistance implements Constraint {
|
|||
return a*a;
|
||||
}
|
||||
|
||||
public void gradient2(double[] out) {
|
||||
public void gradient(double[] out) {
|
||||
double x0 = p0x(), x1 = p1x(), x2 = p2x();
|
||||
double y0 = p0y(), y1 = p1y(), y2 = p2y();
|
||||
double dx = x2 - x1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue