Hi.
I solved my other problem fast. I'm writing a tool with some resemblance to Jonathan Puckey's Delaunay Triangulation tool. Mine creates triangles or polygons by setting the vertices with mouse clicks, then colors them either with random colors or with colors from a sample image.
All is fine, but I need to find the intersections of a path with another shape, and I can't get them. I went back to check the examples in the tutorials, and realized the first intersection example (which may be closer to what I need, since I invoke an intersection test after each mouse down event) DOESN'T WORK! Duh.
The one with the mouse works (it uses mouse drag) and is the one I had checked, but I can't see the difference that makes the first doesn't work.
Here is the code of the example. I don't have my code at hand right now:
// Create two overlapping paths:
var square = new Path.Rectangle(new Point(0, 0), new Size(50, 50));
var circle = new Path.Circle(square.bounds.bottomRight, 25);
// Find the intersection locations between the paths:
var locations = square.getIntersections(circle);
print(locations.length) //Prints "0".
// Loop through the locations (if any):
for(var i = 0; i < locations.length; i++) {
// The position of the intersection:
var point = locations[i].point;
// Create a circle shaped path at the
// position of the intersection:
var path = new Path.Circle(point, 2); //Of course no circles are created.
path.fillColor = 'red';
}
Please, help. :(