ELI5

Reading File
Running Command

python3 -c " from pypdf import PdfReader reader = PdfReader('/home/daytona/works…

analyse_media
Running Command

python3 -c " import fitz # PyMuPDF doc = fitz.open('/home/daytona/workspace/att…

Running Command

pip install --user pymupdf -q && python3 -c " import fitz doc = fitz.open('/home…

Running Command

python3 -c " import fitz import os doc = fitz.open('/home/daytona/workspace/atta…

Loading Image
Loading Image
Loading Image
Loading Image
Loading Image
Running Command

python3 -c " import base64, os # Encode page 1 as base64 to check if it has actu…

Running Command

tesseract /home/daytona/workspace/neural_pages/page_1.png /tmp/page1_ocr && cat …

Running Command

tesseract /home/daytona/workspace/neural_pages/page_2.png /tmp/page2_ocr && cat …

Running Command

for i in $(seq 1 10); do tesseract /home/daytona/workspace/neural_pages/page_$…

I now have enough content from the OCR to piece together all the topics covered in this PDF. Let me give you a full ELI5 explanation of everything in these notes.

🧠 Neural Control & Coordination (Part 1) - ELI5

Imagine your body is a huge country. The nervous system is the country's communication network - it sends messages so every part knows what's happening and what to do.

1. What Does the Nervous System Do?

Your nervous system has three jobs:
  • Detect things happening around you (hot, cold, pain, sound)
  • Receive those signals
  • Transmit (send) them to the right place
Simple animals like Hydra just have a loose net of nerve cells - like a group chat with no admin. Insects have a brain plus extra mini-control centers called ganglia. Vertebrates (like us) have the most developed nervous system - a full headquarters with branches everywhere.

2. The Neuron - The Basic Unit

A neuron is just a message-carrying cell. Think of it like a tiny electrical wire.
Parts of a neuron:
  • Dendrites - the "antennae" that receive signals
  • Cell body - the "headquarters" that processes the signal
  • Axon - the long "wire" that sends the signal forward
Types of neurons (by shape):
TypeWhat it looks like
MultipolarOne axon + many dendrites (most common)
BipolarOne axon + one dendrite
UnipolarJust one process

Myelinated vs Non-Myelinated Nerve Fibres

Some axons are wrapped in a myelin sheath - like insulation on an electrical wire. This makes signals travel faster.
  • Myelinated fibres have Schwann cells that form the myelin sheath
  • Non-myelinated fibres lack this coating - signals are slower
  • Myelinated fibres appear white (that's why we have "white matter" in the brain!)

3. Where Are Nerve Cell Bodies Stored?

LocationCell bodies calledNerve fibres called
CNS (brain/spinal cord)NucleiTracts
PNS (outside brain)GangliaNerves

4. How Do Signals Actually Travel? (Action Potential)

Think of your neuron like a water balloon - normally the inside is different from the outside. This difference creates electrical "pressure."
  • At rest: more K⁺ inside, more Na⁺ outside (opposite charges on each side)
  • When a signal comes: Na⁺ rushes in β†’ the neuron flips its charge β†’ this is called DEPOLARISATION
  • Then the Na-K pump resets everything back to normal so the neuron can fire again
It's like a row of dominoes falling - the signal travels down the axon one section at a time.

5. How Do Neurons Talk to Each Other? (Synapse)

Neurons don't actually touch. There's a tiny gap between them called a synapse.
  • Electrical synapse: the two neurons are very close, the signal jumps straight across (fast)
  • Chemical synapse: there's a gap, so the first neuron releases chemical messengers (neurotransmitters) that float across and trigger the next neuron (slightly slower but more controllable)

6. The Brain - Your Body's Headquarters

The brain is divided into major regions:

Forebrain

  • Cerebrum - the big wrinkly part. Handles thinking, memory, speech, voluntary movement. It's heavily folded (convoluted) to pack in more neurons in less space.
  • Diencephalon - contains the Thalamus and Hypothalamus (controls hunger, thirst, temperature, and hormones)
  • Olfactory lobes - for smell

Midbrain

  • Contains the Corpora Quadrigemina (four bumps that handle visual and hearing reflexes)
  • Has a canal called the Cerebral Aqueduct passing through it

Hindbrain

  • Pons - connects different brain regions, helps with breathing
  • Cerebellum - your body's balance and coordination center (like the autopilot for smooth movement)
  • Medulla Oblongata - controls automatic vital functions like breathing, heart rate, and digestion - the stuff that keeps you alive without you thinking about it

7. Reflex Action - Your Body's Fast Lane

Sometimes your body can't wait for your brain to make a decision. If you touch something hot, your hand pulls away before your brain even knows! This is a reflex arc.
The signal goes:
Receptor β†’ Sensory neuron β†’ Spinal cord β†’ Motor neuron β†’ Muscle
The spinal cord processes it directly, skipping the slow route to the brain. That's why the knee-jerk reflex happens instantly when a doctor taps your knee.

8. Association - Putting Signals Together

The brain's cortex doesn't just receive signals - it associates them. For example, it combines sensory inputs from multiple sources to coordinate a proper response. This is how you can recognize a song AND remember where you first heard it at the same time.

In short: Your nervous system is like a country's phone network - neurons are the wires, action potentials are the calls, synapses are the telephone exchanges, your brain is the capital city with different departments, and reflex arcs are the emergency local shortcuts that don't need to go through headquarters!

Mindmap pdf

Running Command

python3 -c " import fitz, os doc = fitz.open('/home/daytona/workspace/attachment…

Running Command

python3 -c " import fitz, os doc = fitz.open('/home/daytona/workspace/attachment…

Running Command

python3 -c " import fitz, os doc = fitz.open('/home/daytona/workspace/attachment…

Running Command

python3 -c " import fitz, os doc = fitz.open('/home/daytona/workspace/attachment…

Running Command

for i in $(seq 1 22); do echo "=== PAGE $i ===" tesseract /home/daytona/work…

Writing File

~/excretion_mindmap/mindmap.py

import math
import os
from reportlab.lib.pagesizes import A3, landscape
from reportlab.pdfgen import canvas
from reportlab.lib import colors
from reportlab.lib.colors import HexColor
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase import pdfmetrics

os.makedirs('/home/daytona/workspace/excretion_mindmap', exist_ok=True)

# ── Mindmap data structure ────────────────────────────────────────────────────
# Each node: (label, color, [children])
TREE = {
    "label": "EXCRETION",
    "color": "#1a1a2e",
    "children": [
        {
            "label": "Types of\nExcretory\nWaste",
            "color": "#16213e",
            "children": [
                {"label": "Ammonotelism\n(Ammonia)\nAquatic animals", "color": "#0f3460"},
                {"label": "Ureotelism\n(Urea)\nAmphibians,\nMammals", "color": "#0f3460"},
                {"label": "Uricotelism\n(Uric Acid)\nReptiles, Birds,\nInsects, Snails", "color": "#0f3460"},
            ]
        },
        {
            "label": "Excretory\nOrgans in\nAnimals",
            "color": "#533483",
            "children": [
                {"label": "Platyhelminthes\nFlame cells", "color": "#6a3d9a"},
                {"label": "Aschelminthes\nRenette cells", "color": "#6a3d9a"},
                {"label": "Crustaceans\nAntennary/\nGreen gland", "color": "#6a3d9a"},
                {"label": "Insects\nMalpighian\ntubules", "color": "#6a3d9a"},
                {"label": "Arachnida\nCoxal glands", "color": "#6a3d9a"},
                {"label": "Vertebrates\nKidney", "color": "#6a3d9a"},
                {"label": "Mollusca\nOrgan of Bojanus\n& Keber's organ", "color": "#6a3d9a"},
            ]
        },
        {
            "label": "Human\nExcretory\nSystem",
            "color": "#e94560",
            "children": [
                {"label": "Kidneys (Γ—2)\nBean-shaped,\nretroperitoneal", "color": "#c23152"},
                {"label": "Ureters (Γ—2)\nCarry urine to\nbladder", "color": "#c23152"},
                {"label": "Urinary Bladder\nStores urine", "color": "#c23152"},
                {"label": "Urethra\nExpels urine\nout of body", "color": "#c23152"},
            ]
        },
        {
            "label": "Nephron\n(Functional\nUnit)",
            "color": "#057a55",
            "children": [
                {"label": "Bowman's\nCapsule\n+ Glomerulus\n(Filtration)", "color": "#065f46"},
                {"label": "PCT\nProximal\nConvoluted\nTubule", "color": "#065f46"},
                {"label": "Loop of\nHenle\n(Ascending\n& Descending)", "color": "#065f46"},
                {"label": "DCT\nDistal\nConvoluted\nTubule", "color": "#065f46"},
                {"label": "Collecting\nDuct", "color": "#065f46"},
            ]
        },
        {
            "label": "Urine\nFormation",
            "color": "#b45309",
            "children": [
                {"label": "Ultrafiltration\nGFR = 125 mL/min\n(180 L/day filtered)", "color": "#92400e"},
                {"label": "Reabsorption\nPCT: Na⁺, Glucose,\nAA (active);\nUrea (passive)", "color": "#92400e"},
                {"label": "Loop of Henle\nWater & NaCl\n(countercurrent)", "color": "#92400e"},
                {"label": "DCT & CD\nConditional reabsorp.\nNa⁺, HCO₃⁻, Water", "color": "#92400e"},
                {"label": "Tubular\nSecretion\nH⁺, K⁺, NH₃", "color": "#92400e"},
            ]
        },
        {
            "label": "Normal\nUrine\nComposition",
            "color": "#1e40af",
            "children": [
                {"label": "Volume:\n1–1.5 L/day", "color": "#1e3a8a"},
                {"label": "pH: 6.0\n(acidic)", "color": "#1e3a8a"},
                {"label": "Colour:\nLight Yellow\n(Urochrome)", "color": "#1e3a8a"},
                {"label": "Urea:\n25–30 g/day", "color": "#1e3a8a"},
            ]
        },
        {
            "label": "Regulation\n(RAAS)",
            "color": "#065f46",
            "children": [
                {"label": "Low GFR/BP\n→ Renin release\nfrom JGA", "color": "#047857"},
                {"label": "Angiotensinogen\n→ Angiotensin I\n→ Angiotensin II", "color": "#047857"},
                {"label": "Vasoconstriction\n↑ BP", "color": "#047857"},
                {"label": "Aldosterone\nrelease β†’ Na⁺\n& water retention", "color": "#047857"},
            ]
        },
        {
            "label": "Disorders",
            "color": "#7f1d1d",
            "children": [
                {"label": "Glomerulonephritis\nInflammation of\nglomeruli", "color": "#991b1b"},
                {"label": "Renal Calculi\nCrystallised salt\nstones (oxalates)", "color": "#991b1b"},
                {"label": "Renal Failure\nTreatment:\nDialysis /\nTransplant", "color": "#991b1b"},
                {"label": "Uremia\nExcess urea\nin blood", "color": "#991b1b"},
                {"label": "Glycosuria\nGlucose in urine\n(Diabetes Mellitus)", "color": "#991b1b"},
                {"label": "Ketonuria\nKetone bodies\nin urine", "color": "#991b1b"},
            ]
        },
        {
            "label": "Other\nExcretory\nOrgans",
            "color": "#4a1942",
            "children": [
                {"label": "Liver\nUrea synthesis\n(Ornithine cycle)", "color": "#6b21a8"},
                {"label": "Lungs\nCOβ‚‚ & water\nvapour", "color": "#6b21a8"},
                {"label": "Skin\nSweat glands\n(NaCl, urea)", "color": "#6b21a8"},
            ]
        },
    ]
}

# ── Drawing helpers ───────────────────────────────────────────────────────────
PAGE_W, PAGE_H = landscape(A3)   # 1190 x 842 pts
CX, CY = PAGE_W / 2, PAGE_H / 2  # centre

def hex_to_color(h):
    h = h.lstrip('#')
    r, g, b = int(h[0:2],16)/255, int(h[2:4],16)/255, int(h[4:6],16)/255
    return colors.Color(r, g, b)

def draw_rounded_box(c, x, y, w, h, radius, fill_color, stroke_color=None):
    c.setFillColor(fill_color)
    if stroke_color:
        c.setStrokeColor(stroke_color)
        c.setLineWidth(1.5)
    else:
        c.setStrokeColor(colors.white)
        c.setLineWidth(0.5)
    c.roundRect(x - w/2, y - h/2, w, h, radius, fill=1, stroke=1)

def draw_text_in_box(c, text, x, y, font_size=7, color=colors.white, max_w=None):
    c.setFillColor(color)
    lines = text.split('\n')
    line_h = font_size * 1.25
    total_h = len(lines) * line_h
    start_y = y + total_h/2 - line_h * 0.8
    for i, line in enumerate(lines):
        c.setFont("Helvetica-Bold", font_size)
        c.drawCentredString(x, start_y - i * line_h, line)

def draw_curved_line(c, x1, y1, x2, y2, color, width=1.5):
    c.setStrokeColor(color)
    c.setLineWidth(width)
    mx = (x1 + x2) / 2
    my = (y1 + y2) / 2
    # slight curve via bezier
    from reportlab.graphics.shapes import Path
    p = c.beginPath()
    p.moveTo(x1, y1)
    cx1 = x1 + (x2 - x1) * 0.35
    cy1 = y1
    cx2 = x1 + (x2 - x1) * 0.65
    cy2 = y2
    p.curveTo(cx1, cy1, cx2, cy2, x2, y2)
    c.drawPath(p, stroke=1, fill=0)

# ── Main draw ─────────────────────────────────────────────────────────────────
out_path = '/home/daytona/workspace/excretion_mindmap/Excretion_Mindmap.pdf'
c = canvas.Canvas(out_path, pagesize=landscape(A3))

# Background gradient simulation (dark)
c.setFillColor(HexColor('#0d1117'))
c.rect(0, 0, PAGE_W, PAGE_H, fill=1, stroke=0)

# Subtle radial rings for aesthetics
for r in [50, 120, 200, 290, 390]:
    c.setStrokeColor(HexColor('#1e2a3a'))
    c.setLineWidth(0.5)
    c.circle(CX, CY, r, fill=0, stroke=1)

# ── Central node ──────────────────────────────────────────────────────────────
center_r = 52
c.setFillColor(HexColor('#e94560'))
c.circle(CX, CY, center_r, fill=1, stroke=0)
c.setFillColor(HexColor('#ff6b8a'))
c.circle(CX, CY, center_r - 4, fill=1, stroke=0)
c.setFillColor(colors.white)
c.setFont("Helvetica-Bold", 13)
c.drawCentredString(CX, CY + 6, "EXCRETION")
c.setFont("Helvetica", 7.5)
c.drawCentredString(CX, CY - 8, "Class 11 Biology")

# ── Branch nodes ─────────────────────────────────────────────────────────────
branches = TREE["children"]
n = len(branches)
# Distribute evenly, offset by 90 degrees so first branch is at top
branch_angles = [90 - i * (360 / n) for i in range(n)]

# Branch ring radius
BRANCH_R = 310     # distance from centre to branch node centre
LEAF_R   = 195     # extra radial distance for leaf nodes from branch

branch_box_w = 95
branch_box_h = 50

leaf_box_w = 105
leaf_box_h = 52

for i, (branch, angle) in enumerate(zip(branches, branch_angles)):
    rad = math.radians(angle)
    bx = CX + BRANCH_R * math.cos(rad)
    by = CY + BRANCH_R * math.sin(rad)

    bc = hex_to_color(branch["color"])
    # Brighten branch color slightly
    bright = HexColor(branch["color"])

    # Line from centre to branch
    draw_curved_line(c, CX, CY, bx, by, hex_to_color(branch["color"]), width=2.5)

    # Branch box
    draw_rounded_box(c, bx, by, branch_box_w, branch_box_h, 10,
                     hex_to_color(branch["color"]),
                     colors.white)
    draw_text_in_box(c, branch["label"], bx, by, font_size=8)

    # Leaf nodes
    children = branch.get("children", [])
    nc = len(children)
    if nc == 0:
        continue

    # Spread leaves in a fan around the branch direction
    fan_span = min(60, 20 * nc)
    leaf_angles = [angle + fan_span/2 - j*(fan_span/(nc-1 if nc > 1 else 1)) for j in range(nc)]

    for j, (leaf, lang) in enumerate(zip(children, leaf_angles)):
        lrad = math.radians(lang)
        # leaf position: from branch node outward
        lx = bx + LEAF_R * math.cos(lrad)
        ly = by + LEAF_R * math.sin(lrad)

        lc = hex_to_color(leaf["color"])
        # Thin line from branch to leaf
        draw_curved_line(c, bx, by, lx, ly, lc, width=1.2)

        draw_rounded_box(c, lx, ly, leaf_box_w, leaf_box_h, 8, lc, None)
        draw_text_in_box(c, leaf["label"], lx, ly, font_size=6.5)

# ── Title / watermark ─────────────────────────────────────────────────────────
c.setFillColor(HexColor('#ffffff'))
c.setFont("Helvetica-Bold", 10)
c.drawString(20, 20, "Neural Control & Coordination β€” Chapter: Excretion in Organisms | Class 11 Biology")
c.setFont("Helvetica", 8)
c.setFillColor(HexColor('#aaaaaa'))
c.drawRightString(PAGE_W - 20, 20, "KV eDUCATION")

c.save()
print(f"Saved: {out_path}")
Running Command

python3 /home/daytona/workspace/excretion_mindmap/mindmap.py 2>&1

Running Command

ls -lh /home/daytona/workspace/excretion_mindmap/Excretion_Mindmap.pdf && python…

Loading Image
Running Command

python3 -c " # Quick sanity check - verify branch and leaf positions are within …

Writing File

~/excretion_mindmap/mindmap.py

import math
import os
from reportlab.lib.pagesizes import A3, landscape
from reportlab.pdfgen import canvas
from reportlab.lib import colors
from reportlab.lib.colors import HexColor

os.makedirs('/home/daytona/workspace/excretion_mindmap', exist_ok=True)

TREE = {
    "label": "EXCRETION",
    "children": [
        {
            "label": "Types of\nExcretory Waste",
            "color": "#2563eb",
            "children": [
                {"label": "Ammonotelism\n(Ammonia)\nAquatic animals", "color": "#1d4ed8"},
                {"label": "Ureotelism\n(Urea)\nAmphibians,\nMammals", "color": "#1d4ed8"},
                {"label": "Uricotelism\n(Uric Acid)\nReptiles, Birds,\nInsects, Snails", "color": "#1d4ed8"},
            ]
        },
        {
            "label": "Excretory Organs\nin Animals",
            "color": "#7c3aed",
            "children": [
                {"label": "Platyhelminthes\nFlame cells", "color": "#6d28d9"},
                {"label": "Aschelminthes\nRenette cells", "color": "#6d28d9"},
                {"label": "Crustaceans\nAntennary/\nGreen gland", "color": "#6d28d9"},
                {"label": "Insects\nMalpighian\ntubules", "color": "#6d28d9"},
                {"label": "Vertebrates\nKidney", "color": "#6d28d9"},
                {"label": "Mollusca\nOrgan of Bojanus\n& Keber's organ", "color": "#6d28d9"},
            ]
        },
        {
            "label": "Human\nExcretory System",
            "color": "#dc2626",
            "children": [
                {"label": "Kidneys Γ—2\nBean-shaped,\nretroperitoneal", "color": "#b91c1c"},
                {"label": "Ureters Γ—2\nCarry urine\nto bladder", "color": "#b91c1c"},
                {"label": "Urinary Bladder\nStores urine", "color": "#b91c1c"},
                {"label": "Urethra\nExpels urine", "color": "#b91c1c"},
            ]
        },
        {
            "label": "Nephron\n(Functional Unit)",
            "color": "#059669",
            "children": [
                {"label": "Bowman's Capsule\n+ Glomerulus\nUltrafiltration", "color": "#047857"},
                {"label": "PCT\nReabsorption\n(Na⁺, Glucose, AA)", "color": "#047857"},
                {"label": "Loop of Henle\nCountercurrent\nmechanism", "color": "#047857"},
                {"label": "DCT\nConditional\nreabsorption", "color": "#047857"},
                {"label": "Collecting Duct\nFinal urine\nconcentration", "color": "#047857"},
            ]
        },
        {
            "label": "Urine\nFormation",
            "color": "#d97706",
            "children": [
                {"label": "GFR = 125 mL/min\n180 L filtered/day\n1.5 L urine/day", "color": "#b45309"},
                {"label": "Reabsorption\nPCT: active (Na⁺,\nGlucose, AA)\nPassive (Urea)", "color": "#b45309"},
                {"label": "Secretion\nH⁺, K⁺, NH₃\ninto tubule", "color": "#b45309"},
            ]
        },
        {
            "label": "Normal Urine\nComposition",
            "color": "#0891b2",
            "children": [
                {"label": "Volume:\n1–1.5 L/day", "color": "#0e7490"},
                {"label": "pH: 6.0 (acidic)", "color": "#0e7490"},
                {"label": "Colour:\nLight Yellow\n(Urochrome)", "color": "#0e7490"},
                {"label": "Urea:\n25–30 g/day", "color": "#0e7490"},
            ]
        },
        {
            "label": "RAAS\nRegulation",
            "color": "#16a34a",
            "children": [
                {"label": "Low BP/GFR\n→ Renin\nfrom JGA", "color": "#15803d"},
                {"label": "Angiotensinogen\n→ Angiotensin I\n→ Angiotensin II", "color": "#15803d"},
                {"label": "Vasoconstriction\n↑ BP", "color": "#15803d"},
                {"label": "Aldosterone\nNa⁺ & water\nretention", "color": "#15803d"},
            ]
        },
        {
            "label": "Disorders",
            "color": "#e11d48",
            "children": [
                {"label": "Glomerulonephritis\nInflammation of\nglomeruli", "color": "#9f1239"},
                {"label": "Renal Calculi\nCrystallised salts\n(oxalates)", "color": "#9f1239"},
                {"label": "Renal Failure\nDialysis /\nTransplant", "color": "#9f1239"},
                {"label": "Uremia\nExcess urea\nin blood", "color": "#9f1239"},
                {"label": "Glycosuria\nGlucose in urine\n(Diabetes Mellitus)", "color": "#9f1239"},
                {"label": "Ketonuria\nKetone bodies\nin urine", "color": "#9f1239"},
            ]
        },
        {
            "label": "Other Excretory\nOrgans",
            "color": "#9333ea",
            "children": [
                {"label": "Liver\nUrea synthesis\nOrnithine cycle", "color": "#7e22ce"},
                {"label": "Lungs\nCOβ‚‚ & water\nvapour", "color": "#7e22ce"},
                {"label": "Skin\nSweat glands\nNaCl, urea", "color": "#7e22ce"},
            ]
        },
    ]
}

PAGE_W, PAGE_H = landscape(A3)
CX, CY = PAGE_W / 2, PAGE_H / 2
MARGIN = 55

def clamp(v, lo, hi):
    return max(lo, min(hi, v))

def hex_to_color(h):
    h = h.lstrip('#')
    r, g, b = int(h[0:2],16)/255, int(h[2:4],16)/255, int(h[4:6],16)/255
    return colors.Color(r, g, b)

def draw_rounded_box(c, x, y, w, h, radius, fill_hex, alpha=1.0):
    fc = hex_to_color(fill_hex)
    c.setFillColor(fc)
    c.setStrokeColor(colors.Color(1,1,1,0.35))
    c.setLineWidth(1)
    c.roundRect(x - w/2, y - h/2, w, h, radius, fill=1, stroke=1)

def draw_text_centered(c, text, x, y, font_size=7.5, color=colors.white):
    c.setFillColor(color)
    lines = text.split('\n')
    line_h = font_size * 1.3
    total_h = (len(lines) - 1) * line_h
    start_y = y + total_h / 2
    for i, line in enumerate(lines):
        c.setFont("Helvetica-Bold", font_size)
        c.drawCentredString(x, start_y - i * line_h, line)

def bezier_line(c, x1, y1, x2, y2, col_hex, width=1.8):
    c.setStrokeColor(hex_to_color(col_hex))
    c.setLineWidth(width)
    p = c.beginPath()
    p.moveTo(x1, y1)
    cx1 = x1 + (x2 - x1) * 0.4
    cy1 = y1
    cx2 = x1 + (x2 - x1) * 0.6
    cy2 = y2
    p.curveTo(cx1, cy1, cx2, cy2, x2, y2)
    c.drawPath(p, stroke=1, fill=0)

# Compact radii to keep everything inside the page
BRANCH_R = 260
LEAF_EXTRA = 170

out_path = '/home/daytona/workspace/excretion_mindmap/Excretion_Mindmap.pdf'
c = canvas.Canvas(out_path, pagesize=landscape(A3))

# ── Background ────────────────────────────────────────────────────────────────
c.setFillColor(HexColor('#0d1117'))
c.rect(0, 0, PAGE_W, PAGE_H, fill=1, stroke=0)

# Decorative rings
for r, a in [(50,0.15),(130,0.1),(230,0.07),(330,0.05)]:
    c.setStrokeColor(colors.Color(0.3, 0.5, 0.8, a))
    c.setLineWidth(0.5)
    c.circle(CX, CY, r, fill=0, stroke=1)

# ── Branches ──────────────────────────────────────────────────────────────────
branches = TREE["children"]
n = len(branches)
branch_angles = [90 - i * (360 / n) for i in range(n)]
BW, BH = 90, 44   # branch box dims
LW, LH = 100, 52  # leaf box dims

for bi, (branch, angle) in enumerate(zip(branches, branch_angles)):
    brad = math.radians(angle)
    bx = CX + BRANCH_R * math.cos(brad)
    by = CY + BRANCH_R * math.sin(brad)
    bx = clamp(bx, MARGIN + BW/2, PAGE_W - MARGIN - BW/2)
    by = clamp(by, MARGIN + BH/2, PAGE_H - MARGIN - BH/2)

    # Line: centre β†’ branch
    bezier_line(c, CX, CY, bx, by, branch["color"], width=2.2)

    # Branch box
    draw_rounded_box(c, bx, by, BW, BH, 9, branch["color"])
    draw_text_centered(c, branch["label"], bx, by, font_size=8)

    # Leaf nodes
    children = branch.get("children", [])
    nc = len(children)
    if nc == 0:
        continue

    # Fan spread (narrower for many children)
    fan = min(55, max(25, 12 * nc))
    if nc == 1:
        leaf_angles = [angle]
    else:
        leaf_angles = [angle + fan/2 - j * fan/(nc-1) for j in range(nc)]

    for li, (leaf, lang) in enumerate(zip(children, leaf_angles)):
        lrad = math.radians(lang)
        lx = bx + LEAF_EXTRA * math.cos(lrad)
        ly = by + LEAF_EXTRA * math.sin(lrad)
        lx = clamp(lx, MARGIN + LW/2, PAGE_W - MARGIN - LW/2)
        ly = clamp(ly, MARGIN + LH/2, PAGE_H - MARGIN - LH/2)

        # Line: branch β†’ leaf
        bezier_line(c, bx, by, lx, ly, leaf["color"], width=1.1)

        # Leaf box
        draw_rounded_box(c, lx, ly, LW, LH, 7, leaf["color"])
        draw_text_centered(c, leaf["label"], lx, ly, font_size=6.5)

# ── Central node ──────────────────────────────────────────────────────────────
# Glow rings
for r, a in [(58,0.15),(50,0.3),(44,0.5)]:
    c.setFillColor(colors.Color(0.9, 0.27, 0.38, a))
    c.setStrokeColor(colors.transparent)
    c.circle(CX, CY, r, fill=1, stroke=0)

c.setFillColor(HexColor('#e94560'))
c.circle(CX, CY, 42, fill=1, stroke=0)

c.setFillColor(colors.white)
c.setFont("Helvetica-Bold", 13.5)
c.drawCentredString(CX, CY + 7, "EXCRETION")
c.setFont("Helvetica", 7)
c.setFillColor(HexColor('#ffcccc'))
c.drawCentredString(CX, CY - 7, "in Organisms")
c.drawCentredString(CX, CY - 17, "Class 11 Biology")

# ── Footer ────────────────────────────────────────────────────────────────────
c.setFillColor(HexColor('#888888'))
c.setFont("Helvetica", 7.5)
c.drawString(18, 14, "Excretion in Organisms  |  Chapter 19  |  Class 11 Biology")
c.drawRightString(PAGE_W - 18, 14, "KV eDUCATION")

c.save()
print("Saved:", out_path)
Editing File

~/excretion_mindmap/mindmap.py

Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/excretion_mindmap/mindmap.py'
Running Command

python3 /home/daytona/workspace/excretion_mindmap/mindmap.py 2>&1

Running Command

ls -lh /home/daytona/workspace/excretion_mindmap/Excretion_Mindmap.pdf

Your mindmap PDF is ready! Here's the download link:

Excretion Mindmap

PDF Document Β· PDF


What's in the mindmap (A3 Landscape, dark theme):
The central node EXCRETION radiates out to 9 colour-coded branches, each with sub-nodes:
BranchColourKey sub-nodes
Types of Excretory WasteBlueAmmonotelism, Ureotelism, Uricotelism
Excretory Organs in AnimalsPurpleFlame cells, Malpighian tubules, Kidney, etc.
Human Excretory SystemRedKidneys, Ureters, Bladder, Urethra
Nephron (Functional Unit)GreenBowman's capsule, PCT, Loop of Henle, DCT, CD
Urine FormationAmberGFR, Reabsorption, Secretion
Normal Urine CompositionCyanVolume, pH, Colour, Urea content
RAAS RegulationGreenRenin, Angiotensin II, Aldosterone
DisordersRoseGlycosuria, Ketonuria, Uremia, Renal Calculi, etc.
Other Excretory OrgansVioletLiver, Lungs, Skin
This is a shared conversation. Sign in to Orris to start your own chat.