Give a 5 page answer on Metallurgy in orthopaedics from standard orthopaedic textbooks for orthopaedic rguhs pg exams

Reading File
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Reading File
Finding Sources
Reading File
Finding Sources
Finding Sources
Reading File
Reading File
Reading File
Reading File
Finding Sources
Loading Image
I now have everything needed for a comprehensive 5-page exam answer. Let me compose it.

METALLURGY IN ORTHOPAEDICS

Sources: Miller's Review of Orthopaedics 9th Ed, Campbell's Operative Orthopaedics 15th Ed 2026, Rockwood & Green's Fractures in Adults 10th Ed 2025

1. INTRODUCTION AND BASIC CONCEPTS

Metallurgy is the science of the properties, processing, and behavior of metals and alloys. In orthopaedics, it underpins the selection, design, and clinical performance of every metallic implant - from a simple cortical screw to a total joint replacement. The ideal orthopaedic metal must be biocompatible, corrosion-resistant, mechanically strong enough to bear physiological loads, and have a modulus of elasticity that ideally approaches that of bone to minimise stress shielding.
Key mechanical terms:
  • Young's modulus (E) / Modulus of Elasticity: The slope of the stress-strain curve in the elastic region. A higher E means a stiffer material. Matching the stiffness of bone reduces stress shielding.
  • Yield strength: The stress at which permanent (plastic) deformation begins (0.2% offset method).
  • Ultimate tensile strength (UTS): Maximum stress a material can withstand before fracture.
  • Fatigue strength: The stress below which the material can withstand an infinite number of loading cycles without failure - critical for cyclic in vivo loading.
  • Ductility: The ability to undergo plastic deformation before fracture. Metals are ductile; ceramics are not.
  • Hardness: Resistance to surface deformation, related to wear performance.

2. CLASSIFICATION OF METALLIC ALLOYS IN ORTHOPAEDICS

There are three main families of metallic alloys used in orthopaedic implants:

A. Iron-Based Alloys - Stainless Steel (316L)

Composition: Iron-carbon base, with chromium (10-18%), nickel, molybdenum, and manganese.
Each alloying element has a specific role:
  • Chromium: Forms a passive surface oxide layer, thereby improving corrosion resistance.
  • Nickel: Increases corrosion resistance and stabilises the face-centred cubic (austenitic) molecular structure.
  • Molybdenum: Prevents pitting and crevice corrosion.
  • Manganese: Improves crystalline stability.
  • "316L" - the "L" denotes low carbon content, which confers greater corrosion resistance by preventing chromium carbide precipitation at grain boundaries.
Mechanical properties (Rockwood & Green, Table 12.1):
  • Ultimate tensile strength: >500 MPa (annealed), >850 MPa (cold worked)
  • Yield strength: >200 MPa (annealed), >700 MPa (cold worked)
  • Elastic modulus: 200,000 MPa (200 GPa) - approximately 14x stiffer than cortical bone
Processing: Cold working (cold forging) dramatically improves the strength of stainless steel compared to annealed forms.
Clinical uses: Trauma implants (plates, nails, screws, wires), spinal implants, temporary internal fixation. Less preferred for long-term arthroplasty because of inferior corrosion resistance compared to titanium and cobalt-chrome, and susceptibility to nickel sensitisation.
Disadvantages: Risk of nickel and chromium sensitisation; galvanic corrosion when combined with other metals; high modulus compared to bone; inferior corrosion resistance compared to titanium alloys.

B. Cobalt-Based Alloys - Co-Cr-Mo

Composition: Approximately 65% cobalt, 35% chromium, 5% molybdenum. Nickel may be added to improve ease of forging.
  • Cobalt: Provides the base matrix for high mechanical strength.
  • Chromium: Provides corrosion resistance via passive oxide formation.
  • Molybdenum: Refines grain structure and improves strength.
Mechanical properties (Rockwood & Green, Table 12.1):
  • Cast: UTS >450 MPa, Elastic modulus 20,000 MPa
  • Wrought annealed: UTS >300 MPa, yield >300 MPa
  • Wrought cold-worked: UTS >600 MPa, Elastic modulus 230,000 MPa
Cobalt-chrome alloy has the greatest ultimate strength of the three main groups and is stiffer than titanium (higher E). Co-Cr-Mo has superior wear resistance compared to titanium or stainless steel, making it the dominant choice for femoral heads and bearing surfaces.
Processing: A special forging process is used to optimise grain structure. Wrought (forged) Co-Cr has superior mechanical properties compared to cast Co-Cr.
Clinical uses:
  • Femoral heads in total hip arthroplasty (THA)
  • Total knee arthroplasty femoral components
  • Cemented femoral stems (preferred over titanium for cemented stems due to higher stiffness - compressive load is transmitted through the cement mantle)
  • Spinal instrumentation rods
Ion release: Cobalt-chromium ions released during wear or corrosion cause macrophage proliferation and synovial degeneration. Ions are excreted via the kidneys. This is the biological basis of metal-on-metal (MOM) hip complications and adverse local tissue reactions (ALTR).

C. Titanium-Based Alloys

Standard alloy: Ti-6Al-4V (6% aluminium, 4% vanadium). Also used as commercially pure titanium (CP-Ti).
Properties:
  • Elastic modulus: ~100,000 MPa (100 GPa) - approximately half that of stainless steel and Co-Cr, and much closer to cortical bone (15,000 MPa). This is titanium's most important clinical advantage.
  • Extremely biocompatible - the most biocompatible of all orthopaedic metals.
  • Self-passivation: Titanium rapidly forms an adherent TiO₂ (titanium dioxide) oxide layer, conferring excellent corrosion resistance. This occurs almost instantaneously when the surface is scratched.
  • Fatigue properties: Superior fatigue resistance compared to stainless steel.
  • Yield strength: 800 MPa (Ti-6Al-4V alloy)
  • UTS: 900 MPa (Ti-6Al-4V alloy)
Disadvantages of titanium:
  • Poor wear resistance - notch sensitivity makes it susceptible to fretting and abrasion.
  • High coefficient of friction at articulating surfaces - therefore NOT used for femoral heads or bearing surfaces.
  • Titanium wear particles incite a histiocytic (macrophage) response.
  • The relationship between titanium and neoplasia is uncertain but has been raised in the literature.
  • In the "soft" titanium alloy, the screw head recess is susceptible to deformation (stripping) during insertion.
Surface treatment: Polishing, passivation, and ion implantation improve titanium's fatigue properties.
Clinical uses:
  • Cementless femoral stems (preferred - low E minimises stress shielding, superior biocompatibility promotes osseointegration)
  • Acetabular shells in THA
  • Spinal cages and implants
  • External fixator pins
  • Intramedullary nails (titanium alloy)
  • Fracture fixation plates
  • Osseointegrated implants and dental implants
Comparative stiffness (Miller's Review):
"Cobalt-chrome (Co-Cr) alloy is stiffer than titanium alloy. Therefore, titanium is preferred for cementless femoral stems (lower E = less stress shielding), while Co-Cr is preferred for cemented stems."

D. Tantalum (Trabecular Metal)

Tantalum is a relatively newer material in orthopaedic use. It is fabricated as a porous trabecular metal on a carbon substrate with elemental tantalum deposited on the surface.
Key properties:
  • Highly porous structure (porosity 75-80%) that closely mimics cancellous bone architecture.
  • Modulus of elasticity closer to bone than stainless steel or cobalt-chrome alloys.
  • Remarkable resistance to corrosion.
  • The surface oxide layer acts as a barrier to corrosion.
  • Highly conducive to bone ingrowth (bone ingrowth occurs readily into its porous architecture).
Clinical uses:
  • Augmentation of cancellous bone defects (acetabular reconstruction)
  • Revision arthroplasty with significant bone loss
  • Spinal interbody cages

3. YOUNG'S MODULUS COMPARISON - CLINICAL SIGNIFICANCE

The figure below (from Miller's Review of Orthopaedics, Fig. 1.58) compares the Young's modulus of orthopaedic materials:
Comparison of Young's modulus for orthopaedic materials - ranked from stiffest to most compliant: Al2O3 ceramic, Co-Cr-Mo alloy, stainless steel, titanium, cortical bone, PMMA, polyethylene, cancellous bone, tendon/ligament, cartilage
Ranked stiffest to most compliant:
  1. Al₂O₃ (Alumina ceramic) - highest E
  2. Co-Cr-Mo alloy (~230 GPa)
  3. Stainless steel 316L (~200 GPa)
  4. Titanium alloy (~100 GPa)
  5. Cortical bone (~15 GPa)
  6. PMMA / Bone cement (~2 GPa)
  7. Polyethylene (~1 GPa)
  8. Cancellous bone (~1 GPa)
  9. Tendon / ligament
  10. Cartilage - lowest E
Engineering Properties Table (Rockwood & Green, Table 12.1):
MaterialUTS (MPa)Yield Strength (MPa)Elastic Modulus (MPa)
Cortical bone1008015,000
Titanium (Ti-6Al-4V)900800100,000
Stainless steel 316L (cold worked)>850>700200,000
Co-Cr (wrought, cold worked)>600>500230,000
PMMA (bone cement)40-2,000
Polyethylene40201,000

4. CORROSION IN ORTHOPAEDIC METALS

All metals corrode in a saline (physiological) environment. The body's high-saline milieu is highly corrosive. Corrosion is defined as the gradual destruction of a metal by chemical reaction with its environment (oxidation).
Passivation: The formation of a thin, adherent, protective metal oxide layer on the surface that acts as a barrier to further oxidation. All orthopaedic metals rely on passivation.
  • Titanium: forms TiO₂ - passivates almost instantaneously (self-passivation)
  • Stainless steel: chromium oxide (Cr₂O₃)
  • Co-Cr: chromium oxide layer
Types of Corrosion (Miller's Review, Fig. 1.57):
1. Uniform corrosion: Even, general loss of metal from the surface. The least clinically significant form.
2. Galvanic corrosion: Occurs when two dissimilar metals are in contact in an electrolyte (body fluid). The more active (anodic) metal undergoes accelerated corrosion. Example: mixing a titanium screw with a stainless steel plate. Clinical rule: never combine dissimilar metals in the same patient.
3. Pitting corrosion: Localised attack at microscopic defects on the passivation layer, producing deep pits. Molybdenum in stainless steel helps prevent this.
4. Crevice corrosion: Occurs in tight spaces (crevices) between components - e.g., between a screw head and plate, or modular junctions. Restricted diffusion in the crevice creates locally aggressive conditions (low oxygen, low pH) that accelerate oxidation. Stainless steel is more susceptible than titanium.
5. Fretting corrosion (mechanically assisted crevice corrosion): Small cyclic micro-motions (<100 μm) at a metal-metal interface mechanically disrupt the protective oxide layer, exposing fresh metal to oxidation repeatedly. This is the dominant corrosion mechanism at:
  • Screw-plate interfaces (especially when screws are not tightened sufficiently)
  • Modular junctions (head-neck taper in THA)
  • Nail-screw interlocks in intramedullary nailing
Fretting corrosion increases dramatically when two metal components can move relative to each other. The clinical implication is that implant constructs must be rigidly assembled and inserted correctly to minimise micromotion at junctions.

5. TRUNNION CORROSION (TRUNNIONOSIS) - A HIGH-YIELD TOPIC

Definition: Corrosion at the modular taper junction (trunnion) between the femoral head and the femoral stem in THA. It is a combination of fretting corrosion and crevice corrosion.
Mechanism: The cyclic loading of the hip generates micromotion at the head-stem taper junction. This disrupts the protective oxide layer repeatedly, releasing metal ions (cobalt and chromium). The process is a form of mechanically assisted crevice corrosion.
Risk factors for increased trunnion stress (and thus more corrosion):
  • Large-diameter femoral heads (increased lever arm / toggle effect on the taper)
  • Large femoral component offsets
  • Varus stem position
  • Mismatch of materials (e.g., cobalt-chrome femoral head on titanium stem)
Clinical consequences:
  • Metal ion release (cobalt and chromium ions)
  • Adverse local tissue reaction (ALTR) - similar pathologically to metal-on-metal (MOM) THA failure
  • Pseudotumour formation (soft tissue mass around the hip)
  • Metallosis (metal staining of periprosthetic tissues)
Diagnosis: Diagnosis of exclusion. Workup:
  • Serum metal ion levels: concern when cobalt >1 ppb in metal-on-polyethylene articulation
  • Cobalt-to-chromium ratio >5:1 is highly suggestive of a trunnion problem (rather than bearing surface corrosion)
  • MARS (metal artefact reduction sequence) MRI of the hip
Treatment: Revision of the femoral head to a ceramic head with a titanium sleeve adapter (protects the titanium trunnion). Stem revision is not required unless there is catastrophic trunnion damage.
Clinical pearl (Miller's Review, Testable Concepts): Trunnionosis is responsible for the widespread adoption of ceramic femoral heads as the primary choice in THA. Cobalt-chrome heads should be avoided if a titanium stem is used.

6. METAL SENSITIVITY AND ION RELEASE

Metal ion release occurs continuously from all orthopaedic metal implants through:
  • Corrosion
  • Wear (especially bearing surfaces)
Cobalt-chromium ions:
  • Macrophage proliferation and synovial degeneration
  • Ions are excreted via the kidneys
  • At high concentrations: associated with pseudo-tumour formation, ALTR, and systemic toxicity (cobalt cardiomyopathy, thyroid dysfunction, neurological effects in extreme cases)
Nickel and chromium sensitivity:
  • Nickel is the most common metallic sensitiser (Type IV delayed hypersensitivity)
  • Incidence of clinically significant metal sensitivity causing implant failure is low but not negligible
  • In sensitised patients, titanium implants are preferred
Titanium particulate:
  • Titanium wear particles (from fretting or scratch of titanium surfaces) incite a histiocytic response
  • Macrophage activation leads to periprosthetic osteolysis

7. STRESS SHIELDING AND THE MODULUS MISMATCH PROBLEM

Wolff's Law: Bone remodels in response to the mechanical stresses placed upon it. Bone not subjected to adequate stress undergoes resorption (disuse osteoporosis).
Stress shielding occurs when a metallic implant absorbs and carries load that should be borne by the bone, reducing the mechanical stimulus to periprosthetic bone. This causes adaptive bone resorption proximally (periprosthetic osteopenia), and predisposes to:
  • Implant loosening
  • Periprosthetic fracture
  • Difficult revision surgery
Factors affecting stress shielding (Campbell's Operative Orthopaedics):
  1. Modulus of elasticity: A lower E (titanium vs Co-Cr) transfers more load to bone. A decrease in modulus decreases stress in the stem and increases stress to surrounding bone.
  2. Stem diameter: Bending stiffness is proportional to the fourth power of the diameter - therefore small increases in diameter cause large increases in stiffness.
  3. Stem geometry: Solid, round, cylindrical stems are stiffer. Hollow stems, slotted designs, fluted tapers, and isoelastic designs are less stiff.
  4. Extent of porous coating: Extensively porous-coated stems with diaphyseal fixation transfer load distally, leading to proximal bone resorption.
    • Proximal porous coating: Loads are transferred through the porous coating into the metaphysis and proximal diaphysis, maintaining proximal bone density.
    • Extensive (full-length) porous coating: Bone ingrowth occurs in the diaphysis; proximal femur is stress-shielded and resorbs.
Typical scenario producing severe stress shielding (Miller's Review):
  • Large-diameter stem (16 mm or greater)
  • Cobalt-chrome alloy
  • Round, solid, cylindrical stem shape
  • Extensive porous coating
  • Diaphyseal bone loading (spot weld distally)
Cobalt-chrome vs titanium in cementless stems: Cobalt-chrome stems cause nearly double the proximal bone loss compared with titanium alloy femoral stems (meta-analysis by Knutsen et al., cited in Campbell's).

8. SURFACE FINISH AND FIXATION METHODS

The surface of an orthopaedic implant determines how it interfaces with bone. There are two broad categories:

Cemented Implants

  • Surface finish: Highly polished (smooth) or matt-finished (for microinterlock with cement)
  • Polished, collarless, tapered stems work by controlled subsidence within the cement mantle (the Exeter concept - composite beam theory)
  • Matt/roughened stems bond rigidly to cement (composite beam fixation)
  • Preferred material for cemented stems: Co-Cr alloy (higher stiffness better transmits load through the cement mantle to bone)

Cementless Implants

  • Surface finish: Porous-coated, plasma-sprayed titanium beads, sintered beads, or fibre metal mesh to allow bone ingrowth (osseointegration)
  • Hydroxyapatite (HA) coating: Plasma-sprayed calcium phosphate coating applied to titanium implants to accelerate and enhance bone apposition. HA acts as a scaffold for osteoblast attachment.
  • Preferred material: Titanium (lower E = less stress shielding; superior biocompatibility; self-passivation aids osseointegration)
  • Osseointegration requires implant stability at time of insertion (micromotion <50-150 μm)

9. FRACTURE FIXATION IMPLANTS - METALLURGICAL CONSIDERATIONS

Intramedullary Nails

  • Materials: Titanium alloy (Ti-6Al-4V) or stainless steel
  • Titanium IM nails: Lower modulus (load-sharing device), less stress shielding, superior fatigue properties, less stiff - allows physiological load sharing with bone
  • Advantages over plates: acts as load-sharing device, avoids stress shielding, less refracture after removal

Plates and Screws

  • Materials: 316L stainless steel or titanium alloy
  • Fretting corrosion at the screw-plate interface is the key corrosion mechanism
    • If a screw is not tightened sufficiently, cyclic bending loads are applied transverse to the screw long axis, leading to fretting corrosion and early screw failure
  • Mixing metals: Stainless steel screws must not be combined with titanium plates (and vice versa) - galvanic corrosion
  • Locking plates: Screws lock into threaded plate holes, creating an angular-stable, fixed-angle construct. The screw-plate interface has less fretting compared to conventional plates.
  • Cobalt-chromium-molybdenum is more wear-resistant than titanium - used for bearing surfaces

Corrosion prevention principles in fracture fixation (Campbell's Operative Orthopaedics):

  1. Do not scratch implants during insertion (disrupts passive oxide layer)
  2. Avoid using dissimilar metals together (galvanic corrosion)
  3. Ensure secure fixation to minimise fretting at interfaces
  4. Use passivated implants (all modern implants are passivated by the manufacturer)

10. NON-METALLIC AND SPECIAL MATERIALS (IN CONTEXT)

For completeness in the RGUHS exam context, metallurgy is often discussed alongside:

PMMA (Bone Cement)

  • Acts as a grout (space-filler/interlock), NOT as an adhesive
  • Mechanically interlocks with bone trabeculae and implant surface
  • Reaches ultimate strength within 24 hours
  • Strongest in compression, weak in tension and shear
  • Elastic modulus: ~2,000 MPa (low E - does NOT significantly contribute to load bearing)
  • Reducing voids (porosity) increases cement strength - achieved by vacuum mixing and centrifugation
  • Wear particles incite macrophage response and can cause aseptic loosening

Ceramics (Alumina - Al₂O₃, Zirconia - ZrO₂)

  • Good insulators (poor electrical conductors)
  • Biostable crystalline materials
  • Highest E (stiffest) and highest compressive strength of all implant materials
  • Low tensile strength and low crack resistance (brittle - catastrophic failure without plastic deformation)
  • Best wear characteristics against polyethylene, with the lowest oxidation rate
  • High surface wettability, high surface tension
  • Highly conducive to tissue bonding
  • Small grain size allows an ultrasmooth surface finish - less friction, diminished wear
  • Used for: femoral heads in THA (ceramic-on-polyethylene, ceramic-on-ceramic bearings)

Oxidised Zirconium (Oxinium - Smith & Nephew)

  • Zirconium metal alloy with a surface zirconium oxide ceramic coating
  • Combines the toughness of a metal core with the scratch resistance of a ceramic surface
  • Claimed to be more scratch-resistant than Co-Cr, reducing wear debris
  • Used as an alternative femoral head/femoral component material

Bioabsorbable Implants

  • PGA (polyglycolic acid), PLLA (poly-L-lactic acid), PDS (polydioxanone), PDLLA
  • PGA degraded by hydrolysis to pyruvic acid, excreted as CO₂ and water
  • Cannot be contoured intraoperatively (high glass transition temperature)
  • Used for: small fragment fixation, ligament anchors, interference screws

11. CLINICAL PEARLS AND HIGH-YIELD EXAM POINTS (RGUHS)

ConceptKey Fact
Stiffest orthopaedic metalCo-Cr-Mo (E ~230 GPa)
Most biocompatible metalTitanium
Self-passivating metalTitanium (forms TiO₂ rapidly)
Metal closest to bone stiffnessTantalum (trabecular metal)
Metal for cementless stemTitanium (lower E = less stress shielding)
Metal for cemented stemCo-Cr (higher stiffness, better cement interface)
Metal for femoral headCo-Cr or Ceramic (not titanium - poor wear)
Galvanic corrosion preventionNever mix dissimilar metals
Fretting corrosion siteScrew-plate interface; modular taper junctions
Trunnionosis treatmentCeramic head + titanium sleeve; no stem revision needed if stem intact
Co-Cr ion excretionKidneys
PMMA roleGrout - interlocks mechanically
Strongest in compressionPMMA, ceramics, cancellous bone
Bending stiffness relationProportional to radius⁴ of stem
316L "L" =Low carbon (better corrosion resistance)
Molybdenum rolePrevents pitting and crevice corrosion
Nickel role in SSIncreases corrosion resistance; stabilises austenitic structure
Stress shielding worst withLarge diameter + Co-Cr + solid round + extensive porous coat

12. SUMMARY

Metallurgy in orthopaedics is fundamentally about matching the right material to the right application based on the biomechanical environment, interface requirements, and biological response. The three main metallic families (316L stainless steel, Co-Cr-Mo alloys, and titanium alloys) each have distinct strengths and limitations defined by their composition and microstructure. Titanium's low elastic modulus and exceptional biocompatibility make it ideal for cementless biological fixation, while Co-Cr's hardness and wear resistance make it the material of choice for articulating bearing surfaces and cemented stems. Corrosion - particularly fretting and crevice corrosion at modular junctions - is the central metallic failure mechanism, and its prevention through proper implant selection, passivation, avoidance of dissimilar metals, and correct surgical technique is the cornerstone of implant longevity.

References:
  • Miller's Review of Orthopaedics, 9th Edition - Chapter 1 (Basic Science), Chapter 5 (Adult Reconstruction), pp. 117-118
  • Campbell's Operative Orthopaedics, 15th Edition 2026 - Chapter 4 (Hip Reconstruction - Stress Transfer), Chapter 30 (Biomaterials of Fracture Fixation)
  • Rockwood and Green's Fractures in Adults, 10th Edition 2025 - Chapter 12 (Biomechanics of Fracture Fixation, Table 12.1)

Make a pdf

Reading File
Running Command

ls /home/daytona/workspace/ 2>/dev/null && echo "---" && ls /home/daytona/worksp…

Running Command

mkdir -p /home/daytona/workspace/metallurgy-ortho && echo "created"

Writing File

~/metallurgy-ortho/generate_pdf.py

#!/usr/bin/env python3
"""Generate a well-formatted PDF on Metallurgy in Orthopaedics."""

from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib import colors
from reportlab.platypus import (
    SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
    HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus import PageBreak

OUTPUT = "/home/daytona/workspace/metallurgy-ortho/Metallurgy_in_Orthopaedics.pdf"

# ── Colours ──────────────────────────────────────────────────────────────────
NAVY   = colors.HexColor("#1a3a5c")
TEAL   = colors.HexColor("#1d6e8f")
LIGHT  = colors.HexColor("#e8f4f8")
HEADER = colors.HexColor("#d0e8f2")
ALT    = colors.HexColor("#f5fafc")
WHITE  = colors.white
BLACK  = colors.black
GREY   = colors.HexColor("#555555")

def make_styles():
    base = getSampleStyleSheet()

    styles = {
        "cover_title": ParagraphStyle(
            "cover_title", parent=base["Title"],
            fontSize=28, textColor=WHITE, alignment=TA_CENTER,
            spaceAfter=10, leading=34
        ),
        "cover_sub": ParagraphStyle(
            "cover_sub", parent=base["Normal"],
            fontSize=13, textColor=colors.HexColor("#cce8f5"),
            alignment=TA_CENTER, spaceAfter=6
        ),
        "cover_ref": ParagraphStyle(
            "cover_ref", parent=base["Normal"],
            fontSize=10, textColor=colors.HexColor("#aad4e8"),
            alignment=TA_CENTER, spaceAfter=4, italic=True
        ),
        "h1": ParagraphStyle(
            "h1", parent=base["Heading1"],
            fontSize=14, textColor=WHITE, backColor=NAVY,
            spaceBefore=14, spaceAfter=6, leading=18,
            leftIndent=-0.3*cm, rightIndent=-0.3*cm,
            borderPadding=(5, 8, 5, 8)
        ),
        "h2": ParagraphStyle(
            "h2", parent=base["Heading2"],
            fontSize=12, textColor=NAVY,
            spaceBefore=10, spaceAfter=4, leading=15,
            borderPadding=(2, 0, 2, 0)
        ),
        "h3": ParagraphStyle(
            "h3", parent=base["Heading3"],
            fontSize=11, textColor=TEAL,
            spaceBefore=8, spaceAfter=3, leading=13
        ),
        "body": ParagraphStyle(
            "body", parent=base["Normal"],
            fontSize=10, textColor=BLACK, alignment=TA_JUSTIFY,
            spaceAfter=5, leading=14
        ),
        "bullet": ParagraphStyle(
            "bullet", parent=base["Normal"],
            fontSize=10, textColor=BLACK, alignment=TA_LEFT,
            spaceAfter=3, leading=13, leftIndent=16, bulletIndent=4
        ),
        "bullet2": ParagraphStyle(
            "bullet2", parent=base["Normal"],
            fontSize=9.5, textColor=GREY, alignment=TA_LEFT,
            spaceAfter=2, leading=12, leftIndent=32, bulletIndent=18
        ),
        "caption": ParagraphStyle(
            "caption", parent=base["Normal"],
            fontSize=8.5, textColor=GREY, alignment=TA_CENTER,
            spaceAfter=4, italic=True
        ),
        "footer_ref": ParagraphStyle(
            "footer_ref", parent=base["Normal"],
            fontSize=8.5, textColor=GREY, alignment=TA_LEFT,
            spaceAfter=2, italic=True
        ),
        "pearl_box": ParagraphStyle(
            "pearl_box", parent=base["Normal"],
            fontSize=9.5, textColor=NAVY, alignment=TA_LEFT,
            spaceAfter=3, leading=13, leftIndent=8,
            backColor=LIGHT
        ),
    }
    return styles

# ── Page template with header/footer ─────────────────────────────────────────
def make_doc(filename):
    doc = SimpleDocTemplate(
        filename,
        pagesize=A4,
        leftMargin=2.2*cm, rightMargin=2.2*cm,
        topMargin=2.5*cm, bottomMargin=2.5*cm,
        title="Metallurgy in Orthopaedics",
        author="Orris Medical AI",
    )
    return doc

def on_page(canvas, doc):
    W, H = A4
    canvas.saveState()
    # Header bar
    canvas.setFillColor(NAVY)
    canvas.rect(0, H - 1.5*cm, W, 1.5*cm, fill=1, stroke=0)
    canvas.setFont("Helvetica-Bold", 9)
    canvas.setFillColor(WHITE)
    canvas.drawString(2.2*cm, H - 1.0*cm, "METALLURGY IN ORTHOPAEDICS")
    canvas.setFont("Helvetica", 9)
    canvas.drawRightString(W - 2.2*cm, H - 1.0*cm, "RGUHS PG Orthopaedics")
    # Footer
    canvas.setFillColor(NAVY)
    canvas.rect(0, 0, W, 1.3*cm, fill=1, stroke=0)
    canvas.setFont("Helvetica", 8)
    canvas.setFillColor(WHITE)
    canvas.drawString(2.2*cm, 0.45*cm,
        "Sources: Miller's Review 9e | Campbell's Operative Orthopaedics 15e | Rockwood & Green 10e")
    canvas.setFont("Helvetica-Bold", 9)
    canvas.drawRightString(W - 2.2*cm, 0.45*cm, f"Page {doc.page}")
    canvas.restoreState()

def on_first_page(canvas, doc):
    W, H = A4
    canvas.saveState()
    # Full navy cover background strip
    canvas.setFillColor(NAVY)
    canvas.rect(0, H*0.58, W, H*0.42, fill=1, stroke=0)
    # Footer
    canvas.setFillColor(TEAL)
    canvas.rect(0, 0, W, 1.3*cm, fill=1, stroke=0)
    canvas.setFont("Helvetica", 8)
    canvas.setFillColor(WHITE)
    canvas.drawString(2.2*cm, 0.45*cm,
        "Sources: Miller's Review 9e | Campbell's Operative Orthopaedics 15e | Rockwood & Green 10e")
    canvas.restoreState()

# ── Helper builders ───────────────────────────────────────────────────────────
def h1(text, styles):
    return Paragraph(f"<b>{text}</b>", styles["h1"])

def h2(text, styles):
    return Paragraph(f"<b>{text}</b>", styles["h2"])

def h3(text, styles):
    return Paragraph(f"<b>{text}</b>", styles["h3"])

def p(text, styles):
    return Paragraph(text, styles["body"])

def b(text, styles, level=1):
    style = "bullet" if level == 1 else "bullet2"
    return Paragraph(f"• {text}", styles[style])

def hr():
    return HRFlowable(width="100%", thickness=0.5, color=TEAL, spaceAfter=4, spaceBefore=4)

def sp(n=6):
    return Spacer(1, n)

def pearl(text, styles):
    return Paragraph(f"<b>★ Clinical Pearl:</b> {text}", styles["pearl_box"])

def make_table(headers, rows, col_widths=None):
    data = [headers] + rows
    if col_widths is None:
        col_widths = [None] * len(headers)
    t = Table(data, colWidths=col_widths, repeatRows=1)
    style = TableStyle([
        ("BACKGROUND", (0,0), (-1,0), NAVY),
        ("TEXTCOLOR",  (0,0), (-1,0), WHITE),
        ("FONTNAME",   (0,0), (-1,0), "Helvetica-Bold"),
        ("FONTSIZE",   (0,0), (-1,0), 9),
        ("ALIGN",      (0,0), (-1,-1), "CENTER"),
        ("VALIGN",     (0,0), (-1,-1), "MIDDLE"),
        ("ROWBACKGROUNDS", (0,1), (-1,-1), [WHITE, ALT]),
        ("FONTSIZE",   (0,1), (-1,-1), 8.5),
        ("GRID",       (0,0), (-1,-1), 0.4, colors.HexColor("#b0cfe0")),
        ("LEFTPADDING",(0,0), (-1,-1), 5),
        ("RIGHTPADDING",(0,0), (-1,-1), 5),
        ("TOPPADDING", (0,0), (-1,-1), 4),
        ("BOTTOMPADDING",(0,0), (-1,-1), 4),
    ])
    t.setStyle(style)
    return t

# ── Content ───────────────────────────────────────────────────────────────────
def build_story(styles):
    story = []

    # ── COVER ─────────────────────────────────────────────────────────────────
    story += [
        sp(3.5*28),   # push down into blue zone
        Paragraph("<b>METALLURGY IN ORTHOPAEDICS</b>", styles["cover_title"]),
        Paragraph("RGUHS Postgraduate Orthopaedics Examination", styles["cover_sub"]),
        Paragraph("Comprehensive 5-Page Answer", styles["cover_sub"]),
        sp(12),
        Paragraph("Based on:", styles["cover_ref"]),
        Paragraph("Miller's Review of Orthopaedics, 9th Ed.", styles["cover_ref"]),
        Paragraph("Campbell's Operative Orthopaedics, 15th Ed. (2026)", styles["cover_ref"]),
        Paragraph("Rockwood and Green's Fractures in Adults, 10th Ed. (2025)", styles["cover_ref"]),
        PageBreak(),
    ]

    # ── SECTION 1 ─────────────────────────────────────────────────────────────
    story += [
        h1("1. INTRODUCTION AND BASIC CONCEPTS", styles), sp(4),
        p("Metallurgy is the science of the properties, processing, and behaviour of metals and alloys. In orthopaedics it underpins the selection, design, and clinical performance of every metallic implant - from a simple cortical screw to a total joint replacement. The ideal orthopaedic metal must be biocompatible, corrosion-resistant, mechanically strong enough to bear physiological loads, and have a modulus of elasticity that approaches that of bone to minimise stress shielding.", styles),
        sp(4),
        h2("Key Mechanical Terms", styles),
        b("<b>Young's Modulus (E) / Modulus of Elasticity:</b> Slope of the stress-strain curve in the elastic region. A higher E = stiffer material. Matching bone's stiffness reduces stress shielding.", styles),
        b("<b>Yield Strength:</b> Stress at which permanent (plastic) deformation begins (0.2% offset method).", styles),
        b("<b>Ultimate Tensile Strength (UTS):</b> Maximum stress a material can withstand before fracture.", styles),
        b("<b>Fatigue Strength:</b> Stress below which a material can withstand infinite loading cycles without failure - critical for cyclic in vivo loading.", styles),
        b("<b>Ductility:</b> Ability to undergo plastic deformation before fracture. Metals are ductile; ceramics are not.", styles),
        b("<b>Hardness:</b> Resistance to surface deformation; related to wear performance.", styles),
        sp(8),
    ]

    # ── SECTION 2 ─────────────────────────────────────────────────────────────
    story += [
        h1("2. CLASSIFICATION OF METALLIC ALLOYS", styles), sp(4),
        p("There are three main families of metallic alloys used in orthopaedic implants:", styles),
        sp(6),
    ]

    # 2A - SS
    story += [
        h2("A. Iron-Based Alloys - Stainless Steel (316L)", styles),
        p("<b>Composition:</b> Iron-carbon base with chromium (10-18%), nickel, molybdenum, and manganese.", styles),
        h3("Role of Each Alloying Element:", styles),
        b("<b>Chromium:</b> Forms a passive surface oxide layer, improving corrosion resistance.", styles),
        b("<b>Nickel:</b> Increases corrosion resistance and stabilises the austenitic (FCC) molecular structure.", styles),
        b("<b>Molybdenum:</b> Prevents pitting and crevice corrosion.", styles),
        b("<b>Manganese:</b> Improves crystalline stability.", styles),
        b('<b>"L"</b> (low carbon): Greater corrosion resistance - prevents chromium carbide precipitation at grain boundaries.', styles),
        sp(4),
        h3("Mechanical Properties (Rockwood & Green, Table 12.1):", styles),
        make_table(
            ["Form", "UTS (MPa)", "Yield Strength (MPa)", "Elastic Modulus (MPa)"],
            [
                ["Annealed",    ">500",  ">200",  "200,000"],
                ["Cold worked", ">850",  ">700",  "200,000"],
                ["Cortical bone (ref)", "100", "80", "15,000"],
            ],
            [5*cm, 3*cm, 4.5*cm, 4.5*cm]
        ),
        sp(4),
        b("<b>Clinical uses:</b> Trauma implants (plates, nails, screws, wires), spinal implants, temporary fixation.", styles),
        b("<b>Disadvantages:</b> Risk of nickel/chromium sensitisation; galvanic corrosion when mixed; high modulus vs bone; inferior corrosion resistance compared to titanium.", styles),
        sp(8),
    ]

    # 2B - CoCr
    story += [
        h2("B. Cobalt-Based Alloys - Co-Cr-Mo", styles),
        p("<b>Composition:</b> ~65% cobalt, 35% chromium, 5% molybdenum. Nickel may be added to improve ease of forging.", styles),
        b("<b>Cobalt:</b> Provides high mechanical strength base matrix.", styles),
        b("<b>Chromium:</b> Corrosion resistance via passive oxide formation.", styles),
        b("<b>Molybdenum:</b> Refines grain structure, improves strength.", styles),
        sp(4),
        make_table(
            ["Form", "UTS (MPa)", "Yield (MPa)", "E (MPa)"],
            [
                ["Cast",               ">450", ">50",  "20,000"],
                ["Wrought, annealed",  ">300", ">300", "230,000"],
                ["Wrought, cold-worked",">600",">500", "230,000"],
            ],
            [5.5*cm, 3*cm, 3*cm, 3.5*cm]
        ),
        sp(4),
        p("Co-Cr has the <b>greatest ultimate strength</b> of the three alloy families and is <b>stiffer than titanium</b>. Its superior wear resistance makes it the dominant material for femoral heads and bearing surfaces.", styles),
        b("<b>Ion release:</b> Co-Cr ions cause macrophage proliferation and synovial degeneration; excreted via kidneys.", styles),
        b("<b>Clinical uses:</b> Femoral heads, TKA femoral components, cemented femoral stems, spinal rods.", styles),
        sp(8),
    ]

    # 2C - Ti
    story += [
        h2("C. Titanium-Based Alloys - Ti-6Al-4V", styles),
        p("<b>Composition:</b> Titanium base + 6% aluminium + 4% vanadium. Also available as commercially pure (CP) titanium.", styles),
        h3("Key Properties:", styles),
        b("<b>Elastic modulus ~100,000 MPa</b> - roughly half that of stainless steel/Co-Cr, much closer to cortical bone (15,000 MPa). This is titanium's most important clinical advantage.", styles),
        b("<b>Extremely biocompatible</b> - most biocompatible of all orthopaedic metals.", styles),
        b("<b>Self-passivation:</b> Rapidly forms an adherent TiO₂ layer - excellent corrosion resistance, occurs almost instantaneously when scratched.", styles),
        b("<b>Superior fatigue resistance</b> compared to stainless steel.", styles),
        b("<b>UTS 900 MPa, Yield 800 MPa</b> (Ti-6Al-4V alloy).", styles),
        sp(4),
        h3("Disadvantages of Titanium:", styles),
        b("<b>Poor wear resistance</b> (notch sensitivity) - NOT used for femoral heads or bearing surfaces.", styles),
        b("Titanium wear particles incite a histiocytic (macrophage) response.", styles),
        b("Screw head recess susceptible to deformation (stripping) during insertion.", styles),
        b("Relationship with neoplasia - uncertain in literature.", styles),
        sp(4),
        b("<b>Surface treatment:</b> Polishing, passivation, and ion implantation improve fatigue properties.", styles),
        b("<b>Clinical uses:</b> Cementless femoral stems, acetabular shells, spinal cages, IM nails, fracture plates, external fixator pins.", styles),
        sp(8),
    ]

    # 2D - Tantalum
    story += [
        h2("D. Tantalum (Trabecular Metal)", styles),
        b("Highly porous structure (75-80% porosity) mimicking cancellous bone architecture.", styles),
        b("Modulus of elasticity closer to bone than stainless steel or Co-Cr.", styles),
        b("Remarkable corrosion resistance - surface oxide layer as barrier.", styles),
        b("Highly conducive to bone ingrowth.", styles),
        b("<b>Clinical uses:</b> Acetabular reconstruction, revision arthroplasty with bone loss, spinal interbody cages.", styles),
        sp(8),
        PageBreak(),
    ]

    # ── SECTION 3 - Young's modulus ───────────────────────────────────────────
    story += [
        h1("3. YOUNG'S MODULUS - COMPARATIVE CHART AND CLINICAL SIGNIFICANCE", styles), sp(4),
        p("Young's modulus (stiffness) is the single most important property governing stress shielding. The figure below (Miller's Review, Fig. 1.58) shows relative stiffness of orthopaedic materials:", styles),
        sp(6),
        make_table(
            ["Material", "E (MPa)", "Clinical Significance"],
            [
                ["Al₂O₃ Ceramic",       "380,000", "Highest stiffness; bearing surfaces only"],
                ["Co-Cr-Mo alloy",      "230,000", "Cemented stems; bearing surfaces"],
                ["Stainless steel 316L","200,000", "Trauma implants"],
                ["Titanium Ti-6Al-4V",  "100,000", "Cementless stems; best for stress shielding"],
                ["Cortical bone",        "15,000", "Reference standard"],
                ["Tantalum (porous)",    "~3,000", "Closest to cancellous bone"],
                ["PMMA bone cement",     "2,000",  "Grout; load distribution"],
                ["Polyethylene",         "1,000",  "Bearing surface; liner"],
                ["Cancellous bone",      "1,000",  "Trabecular structure"],
            ],
            [5.5*cm, 3*cm, 7*cm]
        ),
        sp(8),
        h2("Clinical Rule - Modulus Selection:", styles),
        b("Lower E (titanium): preferred for <b>cementless stems</b> - more load shared with bone, less stress shielding.", styles),
        b("Higher E (Co-Cr): preferred for <b>cemented stems</b> - compressive load transmitted through cement mantle to bone.", styles),
        sp(8),
    ]

    # ── SECTION 4 - Corrosion ─────────────────────────────────────────────────
    story += [
        h1("4. CORROSION IN ORTHOPAEDIC METALS", styles), sp(4),
        p("All metals corrode in the body's high-saline physiological environment. <b>Passivation</b> - the formation of a thin protective metal oxide layer - is the primary defence mechanism. Titanium forms TiO₂ almost instantaneously (self-passivation); stainless steel and Co-Cr form chromium oxide layers.", styles),
        sp(6),
        h2("Types of Corrosion (Miller's Review, Fig. 1.57):", styles),
        sp(4),
        make_table(
            ["Type", "Mechanism", "Clinical Example", "Prevention"],
            [
                ["Uniform",   "Even surface oxidation",       "General implant degradation",      "Passivation"],
                ["Galvanic",  "Two dissimilar metals in electrolyte; anodic metal corrodes faster", "Titanium screw + SS plate", "Never mix metals"],
                ["Pitting",   "Localised attack at passivation defects", "SS plate surfaces",     "Molybdenum addition; handle carefully"],
                ["Crevice",   "Low O₂/low pH in crevices accelerate oxidation", "Screw-plate interface; modular junctions", "Tight assembly; Ti preferred"],
                ["Fretting",  "Cyclic micromotion (<100 μm) disrupts oxide layer repeatedly", "Head-neck taper; nail-screw interlock; loose plate screws", "Rigid fixation; avoid micromotion"],
            ],
            [2.8*cm, 4.5*cm, 4*cm, 3.7*cm]
        ),
        sp(8),
    ]

    # ── SECTION 5 - Trunnionosis ──────────────────────────────────────────────
    story += [
        h1("5. TRUNNION CORROSION (TRUNNIONOSIS)", styles), sp(4),
        p("Trunnionosis is corrosion at the modular taper junction (trunnion) between the femoral head and femoral stem in THA. It is a combination of fretting and crevice corrosion - mechanically assisted crevice corrosion.", styles),
        sp(4),
        h2("Mechanism:", styles),
        b("Cyclic loading generates micromotion at the head-stem taper.", styles),
        b("Micromotion disrupts the protective oxide layer repeatedly.", styles),
        b("Metal ions (cobalt and chromium) are released into surrounding tissues.", styles),
        sp(4),
        h2("Risk Factors for Increased Trunnion Stress:", styles),
        b("Large-diameter femoral heads (increased lever arm / toggle effect).", styles),
        b("Large femoral component offsets.", styles),
        b("Varus stem position.", styles),
        b("<b>Cobalt-chrome femoral head on titanium stem</b> - material mismatch increases corrosion.", styles),
        sp(4),
        h2("Clinical Consequences:", styles),
        b("Metal ion release - adverse local tissue reaction (ALTR).", styles),
        b("Pseudotumour formation (soft tissue mass, similar to MOM THA failures).", styles),
        b("Metallosis - metal staining of periprosthetic tissues.", styles),
        sp(4),
        h2("Diagnosis:", styles),
        b("Serum metal ions: concern when cobalt >1 ppb (in metal-on-PE articulation).", styles),
        b("<b>Cobalt:chromium ratio >5:1</b> highly suggests trunnion problem (vs bearing surface).", styles),
        b("MARS MRI of hip to assess soft tissue damage.", styles),
        sp(4),
        h2("Treatment:", styles),
        b("Revise femoral head to <b>ceramic head with titanium sleeve adapter</b>.", styles),
        b("Stem revision NOT required unless catastrophic trunnion damage.", styles),
        sp(4),
        pearl("Trunnionosis is responsible for the widespread adoption of ceramic femoral heads in primary THA. Co-Cr heads should be avoided if a titanium stem is used. (Miller's Review, Testable Concepts)", styles),
        sp(8),
        PageBreak(),
    ]

    # ── SECTION 6 - Stress Shielding ─────────────────────────────────────────
    story += [
        h1("6. STRESS SHIELDING", styles), sp(4),
        p("<b>Wolff's Law:</b> Bone remodels in response to mechanical stresses. Bone not subjected to adequate stress undergoes resorption (disuse osteoporosis).", styles),
        p("<b>Stress shielding</b> occurs when a stiff metallic implant absorbs and carries load that should be borne by the bone, reducing the mechanical stimulus to periprosthetic bone. This leads to adaptive bone resorption, implant loosening, periprosthetic fracture, and difficult revision.", styles),
        sp(4),
        h2("Factors Affecting Stem Stiffness (Campbell's Operative Orthopaedics):", styles),
        b("<b>Modulus of elasticity:</b> Lower E (titanium) → more load to bone → less stress shielding.", styles),
        b("<b>Stem diameter:</b> Bending stiffness is proportional to the <b>4th power of the radius</b> - small diameter increases produce huge stiffness jumps.", styles),
        b("<b>Stem geometry:</b> Solid/round stems are stiffer; hollow, slotted, fluted, tapered designs are less stiff.", styles),
        b("<b>Extent of porous coating:</b> Extensive (diaphyseal) coating transfers load distally - proximal femur is stress-shielded.", styles),
        b2("<b>Proximal porous coating</b> - loads transferred into metaphysis and proximal diaphysis, maintaining proximal bone density.", styles),
        b2("<b>Extensive (full-length) coating</b> - bone ingrowth diaphyseal; proximal femur resorbs.", styles),
        sp(6),
        h2("Typical Scenario Producing Severe Stress Shielding (Miller's Review):", styles),
        make_table(
            ["Factor", "Detail"],
            [
                ["Stem diameter",   "≥16 mm"],
                ["Alloy",           "Cobalt-chrome (Co-Cr) - highest E of metallic stems"],
                ["Geometry",        "Round, solid, cylindrical shaft"],
                ["Porous coating",  "Extensive (full-length diaphyseal)"],
                ["Loading",         "Distal bone loading; spot weld formation distally"],
            ],
            [5*cm, 10*cm]
        ),
        sp(4),
        pearl("Co-Cr stems cause nearly double the proximal bone loss compared to titanium alloy femoral stems. (Meta-analysis by Knutsen et al., cited in Campbell's Operative Orthopaedics)", styles),
        sp(8),
    ]

    # ── SECTION 7 - Fixation and Surface ─────────────────────────────────────
    story += [
        h1("7. IMPLANT SURFACE FINISH AND FIXATION METHODS", styles), sp(4),
        h2("A. Cemented Implants:", styles),
        b("Highly polished (smooth) surface: controlled subsidence within cement - composite beam theory (Exeter stem).", styles),
        b("Matt/roughened surface: bonds rigidly to cement.", styles),
        b("<b>Preferred alloy:</b> Co-Cr (higher stiffness transmits load through cement mantle to bone).", styles),
        b("PMMA acts as a <b>grout</b>, not an adhesive - mechanically interlocks with bone trabeculae.", styles),
        b("PMMA reaches ultimate strength within 24 hours; strongest in compression, weak in tension and shear.", styles),
        b("Reducing voids (vacuum mixing, centrifugation) increases cement strength.", styles),
        sp(6),
        h2("B. Cementless Implants:", styles),
        b("Porous-coated surfaces (sintered beads, plasma-sprayed Ti, fibre metal) allow bone ingrowth.", styles),
        b("<b>Hydroxyapatite (HA) coating:</b> Plasma-sprayed calcium phosphate applied to titanium - accelerates bone apposition and osseointegration.", styles),
        b("<b>Preferred alloy:</b> Titanium (lower E = less stress shielding; superior biocompatibility; self-passivation aids osseointegration).", styles),
        b("Osseointegration requires micromotion <50-150 μm at the time of insertion.", styles),
        sp(8),
    ]

    # ── SECTION 8 - Fracture Fixation ────────────────────────────────────────
    story += [
        h1("8. METALLURGY IN FRACTURE FIXATION IMPLANTS", styles), sp(4),
        h2("Intramedullary Nails:", styles),
        b("Materials: Titanium alloy (Ti-6Al-4V) or stainless steel 316L.", styles),
        b("Titanium IM nails: lower E (load-sharing device), less stress shielding, superior fatigue - allows physiological load-sharing with bone.", styles),
        b("Advantages over plates: acts as load-sharing (not load-bearing) device; avoids stress shielding; less refracture after removal.", styles),
        sp(4),
        h2("Plates and Screws:", styles),
        b("Materials: 316L stainless steel or titanium alloy.", styles),
        b("Fretting corrosion at screw-plate interface is the key failure mechanism when screws are insufficiently tightened.", styles),
        b("Galvanic rule: <b>never combine stainless steel screws with titanium plates</b> (or vice versa).", styles),
        b("Locking plates: angular-stable, fixed-angle construct - less fretting at screw-plate interface.", styles),
        sp(4),
        h2("Corrosion Prevention in Fracture Fixation (Campbell's):", styles),
        b("Do not scratch implants during insertion - disrupts passive oxide layer.", styles),
        b("Avoid using dissimilar metals together.", styles),
        b("Ensure secure fixation to minimise fretting at interfaces.", styles),
        b("Use pre-passivated implants as supplied.", styles),
        sp(8),
        PageBreak(),
    ]

    # ── SECTION 9 - Non-metallic ──────────────────────────────────────────────
    story += [
        h1("9. NON-METALLIC MATERIALS IN ORTHOPAEDICS", styles), sp(4),
        h2("Ceramics (Alumina Al₂O₃, Zirconia ZrO₂):", styles),
        b("Metallic and nonmetallic elements bonded ionically in a highly oxidised state.", styles),
        b("Good insulators (poor electrical conductors).", styles),
        b("<b>Highest E and compressive strength</b> of all implant materials.", styles),
        b("<b>Brittle</b> - no plastic deformation before catastrophic fracture. Low tensile strength.", styles),
        b("<b>Best wear characteristics</b> against polyethylene - lowest oxidation rate.", styles),
        b("High surface wettability, small grain size - ultrasmooth surface, less friction.", styles),
        b("Calcium phosphates (hydroxyapatite): plasma-sprayed coatings to increase attachment and promote bone healing.", styles),
        b("<b>Clinical use:</b> Femoral heads in THA (ceramic-on-PE, ceramic-on-ceramic bearings).", styles),
        sp(6),
        h2("Oxidised Zirconium (Oxinium):", styles),
        b("Zirconium metal alloy with a zirconium oxide ceramic surface coating.", styles),
        b("Combines metal toughness with ceramic scratch resistance.", styles),
        b("More scratch-resistant than Co-Cr - reduces polyethylene wear debris.", styles),
        sp(6),
        h2("Bioabsorbable Implants:", styles),
        b("PGA, PLLA, PDS, PDLLA - alpha polyesters.", styles),
        b("PGA degraded by hydrolysis → pyruvic acid → CO₂ + water.", styles),
        b("Cannot be contoured intraoperatively (high glass transition temperature).", styles),
        b("Uses: small fragment fixation, ligament anchors, interference screws.", styles),
        sp(8),
    ]

    # ── SECTION 10 - Metal Sensitivity ───────────────────────────────────────
    story += [
        h1("10. METAL SENSITIVITY AND ION TOXICITY", styles), sp(4),
        b("<b>Metal ion release</b> occurs from all orthopaedic implants via corrosion and wear.", styles),
        b("<b>Co-Cr ions:</b> macrophage proliferation, synovial degeneration; excreted via kidneys.", styles),
        b("<b>Nickel</b> is the most common metallic sensitiser - Type IV delayed hypersensitivity.", styles),
        b("Incidence of clinically significant metal sensitivity causing implant failure is low.", styles),
        b("In sensitised patients: titanium implants preferred (most biocompatible).", styles),
        b("<b>Titanium particulate:</b> histiocytic response; macrophage activation → osteolysis.", styles),
        b("<b>Systemic cobalt toxicity (cobaltism):</b> cardiomyopathy, thyroid dysfunction, neurological effects - in extreme metal-on-metal failures.", styles),
        sp(8),
    ]

    # ── SECTION 11 - High Yield Table ─────────────────────────────────────────
    story += [
        h1("11. HIGH-YIELD EXAM PEARLS (RGUHS)", styles), sp(4),
        make_table(
            ["Concept", "Key Fact"],
            [
                ["Stiffest orthopaedic metal",       "Co-Cr-Mo (~230 GPa)"],
                ["Most biocompatible metal",          "Titanium"],
                ["Self-passivating metal",            "Titanium (forms TiO₂ immediately)"],
                ["Metal for cementless stem",         "Titanium (lower E = less stress shielding)"],
                ["Metal for cemented stem",           "Co-Cr (higher stiffness)"],
                ["Metal for femoral head",            "Co-Cr or Ceramic (NOT titanium - poor wear)"],
                ["Galvanic corrosion rule",           "Never mix dissimilar metals"],
                ["Fretting corrosion sites",          "Screw-plate interface; head-neck taper (trunnion)"],
                ["Trunnionosis treatment",            "Ceramic head + Ti sleeve; no stem revision if intact"],
                ["Co-Cr ion excretion route",         "Kidneys"],
                ["PMMA role",                         "Grout - mechanical interlock (NOT adhesive)"],
                ["Strongest in compression",          "PMMA, ceramics"],
                ["Bending stiffness proportional to", "Radius⁴ of stem"],
                ["316L 'L' stands for",               "Low carbon → better corrosion resistance"],
                ["Molybdenum function",               "Prevents pitting and crevice corrosion"],
                ["Nickel function in SS",             "Corrosion resistance + austenitic stability"],
                ["Stress shielding worst scenario",   "Large Co-Cr solid round extensively coated stem"],
                ["Tantalum porosity",                 "75-80% - closest to cancellous bone architecture"],
                ["Cobalt:Chromium ratio in trunnionosis", ">5:1 suggests trunnion (not MOM) problem"],
                ["Ceramic advantage",                 "Best wear characteristics + lowest friction"],
            ],
            [7.5*cm, 8*cm]
        ),
        sp(10),
    ]

    # ── REFERENCES ─────────────────────────────────────────────────────────────
    story += [
        hr(),
        h2("References", styles),
        Paragraph("1. Miller's Review of Orthopaedics, 9th Edition - Chapter 1: Basic Science (pp. 117-118); Chapter 5: Adult Reconstruction.", styles["footer_ref"]),
        Paragraph("2. Campbell's Operative Orthopaedics, 15th Edition (2026) - Chapter 4: Hip Reconstruction (Stress Transfer to Bone); Chapter 30: Biomaterials of Fracture Fixation.", styles["footer_ref"]),
        Paragraph("3. Rockwood and Green's Fractures in Adults, 10th Edition (2025) - Chapter 12: Biomechanics of Fracture Fixation (Table 12.1).", styles["footer_ref"]),
    ]

    return story

def b2(text, styles):
    return Paragraph(f"    ◦ {text}", styles["bullet2"])


# ── Main ──────────────────────────────────────────────────────────────────────
if __name__ == "__main__":
    styles = make_styles()
    doc    = make_doc(OUTPUT)

    # patch b2 into build_story
    story = build_story(styles)

    doc.build(
        story,
        onFirstPage=on_first_page,
        onLaterPages=on_page,
    )
    print(f"PDF written to: {OUTPUT}")
Running Command

cd /home/daytona/workspace/metallurgy-ortho && python generate_pdf.py 2>&1

Running Command

ls -lh /home/daytona/workspace/metallurgy-ortho/Metallurgy_in_Orthopaedics.pdf

Your PDF is ready. Here is your download link:

Metallurgy in Orthopaedics

PDF Document · PDF

What's inside (5 pages, exam-ready):
  • Navy/teal cover page with book references
  • Running header ("Metallurgy in Orthopaedics | RGUHS PG Orthopaedics") and page footer on every page
  • 11 numbered sections with colour-coded headings, data tables, and clinical pearl boxes
  • Full engineering properties table (Rockwood & Green, Table 12.1) comparing SS/Co-Cr/Ti/bone/PMMA
  • Corrosion types table (uniform, galvanic, pitting, crevice, fretting) with clinical examples
  • Trunnionosis section with diagnosis criteria (Co:Cr ratio >5:1, cobalt >1 ppb)
  • Stress shielding factors and the "worst case scenario" table
  • 20-row High-Yield Exam Pearls table at the end
  • All sourced from Miller's Review 9e, Campbell's 15e, and Rockwood & Green 10e
This is a shared conversation. Sign in to Orris to start your own chat.