WF 06
Slope Analysis
Rhino + Grasshopper · Python · Claude Chat
Week11
SurfaceWF04 Patch
AssignmentA surface analysis script for your WF04 terrain — submit the spec, the .py file, and one isometric viewport screenshot.
Rhino
→
Grasshopper
→
Claude Chat
→
Python Script
→
Slope Mesh
A surface is a function. Every point has a position, a normal vector, and a slope. You will write a Grasshopper Python script that queries your WF04 Patch surface and colors it by slope — not from scratch, but by specifying what you want precisely enough that Claude can write it.
The central skill is converting intention into specification. Students who get bad scripts back under-specified the geometry.
01
Understand the Geometry
In class — no computers
Answer these in plain English before opening Claude.
- How do you locate a point on a surface? UV parameters — two numbers addressing any point in the surface domain.
- How do you ask a surface which way it faces? The normal vector — perpendicular to the surface at that UV location.
- How do you measure slope from a normal? Angle between the normal and world Z. Flat = 0°, vertical = 90°.
- What counts as steep in landscape terms? Walkable. Wheelchair-accessible. Water-shedding. Design thresholds, not arbitrary numbers.
02
Interview Claude to Build Your Spec
CHAT
Open a new Claude chat. Paste this starter prompt exactly:
I'm a landscape architecture student working in Rhino 8 Grasshopper. I want to write a Python script that analyzes my surface. Before writing any code or spec, interview me one question at a time to understand exactly what I need. Do not write code yet. Do not move to the next question until I answer.
Answer each question. Push visual answers ("I want it to look like…") toward geometric ones ("the script needs to measure…").
After the last question, Claude summarizes the spec — inputs, outputs, color scale, edge cases. Review it. Confirm and ask Claude to write the script. Everything stays in one conversation.
The spec is a deliverable — copy it out of the chat when you're done.
Example: Sample interview + spec chat
03
Set Up the Python Component
GH
Add a Python 3 Script component. Use the input and output names from your Stage 2 spec — Claude's script will list them as comments at the top.
- Inputs — one per geometry or parameter the script needs
- Output — one per result
Right-click each input and set the type hint. Without this, Grasshopper passes GUIDs instead of geometry and the script errors immediately. Outputs don't need a type hint.
Wire inputs to geometry and parameters already on your canvas.
04
Execute and Debug
CHAT
GH
Ask Claude to write the script. Paste it into the Python component and hit Run. The loop — run, error, fix — is normal.
- Errors: copy the full error message and paste it back to Claude.
- Wrong output: screenshot and describe what you see.
Common issues
- Errors immediately → type hints not set on inputs
- Colors flipped → tell Claude; it will fix the normal direction
- Mesh doesn't appear → viewport must be in Shaded mode; output wired to a Mesh parameter
Tips
- Slow down in the interview. Rushing past it skips the thinking.
- A vague prompt gets a generic script. The model isn't the problem.
- Describe what must be true when it works, not how the code should work.
- Patch extends beyond your boundary. Tell Claude to exclude faces outside it — you don't need to know how, just that the problem exists.