mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-24 09:26:43 +01:00
bulk adding for the parallel constraint
This commit is contained in:
parent
c7b0a12958
commit
cf117a2aea
2 changed files with 10 additions and 2 deletions
|
|
@ -84,6 +84,10 @@ export function line(objs) {
|
|||
throw "Illegal Argument. Constraint requires a line."
|
||||
}
|
||||
|
||||
export function lines(objs) {
|
||||
return objs.filter(o => o._class == 'TCAD.TWO.Segment')
|
||||
}
|
||||
|
||||
export function arcCircAndLine(objs) {
|
||||
|
||||
var arc = null;
|
||||
|
|
|
|||
|
|
@ -207,8 +207,12 @@ ParametricManager.prototype.horizontal = function(objs) {
|
|||
};
|
||||
|
||||
ParametricManager.prototype.parallel = function(objs) {
|
||||
var lines = fetch.twoLines(objs);
|
||||
this.add(new Constraints.Parallel(lines[0], lines[1]));
|
||||
const lines = fetch.lines(objs);
|
||||
const constraints = [];
|
||||
for (let i = 1; i < lines.length; i++) {
|
||||
constraints.push(new Constraints.Parallel(lines[i - 1], lines[i]));
|
||||
}
|
||||
this.addAll(constraints);
|
||||
};
|
||||
|
||||
ParametricManager.prototype.perpendicular = function(objs) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue