Graphics, Figures & TablesDimensioning of a Curve in Technical Drawings

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Faseeh
Posts: 14
Joined: Mon Jan 04, 2016 10:23 am

Dimensioning of a Curve in Technical Drawings

Post by Faseeh »

Hello !

I came across this thread http://tex.stackexchange.com/questions/ ... g-diagrams
on stackexchange that describes how to mark dimensions of a technical drawing and there are two popular responses there. From the post i found that i can use tikz-dimline package for such tasks and i have used it for marking straight lines. But the package documents does not describe how to use it for curves for example a simple arc. Kindly guide me how to use this package for dimensioning curves.

Secondly I will be really thankful if someone explains how Martin Scharrer's answer on the thread is working, I am unable to understand how the code is working.

Thank you,
Faseeh

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

Dimensioning of a Curve in Technical Drawings

Post by Stefan Kottwitz »

Hi Faseeh!

The tikz-dimline package supports only straight lines. The key line in the file is this one:

\draw[line] (a.center) -- (b.center) node[label] {#4};

It draws a straight line -- between the given points, with a text node in the middle. Simple, but it's not foreseen to change it. The whole code looks complicated, but it's mainly for setting options for line and label style. It's like taking a sledgehammer to crack a nut. :-)

You could use your desired line and label style even without that package. Another option would be to extend that package.
  • Do you have a complex and nice looking example of how you use it, currently? We may see if it's easy adjustable. The more complex/complete/big the example, the better would be a solution similar to tikz-dimline.
  • Do you have an example where you need arcs?
Stefan
LaTeX.org admin
Faseeh
Posts: 14
Joined: Mon Jan 04, 2016 10:23 am

Dimensioning of a Curve in Technical Drawings

Post by Faseeh »

Hello Stefan,

Sorry for replying late, I don't have a very complex drawing. Infact i was fascinated by tikz-example gallery, and was trying to learn how to make such drawings. And yes you are right, such dimensioning could be done without using this package. Here is the code that i was working with but problem is the extension lines (if i don't use this package). This might not be the best code written as my tikz knowlege is limited:

Code: Select all

\documentclass[tikz,border=2mm]{standalone}
\usepackage{tikz-dimline}\pgfplotsset{compat=newest}
\usetikzlibrary[arrows] % ConTEXt when using Tik Z

\begin{document}
\begin{tikzpicture}[scale=2]
\draw [help lines][dotted, lightgray](0,0)grid(10,10);

\draw[thick](1,1)--+(3,0)arc[radius=1,start angle=270,end angle=360]--(2.5,2);
\draw[thick](2,2.5)arc[radius=0.5,start angle=90,end angle=360];
\draw[thick](2,2.5)--+(0,1.5);
\draw[thick](2,4)arc[radius=1,start angle=90, end angle =180]--(1,1);

%Dimensions
\draw [thick,>=latex,|<->|] (4,0.7) arc [radius=1.3, start angle=270, end angle= 360];
\dimline[line style = {line width=0.7},
extension start length=+0.3,
extension end length=+0.3] {(0.7,1)}{($ (0.7,1) + (0,3) $)}{$3.0$};

\end{tikzpicture}
\end{document}
Thank you!
Faseeh
User avatar
Stefan Kottwitz
Site Admin
Posts: 10319
Joined: Mon Mar 10, 2008 9:44 pm

Dimensioning of a Curve in Technical Drawings

Post by Stefan Kottwitz »

Hi Faseeh,

just add the styles you like to use to your preamble:

Code: Select all

\tikzset{%
       arc/.style = { thick, >=latex, |<->|},
  arclabel/.style = { midway, sloped, fill = white, align = center},
}
Then use them:

Code: Select all

\draw [arc] (4,0.7)
  arc [radius=1.3, start angle=270, end angle= 360] node[arclabel] {$4.0$};
dimension-line.png
dimension-line.png (7.68 KiB) Viewed 3054 times
Stefan
LaTeX.org admin
Post Reply