mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Activate code that handles self-intersection directly now.
Relates to #765, #761
This commit is contained in:
parent
abf70378fe
commit
78e0bae6aa
1 changed files with 10 additions and 8 deletions
|
@ -76,20 +76,22 @@ PathItem.inject(new function() {
|
||||||
_path2.reverse();
|
_path2.reverse();
|
||||||
// Split curves at intersections on both paths. Note that for self
|
// Split curves at intersections on both paths. Note that for self
|
||||||
// intersection, _path2 will be null and getIntersections() handles it.
|
// intersection, _path2 will be null and getIntersections() handles it.
|
||||||
splitPath(Curve._filterIntersections(
|
|
||||||
_path1._getIntersections(_path2, null, []), true));
|
// Without support for self-intersection
|
||||||
/*
|
// splitPath(Curve._filterIntersections(
|
||||||
console.time('inter');
|
// _path1._getIntersections(_path2, null, []), true));
|
||||||
|
|
||||||
|
// console.time('inter');
|
||||||
var locations = _path1._getIntersections(_path2, null, []);
|
var locations = _path1._getIntersections(_path2, null, []);
|
||||||
console.timeEnd('inter');
|
// console.timeEnd('inter');
|
||||||
if (_path2 && false) {
|
if (_path2 && false) {
|
||||||
console.time('self');
|
// console.time('self');
|
||||||
_path1._getIntersections(null, null, locations);
|
_path1._getIntersections(null, null, locations);
|
||||||
_path2._getIntersections(null, null, locations);
|
_path2._getIntersections(null, null, locations);
|
||||||
console.timeEnd('self');
|
// console.timeEnd('self');
|
||||||
}
|
}
|
||||||
splitPath(Curve._filterIntersections(locations, true));
|
splitPath(Curve._filterIntersections(locations, true));
|
||||||
*/
|
|
||||||
var chain = [],
|
var chain = [],
|
||||||
segments = [],
|
segments = [],
|
||||||
// Aggregate of all curves in both operands, monotonic in y
|
// Aggregate of all curves in both operands, monotonic in y
|
||||||
|
|
Loading…
Reference in a new issue