1
0
Fork 0
Commit graph

394 commits

Author SHA1 Message Date
Jonathan Haas
dd1b4f1a14 feature(core): add path.circleSegment() method and documentation 2024-07-11 18:38:04 +02:00
Jonathan Haas
1ee4864761 fix(core): Fix typo in path.clean() method 2024-07-02 18:41:18 +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
Jonathan Haas
ed608b52a0
Add documentation and rename method 2024-04-18 10:53:30 +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
789ff3f8ca Fix test 2024-04-15 19:31:01 +02:00
Jonathan Haas
85946eb716 Add clarifying comment 2024-04-15 18:43:39 +02:00
Jonathan Haas
d2731a6d88 add(core): Add Path.angleAt(point) method 2024-04-15 18:28:49 +02:00
Jonathan Haas
1909955d73 Make pointOnCurve behaviour match documentation 2024-04-15 18:28:09 +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
Joost De Cock
4d94b8d8ca
Merge pull request #6001 from freesewing/joost
feat(core): Added Path.combine and related changes, closes #5976
2024-02-10 16:00:27 +01:00
joostdecock
dde6935cdf chore(core): Removed left-behind variable 2024-02-10 15:48:30 +01: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
Benjamin Fan
0fdd1e5b3c fix(core): Add missing anchor property to Stack() constructor 2024-02-08 12:26:04 -08:00
Joost De Cock
777a9db557
Merge pull request #5862 from BenJamesBen/remove-distance_debug-messages
chore(core): Remove options distance debug logging
2024-01-27 17:07:06 +01:00
Benjamin Fan
470b34ae9e fix(core): Use Set instead of Array for options priority debug messages 2024-01-25 21:51:00 -08:00
Benjamin Fan
5828e53937 fix(core): Remove Svg.body property 2024-01-24 20:18:03 -08:00
Benjamin Fan
a298f43a18 chore(core): Remove options distance debug logging 2024-01-20 20:23:52 -08:00
Wouter van Wageningen
dfe98c19cf
Update utils.mjs
Fix #5697
2023-12-24 15:39:33 -08:00
woutervdub
3cef72975e Add test case for code coverage, and implement two Joost comments. 2023-12-16 22:09:22 +00:00
Wouter van Wageningen
e1fa8286d4 Fixes split() bug #5569 2023-12-15 06:50:58 +00:00
joostdecock
635d908482 fix(core): Corectly load conditional plugins
The parameters passed to the conditional load method were incorrect
causing a conditional plugin to never get loaded.
2023-11-08 20:27:48 +01:00
joostdecock
2b25739566 chore(core): Allow overriding more store methods 2023-10-29 17:21:00 +01:00
Himanshu Singh
4431a027e5
Update utils.mjs
fixed typo transorms -> transforms on line 857 and transorm -> transform on line 881
2023-10-28 12:48:28 +05:30
joostdecock
e7292ee2e4 fix(core): Left-over use of tl and br 2023-10-21 17:45:35 +02:00
Joost De Cock
1e4a064043 fix(core): Return property names that are consistent with API 2023-10-21 13:26:45 +02:00
Joost De Cock
43796a95cd fix(core): Lowercase macros when generating IDs 2023-10-18 16:32:08 +02:00
Joost De Cock
cb106578b3 feat(core): Better support for macro removal an node id tracking 2023-10-18 16:00:15 +02:00
Joost De Cock
49618755be feat(core): Add cbqc named export
This exports the constant `0.55342686` which is the value to best
approximate a (quarter) circle with a cubic Bézier curve.

See: https://spencermortensen.com/articles/bezier-circle/
2023-10-17 10:03:05 +02:00
Joost De Cock
57a73ee457 chore(core): Remove lint 2023-10-15 20:06:17 +02:00
Joost De Cock
0fe8a94eef chore(core): Remove debug output 2023-10-15 16:22:37 +02:00
Joost De Cock
b83ab5df74 feat(core): Allow plugins to provide their own packing implementation 2023-10-15 15:12:10 +02:00
Joost De Cock
f08335639b fix(core): snap upwards when snap config is a mere number. Fixes #4236 2023-10-14 15:30:40 +02:00
Joost De Cock
3574b85e17 fix(core): Make user options take precedence in utils.mergeOptions 2023-10-14 14:53:14 +02:00
joostdecock
18042c8f3d feat(core): Return from macros 2023-09-28 13:26:32 +02:00
joostdecock
b387c4d2bd fix(core): Make mergeOptions handle no settings 2023-09-26 15:41:14 +02:00
joostdecock
524a8494fc feat(core): Make goldenRatio named export 2023-09-20 18:56:00 +02:00
Joost De Cock
d90951bc8c feat(core): Uncouple complete and sa settings 2023-09-15 08:18:33 +02:00
Joost De Cock
8247cd6832 chore(core): Turn expand on by default 2023-09-09 17:58:31 +02:00
joostdecock
52321bd4ff breaking(core): Dopped log.warning in favor of log.warn 2023-09-07 18:17:22 +02:00
joostdecock
9c1b1eb390 chore: plugin-bundle is no longer a design dependency 2023-09-07 11:46:05 +02:00
joostdecock
b263979ca0 feat(core): Load core plugins (plugin bundle) by default 2023-09-07 11:25:57 +02:00
joostdecock
2a7e7b9706 feat(core): Added the expand option 2023-09-06 10:26:16 +02:00
joostdecock
8de63bb446 feat(core): Do not render snippets by default when complete is false 2023-09-06 08:57:43 +02:00
joostdecock
c598fe7fe6 feat(core): Make macros case-insensitive 2023-09-05 20:35:31 +02:00
joostdecock
5c00551bca chore(core): log.warning is now log.warn 2023-09-05 12:00:05 +02:00
joostdecock
ca5556ef8c feat(core): When injecting a part, copy store[part.name] 2023-09-05 11:04:44 +02:00
Compilin
0ea7f192c4 fix(core): Fixed bug in matrixTransform disregarding the rotation center if centerX is falsy 2023-08-29 09:43:44 +02:00