fix coincident setup

This commit is contained in:
Val Erastov 2014-10-14 21:43:07 -07:00
parent b8bbb70f0a
commit 3034199d8c

View file

@ -107,17 +107,21 @@ TCAD.TWO.ParametricManager.prototype.radius = function(objs, promptCallback) {
TCAD.TWO.ParametricManager.prototype.coincident = function(objs) {
if (objs.length == 0) return;
var i;
var last = objs.length - 1;
for (var i = 0; i < objs.length - 1; ++i) {
for (i = 0; i < objs.length - 1; ++i) {
objs[i].x = objs[last].x;
objs[i].y = objs[last].y;
this.system.push(new TCAD.TWO.Constraints.Equal(objs[i]._x, objs[last]._x));
this.system.push(new TCAD.TWO.Constraints.Equal(objs[i]._y, objs[last]._y));
}
for (i = 0; i < objs.length; ++i) {
for (var j = 0; j < objs.length; ++j) {
if (objs[i].id !== objs[j].id) {
objs[j].linked.push(objs[i]);
}
}
this.system.push(new TCAD.TWO.Constraints.Equal(objs[i]._x, objs[last]._x));
this.system.push(new TCAD.TWO.Constraints.Equal(objs[i]._y, objs[last]._y));
}
this.solve();