Learn R Programming

tooth (version 0.5.0)

draw_tooth: Draw a single tooth as polygon geometry

Description

Produces crown surface wedges (B/L/M/D/O) and up to four root surface bars (RB/RL/RM/RD), plus labels, outlines, and diagonals — all as data frames ready for ggplot2. Any surface can be excluded via the surfaces argument.

Usage

draw_tooth(
  tooth_id,
  quadrant,
  tooth_num,
  is_upper,
  surface_values,
  value_col = "prop",
  x_offset = 0,
  y_offset = 0,
  tooth_size = 1,
  show_roots = TRUE,
  surfaces = c("buc", "lin", "mes", "dis", "occ", "rootb", "rootl", "rootm", "rootd"),
  display_label = NULL
)

Value

Named list of tibbles: crown, roots, labels, num_label, diags, outline.

Arguments

tooth_id

Character label, e.g. "ur1".

quadrant

One of "ur", "ul", "lr", "ll".

tooth_num

Numeric position within the quadrant.

is_upper

Logical; TRUE for upper arch.

surface_values

Data frame with tooth_surface and a value column. Recognised surfaces: buc, lin, mes, dis, occ, rootb, rootl, rootm, rootd.

value_col

Name of the value column in surface_values.

x_offset, y_offset

Numeric offsets for positioning.

tooth_size

Numeric side length of the crown square (default 1).

show_roots

Logical; draw root surface bars (default TRUE).

surfaces

Character vector of surfaces to include. Omit any you don't want drawn.

display_label

Optional custom label for the tooth number (e.g. FDI notation "11" instead of "ur1"). When NULL, uses tooth_id.