There are a few examples that should help you getting started in the Graphics View Examples page. The Diagram scene one looks like a good starting point for what you want to achieve.
I realize that this is an old question, but for interested parties there is a good discussion of theory and pseudocode for Euler spirals (clothoids) in the paper "Euler Spiral for Shape Completion" by Kimia, Frankel, and Popescu. Sample C++ code can be found online at Brown University's website.
Papers by Levien and others suggest methods to improved upon the "biarc" calculation of the paper by Kimia, et al. Levien's paper includes an in-depth history.
You only need four parameters to draw the spiral: two end points, and the angles of tangents at those end points. (You don't need to define curvature.) The code outputs the intermediate points between the two end points at distance increments of your choice. You simply need to plot and connect those intermediate points.
Once you implement the code, you may need to tweak some of the parameters such as the minimum curvature. You'll likely see a few parameters for which the code "blows up".
发布评论
评论(2)
最好的方法可能是使用图形视图框架。
有一些示例可以帮助您开始使用图形视图示例 页面。 图表场景看起来是您想要的一个很好的起点达到。
The best approach would probably be to use the Graphics View Framework.
There are a few examples that should help you getting started in the Graphics View Examples page. The Diagram scene one looks like a good starting point for what you want to achieve.
我意识到这是一个老问题,但对于感兴趣的各方来说,Kimia、Frankel 的论文 “Euler Spiral for Shape Completion” 对欧拉螺旋(回旋线)的理论和伪代码进行了很好的讨论,和波佩斯库。示例 C++ 代码可以在布朗大学网站上在线找到。
用于形状补全的欧拉螺旋
包含 Kimia、Frankel 和 Popescu 方法的 C++ 代码下载链接的页面
论文Levien 等人提出了改进 Kimia 等人论文中“biarc”计算的方法。莱维恩的论文包含了深入的历史。
欧拉螺旋:Raph Levien 的数学史
绘制螺旋只需要四个参数:两个端点,以及这些端点处的切线角度。 (您不需要定义曲率。)代码以您选择的距离增量输出两个端点之间的中间点。您只需绘制并连接这些中间点即可。
实现代码后,您可能需要调整一些参数,例如最小曲率。您可能会看到代码“爆炸”的一些参数。
I realize that this is an old question, but for interested parties there is a good discussion of theory and pseudocode for Euler spirals (clothoids) in the paper "Euler Spiral for Shape Completion" by Kimia, Frankel, and Popescu. Sample C++ code can be found online at Brown University's website.
Euler Spiral for Shape Completion
Page with download link for C++ code for method of Kimia, Frankel, and Popescu
Papers by Levien and others suggest methods to improved upon the "biarc" calculation of the paper by Kimia, et al. Levien's paper includes an in-depth history.
The Euler spiral: a mathematical history by Raph Levien
You only need four parameters to draw the spiral: two end points, and the angles of tangents at those end points. (You don't need to define curvature.) The code outputs the intermediate points between the two end points at distance increments of your choice. You simply need to plot and connect those intermediate points.
Once you implement the code, you may need to tweak some of the parameters such as the minimum curvature. You'll likely see a few parameters for which the code "blows up".