diff --git a/web/app/sketcher/fetchers.js b/web/app/sketcher/fetchers.js index 9525163e..1f534368 100644 --- a/web/app/sketcher/fetchers.js +++ b/web/app/sketcher/fetchers.js @@ -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; diff --git a/web/app/sketcher/parametric.js b/web/app/sketcher/parametric.js index 8e6c6b18..db7788c2 100644 --- a/web/app/sketcher/parametric.js +++ b/web/app/sketcher/parametric.js @@ -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) {