TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)
share|improve this question

closed as too localized by percusse, Joseph Wright Oct 6 '12 at 22:20

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

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

Browse other questions tagged or ask your own question.