To make the "Plot Equation" plugin an internal feature

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

To make the "Plot Equation" plugin an internal feature

dxli
Hi all,

I think this would be an easy implementation but great enhancement for power users.

A new method, could be under Spline:

1, use draw equation to create a new entity, which is a lc_splinepoints, from points generated by "plot equation";

2, This new entity supports: intersections, tangent (better than the rs_spline);

3, while this would be an approximation by 2nd-order spline, user can always increase number of points for better approximation, and the error term is by a 3rd-order.

The current "plot equation" is only a plugin, and it generates line segments.

If we move it to based on lc_splinepoints:

1, it generates a single entity, easier for moving, rotating, mirroring, etc. Only click to select, instead of trying to figure out how to select all line segments;

2, 2nd order approximation, compared with 1st order approximation;

3, intersection/tangent supported;

It would be good, if we can have "trimming" supported as well.

dxli
Reply | Threaded
Open this post in threaded view
|

Re: To make the "Plot Equation" plugin an internal feature

dxli
PoC in https://github.com/LibreCAD/LibreCAD/commit/7db402a920fca0882c0a4dc9d26b7babf424b67b

Problem noticed: slow intersection.

1, revert this feature;
2, improve efficiency of splinepoints intersection. Currently, intersection for splinepoints is using a O(n^2) algorithm, with n being number of points used to generate the interpolation 2nd spline.