Commit graph

2773 commits

Author SHA1 Message Date
Jürg Lehni
26b3beed5c Implement static Line.intersect() and use it to speed up Curve.getIntersections()
Unfortunately doesn't seem to have any impact!
2013-05-04 10:22:10 -07:00
Jürg Lehni
86a26db2a2 Use variable names that better reflec functionality and original naming. 2013-05-04 09:58:46 -07:00
Jürg Lehni
f58f58e406 Some more minor tweaks. 2013-05-04 03:38:19 -07:00
Jürg Lehni
023f768817 Further clean up.
Instead of removing temporary data structure, clone Segment.
2013-05-04 03:33:44 -07:00
Jürg Lehni
cb66f6f2e2 Improve comments. 2013-05-04 03:20:53 -07:00
Jürg Lehni
cbde2ea526 Fix accidental variable leakage. 2013-05-04 03:13:57 -07:00
Jürg Lehni
b5abfcb515 One last optimization in computeBoolean(). 2013-05-04 03:08:43 -07:00
Jürg Lehni
3ee10c1765 more optimizations in computeBoolean().
I think this is done now!
2013-05-04 03:00:31 -07:00
Jürg Lehni
9fb7340aac Remove need for __segment property and further simplify computeBoolean() code. 2013-05-04 02:50:18 -07:00
Jürg Lehni
43b7afb961 Merge loops in reorientPath(). 2013-05-03 23:25:26 -07:00
Jürg Lehni
aab41752b4 Minor cleanup. 2013-05-03 23:08:00 -07:00
Jürg Lehni
737c2c36fe More computeBoolean() optimizations and clean up. 2013-05-03 23:03:00 -07:00
Jürg Lehni
55c799dc2c Clean up computeBoolean().
Work in progress.
2013-05-03 22:38:29 -07:00
Jürg Lehni
f15deec334 Clean up reorientCompoundPath(). 2013-05-03 22:09:56 -07:00
Jürg Lehni
d5543842e9 Define CompoundPath#reverse() and #clockwise, and replace reversePath() with it. 2013-05-03 21:41:22 -07:00
Jürg Lehni
3515574f65 Move fix for faulty _curves list after calls to Path#reverse() to the right place. 2013-05-03 21:33:17 -07:00
Jürg Lehni
81b4136775 Improve testOnCurve() code. 2013-05-03 21:24:02 -07:00
Jürg Lehni
98efa2f66b Move private functions into private injection scope. 2013-05-03 21:21:53 -07:00
Jürg Lehni
d268c68ae5 Remove names from boolean operator functions and use parameter instead. 2013-05-03 21:16:36 -07:00
Jürg Lehni
9a4c8bde19 Rewrite PathItem#_splitPath() to use Curve#divide().
Leading to faster code, due to less loop passes.
2013-05-03 21:05:44 -07:00
Jürg Lehni
7e6519349a Clean up Curve#divide() code. 2013-05-03 21:00:46 -07:00
Jürg Lehni
5f0feeb31f Adjust precision of Curve#isFlatEnough() to cover rare edge cases. 2013-05-03 21:00:37 -07:00
Jürg Lehni
b07e52d361 More work on PathItem#__splitPath() 2013-05-03 18:52:03 -07:00
Jürg Lehni
f054f4a7e0 Allow better code compression by reducing property lookup. 2013-05-03 17:38:15 -07:00
Jürg Lehni
8f7de47bb9 Clean up and simplify PathItem#_splitPath() code.
- Follow Paper.js variable scoping conventions (pretend we have Java-style variable scopes for better readability of code)
- Break lines at 80 chars
- Merge some duplicate code in segment handling.
2013-05-03 17:30:59 -07:00
Jürg Lehni
410ceb8ff1 Simplify PathItem#exclude() and #divide() 2013-05-03 16:56:00 -07:00
Jürg Lehni
1d55372ed4 Revert return strategy of boolean operators for simpler code, simplify operator logic and inline functions. 2013-05-03 16:52:37 -07:00
Jürg Lehni
3fc200973e Include BooleanOperations.html 2013-05-03 16:31:36 -07:00
Jürg Lehni
68d67fcdcf Start converting boolean code to Paper.js conventions.
- Tabs instead of white-space
- Different rules about spaces before / after parenthesis
2013-05-03 16:21:44 -07:00
Jürg Lehni
7ec53f74d1 Move boolean code into its own file, and add information comments again. 2013-05-03 16:16:52 -07:00
hkrish
d9d86f4ff7 Merge branch 'master' of https://github.com/paperjs/paper.js
* 'master' of https://github.com/paperjs/paper.js:
  Undo recent change to Curve#getIntersection() since it breaks some boolean operations.

€ý5:q
2013-05-03 19:24:03 +02:00
Jürg Lehni
9e3b7eef50 Undo recent change to Curve#getIntersection() since it breaks some boolean operations. 2013-05-02 11:32:24 -07:00
hkrish
debce28bc4 Merge upstream 2013-05-02 14:18:24 +02:00
hkrish
381ee98cbc Updated boolean operation methods.
The algorithm is based on paperjs' native segment and curve objects
rather than the generic Node and Link objects.
Also this is much smaller and faster! :)
2013-05-02 13:49:07 +02:00
Jürg Lehni
f425c931a8 Improve Curve#getIntersections() by avoiding further subdivision of flat curves. 2013-05-01 18:40:57 -07:00
Jürg Lehni
023c8b0432 Fix issue with recursive call of Curve.getIntersections(). 2013-05-01 18:24:54 -07:00
hkrish
934ec8df7e Fix: Update the getIntersections method signature in recursive calls 2013-05-01 13:29:02 +02:00
hkrish
d8dc762826 Merge branch 'master' of https://github.com/paperjs/paper.js
* 'master' of https://github.com/paperjs/paper.js:
  Define CurveLocation#intersection as a way to retrieve the CurveLocation on the intersecting path when using Path#getIntersections().

€ý5€ý`q€kb:q
2013-05-01 12:39:04 +02:00
Jürg Lehni
69f8bdc560 Define CurveLocation#intersection as a way to retrieve the CurveLocation on the intersecting path when using Path#getIntersections(). 2013-04-30 18:41:26 -07:00
hkrish
30d9e322e8 Boolean Operations.
This is probably a crude integration. Need to resolve some issues,
such as finding the right place for constants, private classes etc.
2013-04-29 21:36:12 +02:00
Jürg Lehni
c7ab32c501 Rearrange linear curve conditions. 2013-04-26 14:37:37 -07:00
Jürg Lehni
c513a24f46 Handle intersection between linear curves without recursive subdivision.
Closes #207.
2013-04-26 14:31:42 -07:00
Jürg Lehni
06ffd8089d Fix issue in Path#removeSegments() where curves are removed wrongly when start index is 0.
Closes #200.
2013-04-26 08:46:57 -07:00
Jürg Lehni
74f6a93b33 Optimize Curve.getArea(). 2013-04-25 17:47:11 -07:00
Jürg Lehni
898e216668 Implement Path#getArea() and CompoundPath#getArea(). 2013-04-25 17:37:19 -07:00
Jürg Lehni
80a1129eab Consistently use 'this' rather than 'Curve'. 2013-04-25 17:19:00 -07:00
Jürg Lehni
1b5ca4dec9 Rename Curve._addIntersections() to Curve.getIntersections() 2013-04-25 17:17:53 -07:00
Jürg Lehni
eaa6e3bb6b Improve Curve#getCrossings() documentation and code. 2013-04-25 11:08:50 -07:00
Jürg Lehni
d7e075d316 Handle contour edge cases in Path#contains().
Closes #208.
2013-04-25 11:03:49 -07:00
Jürg Lehni
edfd8f53de Remove accidentally committed debugging code. 2013-04-24 19:28:46 -07:00