Dynamic Cubic Bezier Demonstration

Опубликовано: 26 Октябрь 2024
на канале: David Rector
701
17

I need to add bezier curves to the drawing capabilities of the Linkage Mechanism Designer and Simulator (http://www.mechanismsimulator.com) so I first decided to reuse some JavaScript code I had and do an experiment. I wanted to visualize the curve constructions so I added the construction points and lines to the Geometric Constructions page I use for these experiments (http://rectorsquid.com/circletest.php). It's the Slow Drawing Bezier test at the bottom of the current list.

You can see that the Bezier curve being drawn slowly and changes to the control points alter the construction lines and points, and the curve, interactively.

The next step is to figure out how to pick a point and find the point on the curve closest to it. I need to this for mouse click selection once I get far enough to want to select fro various element and curves on in the window. If you go to the page long after I post this, the name of the test might change as well as what happens the test - there might be an extra point and the nearest-point calculation might happen.