bone
A package to draw structural analysis and kinetimatic diagrams
| Repository | GitHub |
| Typst Universe | bone |
| License | LGPL-3.0-or-later |
| Last update | 2026-01-22 |
Ask it on the community forum.
Please report it.
Introduction
This project was created during my studies at EPFL 🇨🇭, and I was inspired by the diagrams look from stanli by Jürgen Hackl. Bone is also inspired from standards and courses I got during my studies.
Warning
This project is still in early stage. Only the 2D representation and basic functionalities are working, but work for 3D schematics will soon be on its way. You can follow #1 for more information on the progress.Example
The following example demonstrates the capabilities of this library. The code is available on the GitHub repository, and the original drawing in LaTeX made using stanli is available on CTAN (TeX Archive Network).
Getting started
Bone has been thought from the beginning to be as easy to use as stanli was for LaTeX, except you can just import it in your documents using the Typst Universe registry. No need to download it manually.
#import "@preview/bone:0.1.0"
#bone.diagram({
import bone: *
beam("d", (0, 0), (0, 2))
frame("f1", (0, 0))
})
Note that you are free to include bone directly into any CeTZ drawing you would like. The diagram here is just a cover for the native canvas.
Support
You have multiple support at your disposal.
#bone.diagram({
import bone: *
beam((2, 0), (2, 2), dx: .5)
support((2, 0))
support2((4, 0))
})
Beams
Beams can be used to either represent a real beam (I-shaped, T-shapes, etc.), or anything to just a segment from a robot (arm, forearm). They are drawn between two points, and support bending as well as custom bending positions.
#bone.diagram({
import bone: *
beam((2, 0), (2, 2), dx: .5)
support((2, 0))
})
#bone.diagram({
import bone: *
beam((2, 0), (2, 2), dx: .5)
support((2, 0))
})
Options
| Name | Default value | Alias | Image |
|---|---|---|---|
invert |
false |
iopamp |
Joints
Bone supports out of the box three kinds of rotational joints, including 1 DOF (simple pivot), 2 DOF (cardan/standard pivot) and 3 DOF pivots (spherical pivot).
#bone.diagram({
import bone: *
hinge((0, 0))
spherical((1, 0))
})
It also supports linear joints, such as 1 DOF (prismatic joints).
Decorations
You can decorate each pivot with markings, such as
Forces and moments
Whenever you want, you are free to create
#bone.diagram({
import bone: *
draw.anchor("a", (0, 0))
draw.anchor("b", (3, 0))
support("a", angle: -90deg)
beam("a", "b")
force("b")
})
Distributed forces
#bone.diagram({
import bone: *
draw.anchor("a", (0, 0))
draw.anchor("b", (2, 1))
draw.anchor("c", (5, 1))
beam("a", "b", "c")
dforce("a", "b")
dforce("b", "c")
})
Dimensioning
You will often want to add different dimensions to some parts of your diagrams. To do this, just use xdim/ydim, it will add a line with the given value projected onto the corresponding axis.
#bone.diagram({
import bone: *
draw.anchor("a", (0, 0))
draw.anchor("b", (2, 1))
draw.anchor("c", (5, 0))
beam("a", "b", "c")
xdim("a", "b")[$L_1$]
xdim("b", "c")[$L_2$]
ydim("a", "b")[$h$]
dim("a", "c", distance: -0.4)[$Delta x$]
})
Annotations
Bone provides a few functions adapted from cetz, to display any information of any kind (content, text, image, etc.).
#bone.diagram({
import bone: *
draw.anchor("a", (0, 0))
hinge("a")
label("a", padding: 9pt)[f]
})