How to draw clothoids graphically in Qt?

前端 未结 2 757
盖世英雄少女心
盖世英雄少女心 2020-12-17 04:53

I am trying to build an application which the user can use to draw clothoids with the mouse, i.e. to set the start point and the end point of the spiral and then by dragging

2条回答
  •  [愿得一人]
    2020-12-17 05:35

    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".

提交回复
热议问题