Commit graph

5577 commits

Author SHA1 Message Date
hkrish
3781aedb22 Small but critical fix on getSignedDistance method
when the line is perfectly vertical, return the difference between x values depending on the side. The earlier "l1y" is a silly mistake.
2015-01-03 23:41:47 +01:00
Jürg Lehni
5c184e381b Merge remote-tracking branch 'origin/master' into boolean-operations
Conflicts:
	src/path/PathItem.Boolean.js
2015-01-03 21:09:31 +01:00
Jürg Lehni
4371e92191 Reduce EPSILON to 1e-13.
Reducing further to 1e-14 starts producing new issues in boolean operations code.
2015-01-03 21:03:13 +01:00
Jürg Lehni
b6a4815d03 Remove Curve#isHorizontal() as its implementation and precision is specific to boolean operations. 2015-01-03 21:02:12 +01:00
Jürg Lehni
46d7717812 Use standard values for tMin / tMax when calling getTangentAt() tracePaths() 2015-01-03 20:59:20 +01:00
Jürg Lehni
6bb6002d1a No need to double tolerances here. 2015-01-03 20:35:51 +01:00
Jürg Lehni
68c53534d6 Use the same precision in PathItem#getIntersections() when handling curve time parameters as in the rest of the library.
TOLERANCE instead of EPSILON.
2015-01-03 20:25:57 +01:00
Jürg Lehni
3e67f72393 Some code clean-up. 2015-01-03 20:25:12 +01:00
Jürg Lehni
383bed4d05 Turn off invisible spaces in TextMate2. 2015-01-03 11:43:41 +01:00
Jürg Lehni
51ec3325e3 Remove the need to store winding samples in array and sort.
Calculating the average winding value instead yields the same results.
2015-01-03 11:25:10 +01:00
Jürg Lehni
26f209c835 Implement better strategy for handling edge cases in winding samples. 2015-01-03 11:24:27 +01:00
Jürg Lehni
a854c55914 Split off code from Path.Clockwise() into Curve.getEdgeSum() 2015-01-03 01:46:22 +01:00
Jürg Lehni
80e1a54171 Dirty temporary fix for new median winding code that struggles with circles. 2015-01-03 01:17:48 +01:00
Jürg Lehni
5da0ae5c3c Better handle of edge values in Path#split().
Closes #515 & #538
2015-01-03 01:07:51 +01:00
Jürg Lehni
98686ef888 Fix endless recursion in CompoundPath#reduce() 2015-01-03 00:51:06 +01:00
Jürg Lehni
5e654ca64e Reducing an empty CompoundPath should replace it with an empty Path. 2015-01-03 00:46:45 +01:00
Jürg Lehni
e195db2567 Handle empty paths in Path#reorient()
Closes #548
2015-01-03 00:46:24 +01:00
Jürg Lehni
001561decb Remove the dependency of Math.random() from boolean operation code.
Closes #473
2015-01-03 00:32:06 +01:00
Jürg Lehni
bb2fece225 Restructure code that determines median winding contribution. 2015-01-03 00:26:13 +01:00
Jürg Lehni
5f0e545ba7 Use EPSILON instead of TOLERANCE in Point#isColinear() and #isOrthogonal() 2015-01-02 23:48:34 +01:00
Jürg Lehni
538eac6dc7 Use smaller tolerances in winding code, to address edge cases.
Closes #559
2015-01-02 23:47:26 +01:00
Jürg Lehni
6359738618 Do not offset bounds in cubic solver by MACHINE_EPSILON, as this is how comparisons are performed with values offset by tolerances elsewhere in the library.
Doing it differently here produced various errors in fat-line clipping and boolean code.
2015-01-02 23:14:19 +01:00
Jürg Lehni
70e34ef705 Merge remote-tracking branch 'origin/master' into boolean-operations
Conflicts:
	src/path/Curve.js
	src/util/Numerical.js
2015-01-02 22:41:38 +01:00
Jürg Lehni
f0fdb804ec Reduce value of EPSILON to the lowest amount that does not cause issues in boolean-test. 2015-01-02 22:37:36 +01:00
Jürg Lehni
477527f8ec Implement more intuitive version of clipConvexHull(), outlined in #570 by @iconexperience
Code further shortened using a sub-routine.
2015-01-02 22:36:04 +01:00
Jürg Lehni
232739fae9 Add comments to fat-line clipping code linking to issues #568 and #571. 2015-01-02 22:34:09 +01:00
Jürg Lehni
a2208f218c Merge branch 'refs/heads/master' into boolean-operations
Conflicts:
	src/util/Numerical.js
2015-01-02 21:46:28 +01:00
Jürg Lehni
cdfd21ddd3 Switch to using new cubic solver by @hkrish 2015-01-02 21:44:29 +01:00
Jürg Lehni
51739e6e27 Merge remote-tracking branch 'origin/master' into solve-cubic
Conflicts:
	src/path/PathItem.Boolean.js
2015-01-02 21:26:04 +01:00
Jürg Lehni
8ad067ec6c Use tolerance when comparing curve locations by parameter. 2015-01-02 21:20:28 +01:00
Jürg Lehni
4ed9ef54f2 Fix bug in Curve.filterIntersections() and clean up code a bit. 2015-01-02 21:19:18 +01:00
Jürg Lehni
b2261fd512 Introduce Curve.filterIntersections() and use it both in PathItems#getIntersections() and Curve#getIntersections() 2015-01-02 21:00:05 +01:00
Jürg Lehni
3302a7dff5 Increase recursion threshold to 4 when checking for fatline convergence. 2015-01-02 20:49:09 +01:00
Jürg Lehni
fbd026ea0d Bring back code removed by @hkrish in commit 5fb75593c2
Relates to issue #570, still required to figure out why it is still needed.
2015-01-02 20:02:45 +01:00
Jürg Lehni
74844d8a2b Use hullEpsilon in all comparisons of curve time values in fat-line clipping code.
Addresses first half of issue #568
2015-01-02 17:33:04 +01:00
Jürg Lehni
41c0584f35 Merge remote-tracking branch 'origin/master' into solve-cubic 2015-01-02 16:37:50 +01:00
Jürg Lehni
e3e3d13fa5 Add comment regarding issue #565 2015-01-02 16:33:15 +01:00
Jürg Lehni
b75def3f3a Implement optimal values in fat line clipping code for maximum recursion and curve time difference, as determined by @iconexperience.
Closes #565
2015-01-02 16:29:12 +01:00
Jürg Lehni
91865be8a3 Merge remote-tracking branch 'origin/master' into solve-cubic
Conflicts:
	src/basic/Line.js
	src/path/Curve.js
	src/path/PathItem.Boolean.js
	src/util/Numerical.js
2015-01-02 16:21:18 +01:00
Jürg Lehni
45c86a3035 Switch to suggested new implementation of Line.getSignedDistance() by @iconexperience
Closes #554
2015-01-02 16:17:19 +01:00
Jürg Lehni
878be7962e Merge branch 'refs/heads/master' into solve-cubic
Conflicts:
	src/path/Curve.js
	src/path/PathItem.Boolean.js
	src/util/Numerical.js
2015-01-02 15:33:23 +01:00
Jürg Lehni
8ae8855b81 Visually center JSON tiger example. 2015-01-02 14:39:13 +01:00
Jürg Lehni
95a8539045 Fix size issue on non-resizable HiDPI canvases.
Reverting back to original behavior in #586.
2015-01-02 14:38:06 +01:00
Jürg Lehni
3c31c0e482 Have SVGImport respect the current PaperScope's applyMatrix setting. 2015-01-02 14:19:17 +01:00
Jürg Lehni
54d959df1f Load CSS in all examples. 2014-12-30 00:29:20 +01:00
Jürg Lehni
a07dc98046 Clean up and simplify code from pull request #580 and fix CSS in examples accordingly. 2014-12-30 00:16:51 +01:00
Jürg Lehni
ac9c3f03c4 Merge branch 'georeith-true-resize-canvas' 2014-12-30 00:14:58 +01:00
Jürg Lehni
5b9eb4bd1a Revert unecessarily commited files in pull request #586 2014-12-30 00:14:33 +01:00
Jürg Lehni
dfda6cf7b5 Merge branch 'true-resize-canvas' of https://github.com/georeith/paper.js into georeith-true-resize-canvas 2014-12-29 23:56:57 +01:00
Jürg Lehni
66c67fbe94 Improve insertion handling for Item and Layer so insertAbove() / insertBelow() works for Layers too.
Closes #603
2014-12-29 23:16:13 +01:00