Graphics, Figures & TablesTikZ clean edges

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Andreas Knafl
Posts: 11
Joined: Mon Jun 20, 2016 11:28 pm

TikZ clean edges

Post by Andreas Knafl »

Hey Guys!
I´m about to create a simple figure with TikZ and I´ve no idea how to solve the following problem:

So, there is this figure consiting of two arcs an two lines (the area is filled)

Code: Select all

\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}
\filldraw[fill=black,opacity=.2]
(4,0) arc (0:180:1.5)
(0,0) arc (180:0:2.5);
\draw [line width=1pt] 
(0,0) arc (180:0:2.5) -- 
(5,0) -- (4,0) --
(4,0) arc (0:180:1.5) -- cycle;
\end{tikzpicture}

\end{document}
I´ve managed to close three of the four edges in a clean way, but the 4th (in the right corner) won´t close the way I want it to.

May somebody can help me?

Thank you!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
TikZ book
BlackForestrian

TikZ clean edges

Post by BlackForestrian »

Andreas Knafl wrote: I´ve managed to close three of the four edges in a clean way, but the 4th (in the right corner) won´t close the way I want it to.
I see a closed half-ring, with a very thin line connecting the inner ring at the bottom. Is that what bothers you?
Andreas Knafl
Posts: 11
Joined: Mon Jun 20, 2016 11:28 pm

TikZ clean edges

Post by Andreas Knafl »

Hello BlackForestrian !
Thank you for the fast response!
No

When you Zoom in to the right outer edge, you will see that the arc doesn't connect to the line like in the opposit corner
It isn't that "smooth"
Andreas Knafl
Posts: 11
Joined: Mon Jun 20, 2016 11:28 pm

TikZ clean edges

Post by Andreas Knafl »

I´ve just solved it!

One can draw e.g.:

acre -- point -- acre

so the corners will be continous

not like this

|      |
|      |
|     |
____| _|
|
_______|


more like this!

|      |
|      |
|     |
____| |
|
_________|


although thanks!
Post Reply