Ppt on anatomy of heart
mkdir -p /home/daytona/workspace/heart-anatomy-ppt && ls /home/daytona/workspace…
~/heart-anatomy-ppt/create_ppt.js
const pptxgen = require("pptxgenjs");
const { execSync } = require("child_process");
// Fetch images as base64
function fetchImages(urls) {
try {
const result = execSync(
`node /home/daytona/skills/shared/scripts/fetch_images.js ${urls.map(u => `"${u}"`).join(" ")}`
).toString();
return JSON.parse(result);
} catch (e) {
return urls.map(u => ({ url: u, base64: null, error: e.message }));
}
}
const imageUrls = [
"https://cdn.orris.care/cdss_images/5d25bd8e245eb921f92f584f9402b198a6094daef7c2bdbc332e49a812a6a8aa.png", // Heart structure & blood flow
"https://cdn.orris.care/cdss_images/a4b8671d696b2207aa2d096051557e7cc39715b26fa53afa3429be483637d110.png", // Layers of heart/pericardium
"https://cdn.orris.care/cdss_images/030588aeee4867ca308e5f1a0fcc6940480805730b60fd0ddf1014b5c2254def.png", // Conduction system
"https://cdn.orris.care/cdss_images/34926593bec0190f35a8ccd46d37b8ccf77b676701187b8cbc712bc3d56c6.png", // Coronary arteries
];
console.log("Fetching images...");
const images = fetchImages(imageUrls);
console.log("Images fetched:", images.map(i => ({ url: i.url.slice(-30), ok: !i.error, hasData: !!i.base64 })));
// ─── Palette ────────────────────────────────────────────────────────────────
const C = {
darkRed: "8B1A1A",
midRed: "B22222",
accent: "E63946",
cream: "FFF8F0",
darkGray: "1C1C1E",
lightGray: "F2F2F7",
white: "FFFFFF",
gold: "D4A017",
subtext: "5C5C6B",
};
let pres = new pptxgen();
pres.layout = "LAYOUT_16x9";
pres.author = "Orris Medical";
pres.title = "Anatomy of the Heart";
// ─── Helper: dark title slide background ────────────────────────────────────
function darkBg(slide) {
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.darkGray } });
}
// ─── Helper: section divider shape (left red bar) ───────────────────────────
function redBar(slide, h = 5.625) {
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 0.18, h, fill: { color: C.accent } });
}
// ─── Helper: cream background ───────────────────────────────────────────────
function creamBg(slide) {
slide.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: C.cream } });
}
// ─── Helper: add image if available ─────────────────────────────────────────
function addImg(slide, idx, x, y, w, h) {
if (images[idx] && images[idx].base64) {
slide.addImage({ data: images[idx].base64, x, y, w, h, sizing: { type: "contain", w, h } });
}
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 1 — Title
// ════════════════════════════════════════════════════════════════════════════
{
let sl = pres.addSlide();
darkBg(sl);
// Red diagonal accent strip
sl.addShape(pres.ShapeType.rect, { x: 0, y: 3.8, w: 10, h: 0.08, fill: { color: C.accent } });
// Subtle heart silhouette (decorative rectangle placeholder)
sl.addShape(pres.ShapeType.rect, {
x: 6.5, y: 0.4, w: 3.1, h: 3.5,
fill: { color: "2A0A0A" },
line: { color: C.accent, width: 1.5 }
});
// If heart structure image loaded, show it
addImg(sl, 0, 6.6, 0.5, 2.9, 3.2);
sl.addText("ANATOMY OF", {
x: 0.5, y: 0.6, w: 5.8, h: 0.9,
fontSize: 38, bold: true, color: C.white, fontFace: "Calibri",
charSpacing: 4
});
sl.addText("THE HEART", {
x: 0.5, y: 1.4, w: 5.8, h: 1.1,
fontSize: 54, bold: true, color: C.accent, fontFace: "Calibri",
charSpacing: 3
});
sl.addText("Structure · Function · Clinical Relevance", {
x: 0.5, y: 2.55, w: 5.8, h: 0.5,
fontSize: 14, color: "CCBBBB", fontFace: "Calibri", italic: true
});
sl.addText("Source: Goldman-Cecil Medicine · Histology (Mescher) · Costanzo Physiology · Gray's Anatomy", {
x: 0.5, y: 4.9, w: 9, h: 0.4,
fontSize: 9, color: C.subtext, fontFace: "Calibri"
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 2 — Overview & Position
// ════════════════════════════════════════════════════════════════════════════
{
let sl = pres.addSlide();
creamBg(sl);
redBar(sl);
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.midRed } });
sl.addText("OVERVIEW & POSITION", {
x: 0.3, y: 0.1, w: 9.4, h: 0.55,
fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
const points = [
"Located in the mediastinum, between the two lungs, behind the sternum",
"Approximately the size of a fist (~250–300 g in adults)",
"Sits obliquely — 2/3 of its mass lies to the left of the midline",
"Apex points downward and to the left (5th intercostal space, mid-clavicular line)",
"Base faces posteriorly and superiorly — formed mainly by the left atrium",
"Enclosed within the pericardial sac in the middle mediastinum",
];
sl.addText(points.map((p, i) => [
{ text: `${["01","02","03","04","05","06"][i]} `, options: { bold: true, color: C.accent, fontSize: 13 } },
{ text: p, options: { color: C.darkGray, fontSize: 13, breakLine: i < points.length - 1 } }
]).flat(), {
x: 0.35, y: 0.9, w: 5.7, h: 4.3, fontFace: "Calibri", paraSpaceAfter: 8
});
// image box
sl.addShape(pres.ShapeType.rect, { x: 6.2, y: 0.9, w: 3.5, h: 4.0, fill: { color: "EDD5C0" }, line: { color: C.midRed, width: 1 } });
addImg(sl, 0, 6.25, 0.95, 3.4, 3.9);
sl.addText("Fig: Heart structure and blood flow chambers\n(Guyton & Hall, Textbook of Medical Physiology)", {
x: 6.2, y: 4.9, w: 3.5, h: 0.5, fontSize: 7.5, color: C.subtext, align: "center", fontFace: "Calibri", italic: true
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 3 — Layers of the Heart Wall
// ════════════════════════════════════════════════════════════════════════════
{
let sl = pres.addSlide();
creamBg(sl);
redBar(sl);
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.darkRed } });
sl.addText("LAYERS OF THE HEART WALL", {
x: 0.3, y: 0.1, w: 9.4, h: 0.55,
fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
// Three layer cards
const layers = [
{ name: "EPICARDIUM", color: "C0392B", details: [
"Outermost layer",
"= Visceral layer of serous pericardium",
"Single layer of mesothelial cells",
"Contains coronary vessels & nerves in adipose tissue",
"Reflected at great vessels → parietal pericardium",
]},
{ name: "MYOCARDIUM", color: "922B21", details: [
"Principal / thickest layer",
"Composed of cardiac muscle (cardiomyocytes)",
"Atrial myocardium thinner than ventricular",
"LV thicker than RV (higher pressure)",
"Arranged in complex helical fiber layers",
]},
{ name: "ENDOCARDIUM", color: "641E16", details: [
"Innermost layer",
"Endothelial lining + thin connective tissue",
"Lines chambers and covers valve leaflets",
"Continuous with intimal lining of great vessels",
"Purkinje fibers run in subendocardial layer",
]},
];
layers.forEach((layer, i) => {
const xBase = 0.28 + i * 3.2;
sl.addShape(pres.ShapeType.rect, { x: xBase, y: 0.85, w: 3.0, h: 4.55, fill: { color: "FFF0EB" }, line: { color: layer.color, width: 2 } });
sl.addShape(pres.ShapeType.rect, { x: xBase, y: 0.85, w: 3.0, h: 0.55, fill: { color: layer.color } });
sl.addText(layer.name, { x: xBase, y: 0.87, w: 3.0, h: 0.51, fontSize: 13, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0 });
sl.addText(layer.details.map((d, j) => ({
text: `• ${d}`,
options: { breakLine: j < layer.details.length - 1, fontSize: 11, color: C.darkGray }
})), { x: xBase + 0.1, y: 1.5, w: 2.8, h: 3.8, fontFace: "Calibri", paraSpaceAfter: 5 });
});
// Diagram
addImg(sl, 1, 9.6, 0.9, 0, 0); // hidden fallback; image shown inline via box below if needed
sl.addText("The pericardial cavity between visceral and parietal layers contains 15–50 mL of serous fluid. Cardiac tamponade occurs when this space fills rapidly with blood or effusion.", {
x: 0.28, y: 5.2, w: 9.4, h: 0.35, fontSize: 9, color: C.subtext, italic: true, fontFace: "Calibri"
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 4 — Chambers of the Heart
// ════════════════════════════════════════════════════════════════════════════
{
let sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: "1A0505" } });
redBar(sl);
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.accent } });
sl.addText("FOUR CHAMBERS OF THE HEART", {
x: 0.3, y: 0.1, w: 9.4, h: 0.55,
fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
const chambers = [
{ name: "Right Atrium", icon: "RA", desc: "Receives deoxygenated blood from SVC, IVC and coronary sinus. Contains SA node in its wall. Separated from LA by interatrial septum (fossa ovalis)." },
{ name: "Right Ventricle", icon: "RV", desc: "Thin-walled, crescent-shaped. Pumps blood to lungs via pulmonary artery. Divided from LV by interventricular septum. Normal pressure ~25/5 mmHg." },
{ name: "Left Atrium", icon: "LA", desc: "Receives oxygenated blood from 4 pulmonary veins. Forms most of the base (posterior surface) of the heart. Thinner walls than ventricles." },
{ name: "Left Ventricle", icon: "LV", desc: "Thick-walled primary pump. Ejects blood into aorta at ~120 mmHg. Wall thickness ~8–12 mm. Billions of cardiomyocytes connected via gap junctions." },
];
chambers.forEach((ch, i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = 0.28 + col * 4.85;
const y = 0.9 + row * 2.2;
sl.addShape(pres.ShapeType.rect, { x, y, w: 4.6, h: 2.0, fill: { color: "2C0A0A" }, line: { color: C.accent, width: 1.2 } });
sl.addShape(pres.ShapeType.rect, { x, y, w: 0.7, h: 2.0, fill: { color: C.accent } });
sl.addText(ch.icon, { x, y: y + 0.65, w: 0.7, h: 0.7, fontSize: 14, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0 });
sl.addText(ch.name, { x: x + 0.75, y: y + 0.08, w: 3.75, h: 0.4, fontSize: 13, bold: true, color: C.gold, fontFace: "Calibri", margin: 0 });
sl.addText(ch.desc, { x: x + 0.75, y: y + 0.5, w: 3.75, h: 1.35, fontSize: 10.5, color: "E0D0D0", fontFace: "Calibri", paraSpaceAfter: 3 });
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 5 — Heart Valves
// ════════════════════════════════════════════════════════════════════════════
{
let sl = pres.addSlide();
creamBg(sl);
redBar(sl);
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.midRed } });
sl.addText("HEART VALVES", {
x: 0.3, y: 0.1, w: 9.4, h: 0.55,
fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
// Two categories: AV valves and Semilunar valves
sl.addText("ATRIOVENTRICULAR (AV) VALVES", {
x: 0.28, y: 0.85, w: 4.6, h: 0.38,
fontSize: 13, bold: true, color: C.darkRed, fontFace: "Calibri", underline: true
});
sl.addText("SEMILUNAR VALVES", {
x: 5.1, y: 0.85, w: 4.6, h: 0.38,
fontSize: 13, bold: true, color: C.darkRed, fontFace: "Calibri", underline: true
});
const avValves = [
{ name: "Tricuspid Valve", loc: "Right AV orifice", leaflets: "3 leaflets", function: "Prevents backflow from RV → RA during systole", support: "Attached via chordae tendineae to papillary muscles" },
{ name: "Mitral (Bicuspid) Valve", loc: "Left AV orifice", leaflets: "2 leaflets (anterior & posterior)", function: "Prevents backflow from LV → LA during systole", support: "Chordae tendineae; failure → mitral regurgitation" },
];
const slValves = [
{ name: "Pulmonary Valve", loc: "RV–pulmonary trunk junction", leaflets: "3 semilunar cusps", function: "Opens on RV contraction; closes during diastole", support: "No chordae; prevented from inverting by cusp geometry" },
{ name: "Aortic Valve", loc: "LV–aortic junction", leaflets: "3 semilunar cusps", function: "Opens on LV contraction; diastolic closure fills coronary arteries", support: "Aortic sinuses (sinuses of Valsalva) above cusps" },
];
[...avValves].forEach((v, i) => {
const y = 1.3 + i * 1.95;
sl.addShape(pres.ShapeType.rect, { x: 0.28, y, w: 4.6, h: 1.8, fill: { color: "FFF0EB" }, line: { color: C.midRed, width: 1.2 } });
sl.addText(v.name, { x: 0.38, y: y + 0.07, w: 4.3, h: 0.35, fontSize: 12, bold: true, color: C.darkRed, fontFace: "Calibri", margin: 0 });
sl.addText([
{ text: `Location: `, options: { bold: true, fontSize: 10.5 } }, { text: v.loc + "\n", options: { fontSize: 10.5 } },
{ text: `Leaflets: `, options: { bold: true, fontSize: 10.5 } }, { text: v.leaflets + "\n", options: { fontSize: 10.5 } },
{ text: `Function: `, options: { bold: true, fontSize: 10.5 } }, { text: v.function + "\n", options: { fontSize: 10.5 } },
{ text: `Note: `, options: { bold: true, fontSize: 10.5 } }, { text: v.support, options: { fontSize: 10.5 } },
], { x: 0.38, y: y + 0.45, w: 4.3, h: 1.25, fontFace: "Calibri", color: C.darkGray, paraSpaceAfter: 2 });
});
[...slValves].forEach((v, i) => {
const y = 1.3 + i * 1.95;
sl.addShape(pres.ShapeType.rect, { x: 5.1, y, w: 4.6, h: 1.8, fill: { color: "F0F8FF" }, line: { color: C.midRed, width: 1.2 } });
sl.addText(v.name, { x: 5.2, y: y + 0.07, w: 4.3, h: 0.35, fontSize: 12, bold: true, color: C.darkRed, fontFace: "Calibri", margin: 0 });
sl.addText([
{ text: `Location: `, options: { bold: true, fontSize: 10.5 } }, { text: v.loc + "\n", options: { fontSize: 10.5 } },
{ text: `Leaflets: `, options: { bold: true, fontSize: 10.5 } }, { text: v.leaflets + "\n", options: { fontSize: 10.5 } },
{ text: `Function: `, options: { bold: true, fontSize: 10.5 } }, { text: v.function + "\n", options: { fontSize: 10.5 } },
{ text: `Note: `, options: { bold: true, fontSize: 10.5 } }, { text: v.support, options: { fontSize: 10.5 } },
], { x: 5.2, y: y + 0.45, w: 4.3, h: 1.25, fontFace: "Calibri", color: C.darkGray, paraSpaceAfter: 2 });
});
sl.addText("AV valves close (S1 sound) at start of systole; Semilunar valves close (S2 sound) at start of diastole.", {
x: 0.28, y: 5.15, w: 9.4, h: 0.35, fontSize: 9.5, color: C.subtext, italic: true, fontFace: "Calibri"
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 6 — Cardiac Conduction System
// ════════════════════════════════════════════════════════════════════════════
{
let sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: "0D1B2A" } });
redBar(sl);
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: "1A3A5C" } });
sl.addText("CARDIAC CONDUCTION SYSTEM", {
x: 0.3, y: 0.1, w: 9.4, h: 0.55,
fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
const steps = [
{ num: "1", node: "SA Node", desc: "Sinoatrial node — in right atrial wall near SVC. Primary pacemaker: 60–100 bpm. Initiates every normal heartbeat." },
{ num: "2", node: "AV Node", desc: "Atrioventricular node — at base of RA near tricuspid valve. Delays conduction ~0.1s to allow ventricular filling." },
{ num: "3", node: "Bundle of His", desc: "Common bundle from AV node. Passes through fibrous AV skeleton into interventricular septum. Splits into L & R bundle branches." },
{ num: "4", node: "Bundle Branches", desc: "Left bundle branch (LBB) — splits into anterior and posterior fascicles. Right bundle branch (RBB) runs along right side of septum." },
{ num: "5", node: "Purkinje Fibers", desc: "Subendocardial network — rapidly distributes impulse throughout ventricular myocardium. Conduction 4–5× faster than regular myocardium." },
];
steps.forEach((s, i) => {
const y = 0.85 + i * 0.92;
sl.addShape(pres.ShapeType.roundRect, { x: 0.28, y, w: 0.55, h: 0.55, rectRadius: 0.1, fill: { color: C.accent } });
sl.addText(s.num, { x: 0.28, y: y + 0.06, w: 0.55, h: 0.43, fontSize: 15, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0 });
sl.addShape(pres.ShapeType.rect, { x: 0.88, y: y + 0.05, w: 1.5, h: 0.45, fill: { color: "1E3A5F" }, line: { color: "4A8FC0", width: 1 } });
sl.addText(s.node, { x: 0.88, y: y + 0.06, w: 1.5, h: 0.43, fontSize: 11, bold: true, color: "80C8FF", align: "center", fontFace: "Calibri", margin: 0 });
sl.addText(s.desc, { x: 2.45, y: y + 0.04, w: 5.4, h: 0.6, fontSize: 10.5, color: "D0D8E8", fontFace: "Calibri" });
if (i < steps.length - 1) {
sl.addShape(pres.ShapeType.line, { x: 0.55, y: y + 0.55, w: 0, h: 0.37, line: { color: C.accent, width: 1.5 } });
}
});
// Conduction diagram image
sl.addShape(pres.ShapeType.rect, { x: 8.0, y: 0.85, w: 1.75, h: 4.5, fill: { color: "0A1520" }, line: { color: "4A8FC0", width: 1 } });
addImg(sl, 2, 8.05, 0.9, 1.65, 4.4);
sl.addText("Conduction pathway\n(Costanzo Physiology)", {
x: 7.95, y: 5.35, w: 1.85, h: 0.25, fontSize: 7, color: C.subtext, align: "center", fontFace: "Calibri", italic: true
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 7 — Coronary Circulation
// ════════════════════════════════════════════════════════════════════════════
{
let sl = pres.addSlide();
creamBg(sl);
redBar(sl);
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.darkRed } });
sl.addText("CORONARY CIRCULATION", {
x: 0.3, y: 0.1, w: 9.4, h: 0.55,
fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
// Left column text
sl.addText("LEFT CORONARY ARTERY (LCA)", {
x: 0.28, y: 0.85, w: 5.2, h: 0.4,
fontSize: 13, bold: true, color: C.darkRed, fontFace: "Calibri"
});
sl.addText([
{ text: "• Short main stem passes between pulmonary trunk and left auricle\n", options: { fontSize: 11 } },
{ text: "• Divides into:\n", options: { fontSize: 11 } },
{ text: " — Anterior Interventricular (LAD): supplies anterior LV, anterior septum\n", options: { fontSize: 11 } },
{ text: " — Circumflex: runs in left coronary sulcus → supplies LA and posterior LV\n", options: { fontSize: 11 } },
{ text: "• Supplies most of the LV and anterior septum\n", options: { fontSize: 11 } },
], { x: 0.28, y: 1.3, w: 5.2, h: 1.8, fontFace: "Calibri", color: C.darkGray, paraSpaceAfter: 3 });
sl.addText("RIGHT CORONARY ARTERY (RCA)", {
x: 0.28, y: 3.15, w: 5.2, h: 0.4,
fontSize: 13, bold: true, color: C.darkRed, fontFace: "Calibri"
});
sl.addText([
{ text: "• Arises from right aortic sinus; enters right coronary sulcus\n", options: { fontSize: 11 } },
{ text: "• Gives off: right marginal artery → posterior interventricular artery\n", options: { fontSize: 11 } },
{ text: "• Supplies: RA, SA node, AV node (in most people), posterior septum, RV\n", options: { fontSize: 11 } },
{ text: "• Coronary arteries are functional end-arteries — occlusion causes MI\n", options: { fontSize: 11 } },
], { x: 0.28, y: 3.6, w: 5.2, h: 1.7, fontFace: "Calibri", color: C.darkGray, paraSpaceAfter: 3 });
// Coronary image
sl.addShape(pres.ShapeType.rect, { x: 5.6, y: 0.85, w: 4.1, h: 4.45, fill: { color: "F0DDD0" }, line: { color: C.midRed, width: 1 } });
addImg(sl, 3, 5.65, 0.9, 4.0, 4.35);
sl.addText("Coronary Arteries\n(Color Atlas of Human Anatomy, Thieme)", {
x: 5.6, y: 5.32, w: 4.1, h: 0.3, fontSize: 7.5, color: C.subtext, align: "center", fontFace: "Calibri", italic: true
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 8 — Blood Flow Through the Heart
// ════════════════════════════════════════════════════════════════════════════
{
let sl = pres.addSlide();
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 5.625, fill: { color: "0B1120" } });
redBar(sl);
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: "1A2E4A" } });
sl.addText("BLOOD FLOW THROUGH THE HEART", {
x: 0.3, y: 0.1, w: 9.4, h: 0.55,
fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
// Pulmonary circuit
sl.addShape(pres.ShapeType.rect, { x: 0.28, y: 0.85, w: 4.35, h: 4.45, fill: { color: "122040" }, line: { color: "4A8FC0", width: 1.5 } });
sl.addShape(pres.ShapeType.rect, { x: 0.28, y: 0.85, w: 4.35, h: 0.4, fill: { color: "1A3A5C" } });
sl.addText("PULMONARY (RIGHT SIDE)", { x: 0.38, y: 0.88, w: 4.15, h: 0.35, fontSize: 11, bold: true, color: "80C8FF", fontFace: "Calibri", margin: 0 });
const pulm = [
"SVC / IVC / Coronary sinus",
"→ Right Atrium",
"→ Tricuspid Valve (opens)",
"→ Right Ventricle",
"→ Pulmonary Valve (opens)",
"→ Pulmonary Trunk & Arteries",
"→ Lungs (gas exchange)",
];
sl.addText(pulm.map((p, i) => ({ text: p, options: { breakLine: i < pulm.length - 1, fontSize: 11.5, color: i === 0 ? "A0C8FF" : "D0E8FF", bold: i === 0 } })),
{ x: 0.38, y: 1.35, w: 4.05, h: 3.8, fontFace: "Calibri", paraSpaceAfter: 10 });
// Systemic circuit
sl.addShape(pres.ShapeType.rect, { x: 5.37, y: 0.85, w: 4.35, h: 4.45, fill: { color: "200A0A" }, line: { color: C.accent, width: 1.5 } });
sl.addShape(pres.ShapeType.rect, { x: 5.37, y: 0.85, w: 4.35, h: 0.4, fill: { color: C.darkRed } });
sl.addText("SYSTEMIC (LEFT SIDE)", { x: 5.47, y: 0.88, w: 4.15, h: 0.35, fontSize: 11, bold: true, color: C.gold, fontFace: "Calibri", margin: 0 });
const syst = [
"4 Pulmonary Veins",
"→ Left Atrium",
"→ Mitral Valve (opens)",
"→ Left Ventricle",
"→ Aortic Valve (opens)",
"→ Aorta",
"→ Body (systemic circulation)",
];
sl.addText(syst.map((p, i) => ({ text: p, options: { breakLine: i < syst.length - 1, fontSize: 11.5, color: i === 0 ? "FFB0A0" : "FFD8D0", bold: i === 0 } })),
{ x: 5.47, y: 1.35, w: 4.05, h: 3.8, fontFace: "Calibri", paraSpaceAfter: 10 });
// Arrow in middle
sl.addShape(pres.ShapeType.rect, { x: 4.63, y: 2.5, w: 0.74, h: 0.55, fill: { color: "1C2C3C" } });
sl.addText("↔", { x: 4.63, y: 2.5, w: 0.74, h: 0.55, fontSize: 20, color: C.white, align: "center", fontFace: "Calibri" });
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 9 — Pericardium
// ════════════════════════════════════════════════════════════════════════════
{
let sl = pres.addSlide();
creamBg(sl);
redBar(sl);
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.midRed } });
sl.addText("THE PERICARDIUM", {
x: 0.3, y: 0.1, w: 9.4, h: 0.55,
fontSize: 22, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
const pericardLayers = [
{ title: "Fibrous Pericardium", color: "8B1A1A", text: "Tough, outer fibrous sac. Prevents over-distension of the heart. Anchors heart to diaphragm, sternum and great vessels." },
{ title: "Parietal Serous Pericardium", color: "B22222", text: "Inner lining of fibrous pericardium. Mesothelial cell layer. Reflects at great vessels to become visceral layer." },
{ title: "Pericardial Cavity", color: "C0392B", text: "Potential space between parietal and visceral layers. Contains 15–50 mL serous fluid that lubricates the heart during beating." },
{ title: "Visceral Serous Pericardium (Epicardium)", color: "E74C3C", text: "Adheres directly to myocardium. Contains coronary vessels in adipose tissue. Considered the outermost layer of the heart wall." },
];
pericardLayers.forEach((pl, i) => {
const y = 0.85 + i * 1.14;
sl.addShape(pres.ShapeType.roundRect, { x: 0.28, y, w: 9.4, h: 1.05, rectRadius: 0.05, fill: { color: "FFF5F5" }, line: { color: pl.color, width: 1.5 } });
sl.addShape(pres.ShapeType.roundRect, { x: 0.28, y, w: 2.8, h: 1.05, rectRadius: 0.05, fill: { color: pl.color } });
sl.addText(pl.title, { x: 0.35, y: y + 0.26, w: 2.65, h: 0.55, fontSize: 11, bold: true, color: C.white, align: "center", fontFace: "Calibri", margin: 0 });
sl.addText(pl.text, { x: 3.2, y: y + 0.12, w: 6.3, h: 0.8, fontSize: 11.5, color: C.darkGray, fontFace: "Calibri" });
});
sl.addText("Clinical: Pericarditis causes sharp positional chest pain. Cardiac tamponade (>200 mL rapid effusion) compresses chambers — pulsus paradoxus, Beck's triad (hypotension, muffled heart sounds, raised JVP). Treat with pericardiocentesis.", {
x: 0.28, y: 5.4, w: 9.4, h: 0, fontSize: 9, color: C.subtext, italic: true, fontFace: "Calibri"
});
}
// ════════════════════════════════════════════════════════════════════════════
// SLIDE 10 — Summary / Key Facts
// ════════════════════════════════════════════════════════════════════════════
{
let sl = pres.addSlide();
darkBg(sl);
sl.addShape(pres.ShapeType.rect, { x: 0, y: 0, w: 10, h: 0.75, fill: { color: C.accent } });
sl.addText("KEY FACTS — ANATOMY OF THE HEART", {
x: 0.3, y: 0.1, w: 9.4, h: 0.55,
fontSize: 21, bold: true, color: C.white, fontFace: "Calibri", margin: 0
});
const facts = [
["Size", "~250–300 g, fist-sized, in middle mediastinum"],
["Layers", "Epicardium → Myocardium → Endocardium"],
["Chambers", "4 chambers: RA, RV (pulmonary) + LA, LV (systemic)"],
["AV Valves", "Tricuspid (right), Mitral/Bicuspid (left) — chordae tendineae + papillary muscles"],
["Semilunar Valves", "Pulmonary (RV outlet), Aortic (LV outlet) — 3 cusps each"],
["Conduction", "SA Node → AV Node → Bundle of His → Bundle Branches → Purkinje fibers"],
["Coronary", "LCA (LAD + Circumflex) supplies LV; RCA supplies RA, RV, SA/AV nodes"],
["Pericardium", "Fibrous + serous layers; 15–50 mL pericardial fluid; tamponade if fills rapidly"],
["Blood flow", "Deoxygenated: body → RA → RV → Lungs; Oxygenated: Lungs → LA → LV → Body"],
["Clinical pearl", "Coronary arteries are functional end-arteries; acute MI from plaque rupture + thrombosis"],
];
facts.forEach(([key, val], i) => {
const col = i % 2;
const row = Math.floor(i / 2);
const x = 0.28 + col * 4.85;
const y = 0.85 + row * 0.9;
sl.addShape(pres.ShapeType.rect, { x, y, w: 4.6, h: 0.78, fill: { color: "1C1C2E" }, line: { color: C.accent, width: 0.8 } });
sl.addShape(pres.ShapeType.rect, { x, y, w: 1.4, h: 0.78, fill: { color: "2A0A14" } });
sl.addText(key, { x: x + 0.05, y: y + 0.14, w: 1.3, h: 0.5, fontSize: 9.5, bold: true, color: C.gold, align: "center", fontFace: "Calibri", margin: 0 });
sl.addText(val, { x: x + 1.5, y: y + 0.08, w: 3.0, h: 0.62, fontSize: 9.5, color: "D8D0E8", fontFace: "Calibri" });
});
sl.addText("Sources: Goldman-Cecil Medicine · Histology: A Text and Atlas (Mescher) · Costanzo Physiology · Color Atlas of Human Anatomy (Thieme)", {
x: 0.28, y: 5.35, w: 9.4, h: 0.25, fontSize: 7.5, color: C.subtext, fontFace: "Calibri", italic: true
});
}
// ─── Save ────────────────────────────────────────────────────────────────────
pres.writeFile({ fileName: "/home/daytona/workspace/heart-anatomy-ppt/Heart_Anatomy.pptx" })
.then(() => console.log("✓ Saved: Heart_Anatomy.pptx"))
.catch(e => console.error("Save error:", e));
cd /home/daytona/workspace/heart-anatomy-ppt && node create_ppt.js 2>&1
node /home/daytona/skills/shared/scripts/fetch_images.js \ "https://upload.wik…
ls -lh /home/daytona/workspace/heart-anatomy-ppt/Heart_Anatomy.pptx
cd /home/daytona/workspace/heart-anatomy-ppt && python3 -m markitdown Heart_Anat…
cd /home/daytona/workspace/heart-anatomy-ppt && node -e " const pptxgen = requir…
Heart Anatomy
Presentation · PPTX
| Slide | Title |
|---|---|
| 1 | Title Slide — bold dark red theme |
| 2 | Overview & Position (size, mediastinum, orientation) |
| 3 | Layers of the Heart Wall (Epicardium, Myocardium, Endocardium — 3 color-coded cards) |
| 4 | Four Chambers (RA, RV, LA, LV with key facts) |
| 5 | Heart Valves (AV valves vs Semilunar valves, leaflet counts, clinical notes) |
| 6 | Cardiac Conduction System (SA node → AV node → His → Purkinje, step-by-step) |
| 7 | Coronary Circulation (LCA/LAD/Circumflex vs RCA with territories) |
| 8 | Blood Flow Through the Heart (Pulmonary vs Systemic circuit side-by-side) |
| 9 | The Pericardium (4 layers + cardiac tamponade / Beck's triad) |
| 10 | Summary Key Facts (10 fact cards — quick revision reference) |