i see what you mean. tried that one out.
i do get weird results aswell.
the value in line 13 (100000) seems to be wrong on win (or gets calculated wrong...)
it works on mac, but on win the distance between the stitches is far to long.
to lower it doesnt really help. (values around 20000 seem to make it a little better)
var objects = getMatching({type: "path", selected: true});
if (objects != null) {
values = prompt("Stich:",
{type: "number", value: 1, title: "distance", width: 50},
{type: "number", value: 10, title: "size", width: 50}
);
if (values != null) {
var dist = values[0];
var size = values[1];
for (var j = 0; j < objects.length; j++) {
var obj = objects[j];
obj = obj.clone();
obj.curvesToPoints(dist, 100000);
var count = obj.beziers.length;
var mul = 1;
var res = new Art("path");
for (var i = 0; i < count; i++) {
var bezier = obj.beziers[i];
var pt = bezier.getPoint(0);
var n = bezier.getNormal(0);
if (n.x != 0 && n.y != 0) {
res.segments.push(pt.add(n.normalize(size).mul(mul)));
mul *= -1;
}
pos += dist;
}
print(obj.beziers[count-1].getNormal(0));
obj.remove();
}
}
}
trying with different values gives me those kind of console-outputs.
// [0.420898, 0.169922]
// [4.27637, 13.5527]
// [4.27637, 13.5527]
// [4.27637, 13.5527]
// [0.420898, 0.169922]
// [0.420898, 0.169922]
// [0.420898, 0.169922]
// [9.36035, 5.46777]
// [-1.7251, 5.69336]
i don't know how to fix it, sorry...
and btw. the other scripts in the general tab work well for me. only sew doesn't.
try to use those on a quite complex path, so you can see their beauty :)