I'm interested in modifying bubble bubbling to generate non-overlapping objects and I'm having difficulty with the HitTest - I haven't been able to find a script yet that uses this and the documentation is a bit sparse.
Any example would be great.
I'm interested in modifying bubble bubbling to generate non-overlapping objects and I'm having difficulty with the HitTest - I haven't been able to find a script yet that uses this and the documentation is a bit sparse.
Any example would be great.
Hi
Here is an example.
function onMouseDrag(event) {
var radius = Math.random() * 10 + 10;
var ht = activeDocument.hitTest(event.point, HitTest.TEST_PATHS, radius);
if(ht == null){
activeDocument.createCircle(event.point, radius);
} else {
// Dialog.alert(ht); // shows its elements
// var target = ht.getArt(); // gets the path which hit
}
}
As far as I know
1. Tolerance unit is pixel. it depends on the current zoom factor.
2. Tested area is a rectangle. not a circle.
Path.hitTest() has an argument called "epsilon". I don't know what it is.
> Ken
It's my page! Thanks. But it dosn't use hitTest function.