1 Jul 2009 08:18

### color shading: bug or feature

Hi,

pdfLaTeXing the following example I get a very thin line around the
filled area. Unfortunately this is not only to be seen while enlarging
the picture, but also when showing a presentation. Is it possible to
suppress this behavior?

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\fill[left color=white,right color=black] (0,0) rectangle (10,0.1);
\end{tikzpicture}
\end{document}

Best regards,

Juergen

------------------------------------------------------------------------------

_______________________________________________
pgf-users mailing list
pgf-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgf-users

3 Jul 2009 08:23

### first steps with 3-D drawings

Hi,

I'm trying to do first steps with creating three-dimensional drawings
with pgf/TikZ. My first attempt was Sketch, but I really need curves,
circles and so on (while the graphs are quite simple at all).

My next step are currently the examples shown on Kjell's great
TikZ-page. Here arouses the following question. When analyzing
the example 3d-graph-model.tex by Andreas Menge I tried to
integrate a circle. But it seems that the pgftransformcm and my
definition of the circle (in line 62) don't harmonize. I'd really appreciate
it if someone can give me a hint where my mistake is.

Regards,

Juergen

% Author: Andreas Menge
\documentclass[10pt]{article}
\usepackage{tikz}
%%%<
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}%
%%%>

\begin{comment}
:Title: A simple graph-model in 3D
:slug: 3d-graph-model

A simple graph-model in 3D with a helping grid but not with a rotation of 45 degrees to avoid overlapping edges. The graph lines are drawn with a white background to visualize the ones closer to the viewer and hence improve the 3D-view. Code duplication is reduced.

\end{comment}

%transforms all coordinates the same way when used (use it within a scope!)
%(rotation is not 45 degress to avoid overlapping edges)
% Input: point of origins x and y coordinate
\newcommand{\myGlobalTransformation}[2]
{
\pgftransformcm{1}{0}{0.4}{0.5}{\pgfpoint{#1cm}{#2cm}}
}

% draw a 4x4 helper grid in 3D
% Input: point of origins x and y coordinate and additional drawing-parameters
\newcommand{\gridThreeD}[3]
{
\begin{scope}
\myGlobalTransformation{#1}{#2};
\draw [#3,step=2cm] grid (8,8);
\end{scope}
}

\tikzstyle myBG=[line width=3pt,opacity=1.0]

% draws lines with white background to show which lines are closer to the
% viewer (Hint: draw from bottom up and from back to front)
%Input: start and end point
\newcommand{\drawLinewithBG}[2]
{
\draw[white,myBG]  (#1) -- (#2);
\draw[black,very thick] (#1) -- (#2);
}

% draws all horizontal graph lines within grid
\newcommand{\graphLinesHorizontal}
{
\drawLinewithBG{1,1}{7,1};
\drawLinewithBG{1,3}{7,3};
\drawLinewithBG{1,5}{7,5};
\drawLinewithBG{1,7}{7,7};
%    \fill[red,opacity=0.5] (4,4) circle (1.5cm);
}

% draws all vertical graph lines within grid
\newcommand{\graphLinesVertical}
{
%swaps x and y coordinate (hence vertical lines):
\pgftransformcm{0}{1}{1}{0}{\pgfpoint{0cm}{0cm}}
\fill[red,opacity=0.5] (2,2) circle (1.5cm); <--- this circle isn't transformed <--- <--- <---
\graphLinesHorizontal;
}

%draws nodes of the grid
%Input: point of origins x and y coordinate
\newcommand{\graphThreeDnodes}[2]
{
\begin{scope}
\myGlobalTransformation{#1}{#2};
\foreach \x in {1,3,5,7} {
\foreach \y in {1,3,5,7} {
\node at (\x,\y) [circle,fill=black] {};
%this way circle of nodes will not be transformed
}
}
\end{scope}
}

\begin{document}
\pagestyle{empty}

\begin{tikzpicture}

%draws helper-grid:
\gridThreeD{0}{0}{black!50};
\gridThreeD{0}{4.25}{black!50};

%draws lower graph lines and those in z-direction:
\begin{scope}
\myGlobalTransformation{0}{0};
\graphLinesHorizontal;

%draws all graph lines in z-direction (reset transformation first!):
\foreach \x in {1,3,5,7} {
\foreach \y in {1,3,5,7} {
\node (thisNode) at (\x,\y) {};
{
\pgftransformreset
\draw[white,myBG]  (thisNode) -- ++(0,4.25);
\draw[black,very thick] (thisNode) -- ++(0,4.25);
}
}
}
\end{scope}

%draws upper graph-lines:
\begin{scope}
\myGlobalTransformation{0}{4.25};
\graphLinesVertical;
\end{scope}

% draws all graph nodes:
\graphThreeDnodes{0}{0};
\graphThreeDnodes{0}{4.25};

\end{tikzpicture}

\end{document}

------------------------------------------------------------------------------

_______________________________________________
pgf-users mailing list
pgf-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pgf-users

4 Jul 2009 02:15

### Re: first steps with 3-D drawings

"Goebel, Juergen" <juergen.goebel <at> eads.com> writes:

> My next step are currently the examples shown on Kjell's great
> TikZ-page. Here arouses the following question. When analyzing the
> example 3d-graph-model.tex by Andreas Menge I tried to integrate a
> circle. But it seems that the pgftransformcm and my definition of the
> circle (in line 62) don't harmonize. I'd really appreciate it if
> someone can give me a hint where my mistake is.

I typeset the file, and I don't see what you mean by "don't
harmonize". Maybe it would help if you try to explain it. Also it would
help if you reduce the example to some really minimal elements.
Best regards.

------------------------------------------------------------------------------

4 Jul 2009 11:03

### Setting tikz arrow style

Dear all,

I did scan the manual, but I don't seem to be able
to find how to set a tikz arrow tip style using the
\tikzstyle command.

I've tried obvious things like
\tikzstyle Arrows=[ultra thin,color=red,>=angle 45]
but this doesn't draw the arrow tips. What am I missing?

Regards,

Marc van Dongen

------------------------------------------------------------------------------

4 Jul 2009 12:56


Compiling the following with XeLaTeX produces a misaligned hyperlink.
Researching the problem, I have read that it was fixed for XeTeX.
Compiling with pdflatex presents no issue at all.
I am using version 2.0.
Is there a workaround?
Thanks

\documentclass[10pt]{article}
\usepackage{tikz}
\usepackage{hyperref}

\begin{document}

\begin{tikzpicture}

\node [fill=red,rounded corners=5pt]
{\href{foo}{bar bar bar}};

\end{tikzpicture}

\end{document}
http://www.nabble.com/file/p24294192/20090701-nhqtm1x39gqqj7fsawf2tp4x2d.png
--

--
View this message in context: http://www.nabble.com/Hyperlinks-%2B-XeLaTeX-tp24294192p24294192.html
Sent from the pgf-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------

6 Jul 2009 07:02

### Re: first steps with 3-D drawings

> Rafael wrote:

> I typeset the file, and I don't see what you mean by "don't
> harmonize". Maybe it would help if you try to explain it.
> Also it would
> help if you reduce the example to some really minimal elements.
> Best regards.

Ok, let me try it again. During the weekend I played a bit with
TikZ. So my question changes to ...

When pdfLaTeXing the following example the text isn't transformed.
Of course I can achieve this manually with xslant and yslant, but
this is far from being elegant. I'm quite sure that there is a
better way. What do I have to do?

Greetings,

Juergen

\documentclass[10pt]{article}
\usepackage{tikz}
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}%

\newcommand{\cubeface}[2]{%
\fill[#1,opacity=0.25] (1,1) circle (1cm);
\draw[miter limit=1] (0,0) rectangle (2,2);
\draw[#1!50,thin,shorten >= 3pt,shorten <= 3pt] (0,0) -- (2,2);
\draw[#1!50,thin,shorten >= 3pt,shorten <= 3pt] (0,2) -- (2,0);
\path (1,1) node[font=\small\bfseries,text=#1!50!black] {#2};
}

\begin{document}
\begin{tikzpicture}
\pgftransformcm{1}{0}{0.4}{0.5}{\pgfpoint{0cm}{0cm}}
\cubeface{blue}{unten}
\pgftransformreset
\pgftransformcm{1}{0}{0}{1}{\pgfpoint{0.8cm}{1cm}}
\cubeface{red}{hinten}
\pgftransformreset
\pgftransformcm{0.4}{0.5}{0}{1}{\pgfpoint{0cm}{0cm}}
\pgftransformreset
\pgftransformcm{0.4}{0.5}{0}{1}{\pgfpoint{2cm}{0cm}}
\cubeface{red}{rechts}
\pgftransformreset
\cubeface{red}{vorn}
\pgftransformcm{1}{0}{0.4}{0.5}{\pgfpoint{0cm}{2cm}}
\cubeface{green}{oben}
\end{tikzpicture}
\end{document}

------------------------------------------------------------------------------

8 Jul 2009 11:51

### feature request

Hi,

I would really like a feature like this one:

\draw (A) -|- (B);

for

(A) -------+
|
|
|
|
|
+-------- (B)

and correspondingly

\draw (A) |-| (B);

for

(A)
|
|
+--------------------+
|
|
(B)

Is this possible?

Regards,

Juergen

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> pgf-users mailing list
> pgf-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pgf-users
>
>

--

--
robert papanicola
http://www.sciences-indus-cpge.apinc.org/
http://www.medicalistes.org/~maxime-plus/

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge  8 Jul 2009 14:33 ### Re: feature request Hi, What about: \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \def\pos{0.5} \def\drawHVH(#1)(#2){ \draw ($\pos*(#2) + (#1) - \pos*(#1)$) node[coordinate] (middle) {};% \draw (#1) -| (middle) |- (#2); } \begin{document} \begin{tikzpicture} \node[circle,draw] (a) at (0,0) {A}; \node[circle,draw] (b) at (5,3) {B}; \node[circle,draw] (c) at (-5,-3) {C}; \drawHVH(a)(b) \def\pos{0.8} \drawHVH(a)(c) \end{tikzpicture} \end{document} You can easily adapt it for the other case... To get your solution you only need to modify the tikz parser... Fabien "Goebel, Juergen" <juergen.goebel <at> eads.com> a écrit : > Hi, > > I would really like a feature like this one: > > \draw (A) -|- (B); > > for > > (A) -------+ > | > | > | > | > | > +-------- (B) > > and correspondingly > > \draw (A) |-| (B); > > for > > (A) > | > | > +--------------------+ > | > | > (B) > > Is this possible? > > Regards, > > Juergen > ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to$100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge

8 Jul 2009 15:51

### Re: feature request

Fabien.Dagnat <at> telecom-bretagne.eu wrote:

> \documentclass{article}
> \usepackage{tikz}
> \usetikzlibrary{calc}
> \def\pos{0.5}
> \def\drawHVH(#1)(#2){
>    \draw ($\pos*(#2) + (#1) - \pos*(#1)$) node[coordinate]
> (middle) {};%
>    \draw (#1) -| (middle) |- (#2);
> }
> \begin{document}
>
> \begin{tikzpicture}
>    \node[circle,draw] (a) at (0,0) {A};
>    \node[circle,draw] (b) at (5,3) {B};
>    \node[circle,draw] (c) at (-5,-3) {C};
>    \drawHVH(a)(b)
>    \def\pos{0.8}
>    \drawHVH(a)(c)
> \end{tikzpicture}
> \end{document}

Thanks a lot (also to Robert)!

> You can easily adapt it for the other case...

ACK.

> To get your solution you
> only need to modify the tikz parser...

No problem, it'll take just five minutes or so. )

Best,

Juergen

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to \$100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge


Gmane