2

Give that my previous idea may be too difficult

TikZ Region bounded by points

is it possible to draw a smooth(but "programmable") spline that intersects(or almost intersects) a group of ordered points then "enlarge" it.

Here is what enlarge may mean:

  • Expand the curve to the "outside" by a certain certain distance.
  • Draw the spline with a large line thickness BUT do not have sharp edges
  • Draw the spline as a union of disks for each point on the spline but have the disk diameter depend on the curvature. Sharp peaks would produce larger circles which should "cover up" a the cusp. e.g., say we have an L curve. At the cusp the circles used would be larger than at the end points which would produce a more gradual change(here we would need to offset the disks position slightly too depending on the change in diameter)
  • Anything that is smooth, regular, and "encloses" the line segments will work with preferably some way to control it's smoothness and size. The goal being to visually group the set of points to distinguish them from other groups of points(and I cannot change the properties of the points themselves)
Uiy
  • 6,132
  • Is this useful for you by any chance? I'll paste it in two parts \usetikzlibrary{backgrounds} \begin{tikzpicture} \draw[style=help lines] (0,0) grid[step=1cm] (7,7); \begin{scope}[every node/.style={fill,circle,inner sep=2pt}] \foreach \x/\y in {2/0,4/0,4/2,4/4,2/5,2/3,0/6,7/6,6/5,6/3,7/1} \coordinate (n\x\y) at (\x,\y); \end{scope} – percusse Apr 17 '12 at 18:01
  • \begin{scope}[on background layer,myline/.style={line cap=round,line width=5mm,line join=round}] \draw[blue,myline] (n20) -- (n40); \draw[myline,fill=green,draw=green,line width=8mm] (n71) -- (n63) -- (n65) -- (n76)--cycle; \draw[myline,red] (n71) -- (n63) -- (n65) -- (n76); \draw[myline,fill=green,brown,line width=8mm] (n06) -- (n25) -- (n44) -- (n42) -- (n23) -- cycle; \end{scope} \end{tikzpicture} – percusse Apr 17 '12 at 18:01
  • That does get the pic I showed but is not necessarily what I want. Remember, I do not want to hard code anything BECAUSE I have a lot of cases... maybe thousands... so it would be fore time consuming. I also want a "smooth" region. Sort of a circle squashed and stretched to enclose the points. The red line you did might work for me BUT notice the "corner" spots that have sharp edges. That is something I would like to avoid and it doesn't look visually appealing for what I'm doing. – Uiy Apr 17 '12 at 20:16
  • Indeed I didn't expect this to be a solution but I just wanted to draw your attention to (maybe) using a thick line. How this line should travel of course eludes me. – percusse Apr 17 '12 at 20:39
  • @percusse Yes, The thick may be the last resort. I can generate the code in lua so it shouldn't be too difficult. I'll order the points the way I want the line to travel so that is not an issue either. Evertyhing is more visual than anything. I want more of a "blob" look than polygonal. – Uiy Apr 17 '12 at 21:38
  • Another crazy idea might be connecting the vertices using mindmaps with very very thick connections but keeping all colors the same. That would at least give the homotopy effect (maybe again) from a path to convex hull... – percusse Apr 17 '12 at 21:45
  • @percusse That might work. I do not necessarily have to use regions either... just something I thought that would be visually the best. Could you give me an MWE for the mindmaps with possible two or three different flavors(maybe the way your thinking now and some way where the dots are just connected in a cool visual way)? (I just don't know enough about tikz and quite busy lately or I would sit down with it for a day to figure out) – Uiy Apr 18 '12 at 02:31

0 Answers0