Tag Info

New answers tagged

1

There's a standard trick to do this in MetaPost. I decided to include the solution because MetaPost's unfill really doesn't unfill anything but fills with the background colour. The following shows the solution. beginfig( 0 ) path clockwisepath, anticlockwisepath; clockwisepath := (0,100) -- (100,100) -- (100,0) -- (0,0) -- (0,100) -- cycle; ...


3

And in cmd did you went to the correct folder? If you type dir and hit enter, can you see example.mp? Did you check the extension of example.mp (perhaps your editor added the extension .txt)?


4

I worked on @percusse example and I managed to fix the circle issues. I might be perfectible but I guess the idea is there. \documentclass[border=1cm]{standalone} \RequirePackage{tikz} \usepackage{ifthen} \usetikzlibrary{calc,patterns,decorations,plotmarks} \usepackage{pgfplots} \pgfplotsset{compat=1.8} \begin{document} ...


1

I'm not entirely certain what you want this to look like. Probably not like this, but this is what I get from your description! (Or something more like this? But note that I drew that so it is a bit on the odd side.) By the way, you should consider using Claudio Fiandrino's timeline library. \documentclass[tikz,border=5pt]{standalone} ...


3

Here is a solution, which uses pst-intersect's ability to save a generic path. So, first a random path is generated (how is pretty much arbitrary), then it is loaded, its path length is calculated and then it is redrawn with scaled coordinates: \documentclass[margin=5pt, pstricks]{standalone} \usepackage{pst-intersect} \makeatletter \def\SaveRandomPath{% ...


14

Here's a Metapost effort. The shapes above are all scaled to the same desired length, and show increasing levels of randomness from black to red. Here's the code: prologues := 3; outputtemplate := "%j%c.eps"; beginfig(1); desired_length = 500; N = 30; r = 50; path shape; for s=0 step 1 until 11: shape := (r,0) for i=1 upto N-1: .. ...


5

Please find a not perfect solution with Asymptote. Since the points are randomly generated it is not easy to have a non-intersecting path. So I remember some hull computation with some parameters. You can find it http://git.piprime.fr/?p=asymptote/pi-packages.git;a=blob;f=hull_pi.asy;hb=HEAD and some examples are on ...


10

If I got the sums right then this calculates the length of each curve, given the length it then redraws the path, scaling everything so the length equals your target length. /getpathlength {flattenpath {exch dup /startx exch def exch dup /starty exch def /currentx startx def /currenty starty def /currentlength 0 def moveto} {exch dup /newx exch def ...


2

"Easier" depends on your point of view and your experience of course, but there's no fundamental limitation in MP to prevent it drawing this type of diagram. There are fewer complications built into plain MP than other tools, but that makes life simpler in some ways as there is less to learn. I've shown two different approaches below. For the brace ...


4

You have a=0.26794 and b=3.73206, so incrementing by 0.1 leads to a final point with x=3.66815, because 3.66815+0.1>b (consider also the rounding errors). You should call pts_f := compute_curve(f, a, b, (b-a)/50) scaled u; to get 50 points (you can decide the amount of sampling). Using mpost -numbersystem=double could be even more precise (I ...



Top 50 recent answers are included