Skip to content

About

πŸŒ‰ a TikZ command set for structural mechanics drawings

Resources

Stars

10 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

structmech

CTAN License: GPL v3 LaTeX

A TikZ command set for structural and material mechanics drawings.

structmech turns a handful of node coordinates into the diagrams you would otherwise draw by hand: member forces, nodal forces and displacements, boundary conditions, internal force distributions, deformed shapes, and more β€” usually with one single command.

\documentclass{article}
\usepackage{structmech}
\begin{document}
\begin{tikzpicture}
  \FixedSupport{0,0}
  \BasicForce{0,0}{5,0}{M}
  \UDL{0,0}{5,0}[10]
\end{tikzpicture}
\end{document}

Features

  • Member forces & displacements β€” \BasicForce draws axial force, and/or end bending moments (or all three) on a member, with optional labels for each component.
  • Nodal forces & displacements β€” \NodalForce draws horizontal, vertical, and rotational arrow quantities at a node, rotated and scaled as needed.
  • Loads β€” \UDL draws uniformly distributed loads on any member, including inclined ones, with flip and scaling support.
  • Supports β€” \HingeSupport, \FixedSupport, \RollerSupport, \SliderSupport, \SleeveSupport, and \Rigid, all rotatable and scalable.
  • Internal force diagrams β€” \IForceA for linear distributions and \IForceB for parabolic ones (e.g. bending moments under a UDL).
  • Deformed shapes β€” \BeamDeformP (perpendicular translation + rotation) and \BeamDeformR (rotation only).
  • Extras β€” \Spring, \Dashpot, and \CoorOrigin for coordinate system frames.
  • Consistent styling β€” colours, sign convention, value labels, opacity, and line width are controlled globally via package options or \setstructmech{...}, so a whole figure can be restyled without touching individual commands.

Installation

From CTAN or your TeX distribution:

tlmgr install structmech

Or simply copy structmech.sty next to your .tex file. It depends only on standard packages: tikz, kvoptions, xkeyval, xparse, and xstring.

Usage

Load the package with optional key–value settings:

\usepackage[axis=red,convention=direction,opacity=.4]{structmech}
Option Values Purpose
fill colour Fill patch colour (loads, rigid constraints, diagrams)
line colour Line colour
node colour Nodal force/displacement colour
axis colour Axial force/displacement colour
rotation colour Rotational force/displacement colour
convention sign / direction Draw all quantities positively with a minus sign, or draw negatives in the negative direction with positive labels
showvalue on / off Show values on internal force diagrams
absvalue on / off Show absolute values on internal force diagrams
opacity number (default 0.4) Fill patch opacity
linewidth dimension (default 0.4mm) Line width

Settings can be changed anywhere in the document:

\setstructmech{axis=red,linewidth=.6mm}

Command overview

Command Draws
\NodalForce Nodal force/displacement arrows
\BasicForce Member axial force and/or end moments
\UDL Uniformly distributed load
\HingeSupport, \FixedSupport, \RollerSupport, \SliderSupport Standard supports
\SleeveSupport, \Rigid Sleeve support and rigid constraint
\IForceA, \IForceB Linear and parabolic internal force diagrams
\BeamDeformP, \BeamDeformR Beam deformation shapes
\Spring, \Dashpot Spring and dashpot elements
\CoorOrigin Coordinate system frame

Documentation

The full manual, with the syntax, every optional argument, and worked examples for each command, is included in this repository:

Note that internal forces follow the sign convention adopted in the finite element method rather than the one used in material mechanics; all quantities are defined in the local coordinate system. See the manual for details.

Contributing

Contributions are welcome β€” feel free to redistribute, extend, or rewrite the functionality. Open an issue or a pull request at TLCFEM/structmech.

License

Copyright Β© 2018–2023 Theodore Chang.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

About

πŸŒ‰ a TikZ command set for structural mechanics drawings

Resources

Stars

10 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages