Skip to content

bezier - Fix z value computation - #3042

Merged
mfedderly merged 2 commits into
Turfjs:masterfrom
githubhanjunjun:fix-bug
Jun 20, 2026
Merged

bezier - Fix z value computation#3042
mfedderly merged 2 commits into
Turfjs:masterfrom
githubhanjunjun:fix-bug

Conversation

@githubhanjunjun

Copy link
Copy Markdown
Contributor

Fix the issue of incorrect variable reference in the assignment of const dz on line 74 of the packages/turf-bezier-spline/lib/spline.ts file.

@mfedderly mfedderly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is probably a correct fix for the z values, but the package itself only spits out 2d coordinates meaning that I don't think this impacts the output of the package.

Are you trying to use this package for 3d work?

@mfedderly mfedderly changed the title bug fix bezier - Fix z value computation Jun 20, 2026
@mfedderly

Copy link
Copy Markdown
Collaborator

Note to self: the original version of this code appears to be also broken and it lives at https://github.com/dowrow/bezier-spline-js/blob/master/bezier-spline.js

@githubhanjunjun

Copy link
Copy Markdown
Contributor Author

I think that this is probably a correct fix for the z values, but the package itself only spits out 2d coordinates meaning that I don't think this impacts the output of the package.我认为这或许是一个解决 z 值问题的有效方法。不过,整个软件包只是输出二维坐标,因此我觉得这并不会影响到软件包的整体功能。

Are you trying to use this package for 3d work?您是想使用这个软件包来进行 3D 工作吗?

I just want the code to be correct even when the z value is not used, to avoid other potential unknown errors. I discovered this issue while studying how Bézier curves are calculated.

@mfedderly mfedderly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@mfedderly
mfedderly merged commit 552f23a into Turfjs:master Jun 20, 2026
5 checks passed
@mfedderly mfedderly added this to the v7.4 milestone Jun 21, 2026
@githubhanjunjun
githubhanjunjun deleted the fix-bug branch June 22, 2026 02:47
@githubhanjunjun
githubhanjunjun restored the fix-bug branch June 22, 2026 02:47
@githubhanjunjun
githubhanjunjun deleted the fix-bug branch June 22, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants