Commit graph

5491 commits

Author SHA1 Message Date
Jürg Lehni
da53bfe5a0 Simplify boolean operations example code a bit. 2015-01-04 22:00:40 +01:00
Jürg Lehni
7e80e19e32 Insert results of boolean operations above the first path. 2015-01-04 21:59:31 +01:00
Jürg Lehni
d522e4aec2 Merge remote-tracking branch 'origin/master' into boolean-operations
Conflicts:
	src/path/PathItem.Boolean.js
2015-01-04 21:29:50 +01:00
Jürg Lehni
9f0a774fd0 Fix newly introduced error in clean-up. 2015-01-04 18:07:02 +01:00
Jürg Lehni
1239eb55ec Minor clean up in Curve.filterIntersections(). 2015-01-04 17:47:41 +01:00
Jürg Lehni
f0d28d7529 Implement unit test for #609 2015-01-04 17:46:59 +01:00
Jürg Lehni
77193e1465 Clean-up new splitPath() code. 2015-01-04 17:37:15 +01:00
hkrish
718af4527f Boolean: handle linear segments correctly.
Earlier implementation was unfinished and did not reset some handles to
linear, this caused the winding to be miscalculated.

Conflicts:
	src/path/PathItem.Boolean.js
2015-01-04 17:30:19 +01:00
Jürg Lehni
afc14b9634 Reduce Numerical.TOLERANCE to 1e-6, and use the same value across the boolean code.
Yields very good results now, across all tests.
2015-01-04 15:54:50 +01:00
Jürg Lehni
ac0663bdd9 Hard-code numerical tolerance in unit tests as it's used in all hard-coded values. 2015-01-04 14:07:43 +01:00
Jürg Lehni
a683493e59 Implement unit tests for path intersection.
Related: #565, #568, #570, #571
2015-01-04 14:01:32 +01:00
Jürg Lehni
3564dafa93 Do not keep iterating if the curve was reduced to a point. 2015-01-04 13:23:59 +01:00
Jürg Lehni
d33d65fcc2 Revert change in recursion threshold as the new code reaches the desired precision earlier. 2015-01-04 13:21:12 +01:00
Jürg Lehni
cca6606f72 Reduce the amount of path reversing required.
We don't need paths at clockwise / counter-clockwise orientation. We simply need them oriented the same way, or the opposite way.
2015-01-04 01:51:27 +01:00
Jürg Lehni
390ef324f2 Find a better implementation for exclude() boolean operations, requiring only one pass instead of two. 2015-01-04 01:50:24 +01:00
Jürg Lehni
f0f98daf69 Apply @hkrish's fix in 3781aedb22 to Line.getSignedDistance as well.
Relates to #554
2015-01-04 00:53:56 +01:00
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