X6 icon indicating copy to clipboard operation
X6 copied to clipboard

请问ANTV X6的贝塞尔曲线是通过什么公式计算出来的一条唯一曲线

Open lijiapeng0302 opened this issue 1 year ago • 2 comments

问题描述

正常数学的贝塞尔曲线,会通过起始点、结束点、控制点以及t的变化确认一条唯一的贝塞尔曲线,但是我看ANTV X6中的贝塞尔曲线并没有控制点,只有曲线上的点,所以我想了解一下ANTV X6的贝塞尔曲线是通过什么公式计算出来的一条唯一曲线

重现链接

重现步骤

预期行为

我期望取到贝塞尔曲线的真实控制点坐标 但是现在只能取到曲线上节点的坐标

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox ...]
  • X6 版本: [2.11.1 ...]

屏幕截图或视频(可选)

image image

补充说明(可选)

No response

lijiapeng0302 avatar Sep 11 '24 02:09 lijiapeng0302

👋 @lijiapeng0302

Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

x6-bot[bot] avatar Sep 11 '24 02:09 x6-bot[bot]

你看的应该是edge的曲线点,这是简化版本,要想用真实三次贝塞尔线,用Path类中的 C 创建C类型的线段

light-years-run avatar Sep 14 '24 02:09 light-years-run

贝塞尔曲线就是贝塞尔曲线,你想问的应该是 arc 或者 rounded 的计算公式吧,看下源码。

https://github.com/antvis/X6/blob/master/src/geometry/path/util.ts

lxfu1 avatar Sep 08 '25 07:09 lxfu1