I am trying to make some BSplineCurve
examples for my students. For fun I created the following Manipulate that draw an elephant using BSplineCurve
img = Import[
"http://www.clipartqueen.com/image-files/elephant-silhouette.png"]
ptsin = {{984., 950.}, {1113., 898.}, {1188.2, 843.6}, {1226.7,
784.7}, {1247.1, 748.5}, {1260.6, 712.3}, {1269.7,
655.7}, {1274.2`, 592.3}, {1278.7, 501.8}, {1292.3,
452.}, {1328.5, 370.5}, {1249.3, 465.6}, {1224.4, 375.1}, {1224.4,
341.1}, {1197.3, 289.1}, {1188.2, 232.5}, {1181.4, 164.6}};
Manipulate[
Show[Image[img, ImageSize -> 400],
Graphics[{Yellow, Blue, Thick,
BSplineCurve[pts, SplineDegree -> 3,
SplineClosed -> True], Polygon[pts]}, Frame -> True,
PlotRange -> All]], {{pts, ptsin}, Locator,
LocatorAutoCreate -> True}, "Alt+click to add points"]
I take the following locator Pane:
I need some help on making a nicer LocatorPane! I can draw new points into pts list (using Alt+ click) but these are only inserted at the end of pts. Is it possible each point is exactly inserted after (the position of) the last clicked point(and not at the end of pts)? Is it posible to have redo or undo buttons( in other words: How to make a "history" of pts)?
Excuse for the multiple questions here. I found that LocatorPane
is very attractive method for making fun with maths, vector drawings etc.
I hope that is not a duplicate question!