1
0
Fork 0
Commit graph

33 commits

Author SHA1 Message Date
Jonathan Haas
55e776db2c add unit tests for circleSegment method 2024-07-12 07:29:11 +02:00
joostdecock
eded9e9d3a fix(core): Handle path splits on start or end points
In some edge cases, like when splitting a path on or very close to its
start or end point, `Path.split()` will return an array in which one of
the elements is not a Path object, but rather an empty array.

That is rather combersome to check for, so this changes that behaviour
and will return null for such cases.

I've also updated the documentation to clarify this behaviour.

Fixes #6816

This also fixes a bug when a path was being split on its end point.
2024-06-12 13:24:42 +02:00
Joost De Cock
f82ebd97d8
Merge pull request #6558 from HaasJona/add/path-angle
add(core): Add Path.angleAt(point) method
2024-04-18 19:02:26 +02:00
Joost De Cock
281a04c37f
Merge pull request #6527 from HaasJona/fix/path-offset
fix(core): Path.offset(...) improvements
2024-04-16 19:07:55 +02:00
Jonathan Haas
25059b818f Add test for path.angleAt 2024-04-15 18:28:49 +02:00
Jonathan Haas
080874dd88
fix(core): Path.offset(...) no longer fails on very short curves or zero length paths. Fixes #6519 2024-04-08 08:25:09 +02:00
Jonathan Haas
849563d1ec
add(core): Add Path.rotate(...) function analogue to Point.rotate(...) 2024-04-05 14:45:20 +02:00
joostdecock
a30b08371c feat(core): Added Path.combine and related changes, closes #5976
The discussion in #5976 is whether `Path.join()` should use a line
segment to close any gaps in the path caused by move operations, or by
differences in the end and start points of paths being joined.

The answer is yes, that is the intended behaviour, but people who read
_join_ might expect differently.

So I have made a few changes to clarify this:

- The new `Path.combine()` method combines multiple path instances into
  a single instance without making any changes to the drawing operations
- Since `Path.combine()` is variadic, I have also updated `Path.join()`
  to be variadic too, since that is more consistent.
- The old way of calling `Path.join(path, bool)` is deprecated and will
  log a warning. Calling `Path.join()` this way will be removed in v4.
- Related to this change is how `Path.length()` should behave when there
  are gaps in the path. Currently, it skips those. So I've added a
  parameter that when set to `true` will include them.
- Added documentation for `Path.combine()`
- Updated documentation for `Path.join()`
- Updated documentation for `Path.length()`
2024-02-10 15:40:41 +01:00
joostdecock
26e282f5b7 fix: Fix tests after major chai upgrade
Note that the tests for Lumina are failing, but that's not related to
the chai upgrade, rather it seems these tests fail because of issues in
the design that we'll tackle later (it's a brand new design yet to be
released).
2024-02-04 12:14:42 +01:00
woutervdub
3cef72975e Add test case for code coverage, and implement two Joost comments. 2023-12-16 22:09:22 +00:00
joostdecock
5c00551bca chore(core): log.warning is now log.warn 2023-09-05 12:00:05 +02:00
Benjamin F
80eab3896b fix(core): Add test for Path.join() for paths with noop operations 2022-12-29 07:06:59 -08:00
Enoch Riese
341a5cce61 more lint fixes 2022-11-15 17:29:02 -06:00
Enoch Riese
3243216369 lint fixes 2022-11-15 17:10:18 -06:00
Enoch Riese
d921cc700d start refactoring tests for speed 2022-11-15 14:50:14 -06:00
Joost De Cock
fba25ed02b chore(core): Migrated to bezier-js 6 2022-09-28 21:25:06 +02:00
joostdecock
47a7a71b61 chore(core): Linting and more tests 2022-09-25 10:55:37 +02:00
joostdecock
12c5c6a3f8 wip(core): Ensure imutable design parts and options 2022-09-25 10:55:37 +02:00
Joost De Cock
d5eb2946d3 chore(core): More unit tests 2022-09-19 18:04:47 +02:00
Joost De Cock
269b1a36f1 fix(core): Tests for smurve and smurve_ 2022-09-19 10:32:53 +02:00
Joost De Cock
d7cbd42ced feat(core): Added path.smurve() and path.smurve_() methods 2022-09-19 09:28:45 +02:00
Joost De Cock
5dc7401308 chore(core): Use hide, not render 2022-09-18 18:16:17 +02:00
Joost De Cock
200cebf582 chore(core): Refactor v3 code 2022-09-18 15:11:10 +02:00
Joost De Cock
e163ed1782 feat(core): Tests for multisets 2022-09-17 10:28:01 +02:00
Joost De Cock
56427cc4bd chore(core): Linter fixes 2022-09-15 06:34:05 +02:00
joostdecock
48b366c57e fix(core): Issue with hiding dependencies 2022-09-11 18:00:41 +02:00
joostdecock
ac4d134075 feat(core): Pass shorthand() to draft methods 2022-09-10 19:13:43 +02:00
joostdecock
4121ef44d2 wip(core): Work on path unit tests 2022-09-10 18:23:19 +02:00
Joost De Cock
0cbffd6dc6 wip(core): Work on late-stage config resolver
This moves resolving of the config from the pattern constructor to the
init() method. The idea is that adding a part to a pattern is exactly
the same as adding a part to a design. In other words, late-stage adding
of parts would be no different as the config gets resolved after that.

This is currently broken in many different ways, but the unit tests
particular to this new way of resolving the config do pass.
2022-09-09 20:20:38 +02:00
Joost De Cock
c09ae4aa69 wip(core): Migrated to named exports only 2022-08-28 02:14:39 +02:00
Joost De Cock
ba7c663941 wip(core): Work on porting unit tests to v3 2022-08-27 09:27:07 +02:00
Joost De Cock
eccdd23ded Merge branch 'proposal-parts' into v3-phase1 2022-08-26 12:38:39 +02:00
joostdecock
547d11569d chore(core): Port tests to ESM 2022-08-25 11:47:54 +02:00
Renamed from packages/core/tests/path.test.js (Browse further)