Tag Info

Hot answers tagged

8

With your figure l1 = Line[{{0, 1}, {1, 1}}]; cir = Circle[{1, 0}, 1, {-π/2, π]/2}]; l2 = Line[{{0, -1}, {1, -1}}]; geom = {l1, cir, l2}; g = Graphics[geom]; and the rectangle marker l = 0; hw = 0.01; hh = 0.05; marker = Rasterize@Magnify[Graphics@Rectangle[{l - hw, hh}, {l + hw, -hh}], 0.07] one can create a binary image from the figure bg = ...


6

Some of this code is based on the last example of the docs on GradientOrientationFilter You can also smooth out the resulting path and reparametrize the interpolation based on the curve length to get a "constant velocity" displacement for the rectangle- l1 = Line[{{0, 1}, {1, 1}}]; cir = Circle[{1, 0}, 1, {-π/2, π/2}]; l2 = Line[{{0, -1}, {1, -1}}]; geom = ...


3

Motivation In Mathematica most curves are ultimately rendered using Line, which has a straightforward derivative. Therefore it makes sense to create a function that solves the problem for the particular case of a Line object. For example pts = Flatten[Cases[Plot[Sin[x], {x, 0, 2 Pi}], Line[pts_] :> pts, Infinity], 1]; is the list of points which make ...



Only top voted, non community-wiki answers of a minimum length are eligible