Sliders, Domains and Remapping

Foundations · 03

Level Beginner

Time 45 minutes

You need Rhino 7/8 with Grasshopper

Every Grasshopper definition is a machine for turning a handful of numbers into geometry. The Number Slider is where design intent enters that machine. Domains describe the ranges those numbers live in, and remapping is how a value from one range drives behaviour in another — panel height driving opening size, floor level driving setback. Master these three ideas and much of parametric modelling collapses into one move: take a value from where it lives, and carry it, proportionally, to where you need it.

The Number Slider, properly

You will place thousands of sliders in your career, so learn the fast route now. The component lives under Params > Input > Number Slider, but the better habit is to double-click any empty patch of canvas and type a number into the search box: Grasshopper builds a slider on the spot. What you type matters:

  • Type 12 and you get an integer slider set to 12 — ideal for counts of panels, floors or divisions.
  • Type 0.35 and you get a floating-point slider; the number of decimal places you type sets the slider’s display precision.
  • Type minimum, value and maximum in one go using angle brackets, and the bounds are set for you as the slider is created:
0<50<100        integer slider, min 0, value 50, max 100
0.00<0.35<1.00  float slider, two decimals, min 0, value 0.35, max 1

To change a slider after the fact, right-click it and choose Edit… to open the slider settings. (Double-clicking the slider’s name and value readout is the shortcut for typing an exact value, not for opening the settings.) Here you control the essentials: the slider’s name, its rounding mode — floating point, integers, even numbers or odd numbers — its digits of precision, and its numeric minimum and maximum. The same dialog is reachable by right-clicking the slider and choosing Edit, and the right-click menu lets you rename the slider directly. Do this constantly. A definition with sliders named Panel Size, Min Opening and Max Opening is a design tool; one with fifteen sliders all reading 0.50 is a puzzle you have set your future self.

One point of craft: slider bounds are design decisions, not defaults. They define the envelope of your design space. If an opening radius above 0.7 m makes panels collide, the slider’s maximum should be 0.7 — not 10, with a mental note to be careful. Set bounds so every slider position produces a legal, buildable model, and your definition becomes safe to hand to a colleague or a client.

What a domain actually is

A domain is simply a numeric interval — a start value and an end value, treated as one piece of data. Connect one to a Panel and it prints in Grasshopper’s own notation:

0 To 1
-5.2 To 14.8

Domains are everywhere once you look. The Range component wants a domain to divide into steps. Every curve carries a parameter domain. Remapping needs two domains: where a value comes from, and where it is going. (Surfaces use two-dimensional domains, one interval per direction — we will meet those later in the track.)

Whenever you are unsure what a domain holds, wire it into a Panel — the fastest way to debug a remapping chain.

Construct Domain and Bounds

Two components build domains for you, and they answer two different questions.

Construct Domain (Maths > Domain) takes two numbers, A and B, and outputs the interval between them. Feed it two sliders and you have a designable range — this is how you will express “openings between 0.10 m and 0.65 m” shortly. Its mirror, Deconstruct Domain, splits a domain back into start and end when you need the raw numbers again.

Bounds (also under Maths > Domain) answers the other question: given a list of numbers, what interval spans them all? It outputs the domain from the smallest value to the largest, and it is the key to robust remapping. The rule is worth stating plainly: never hard-code a source domain when the data itself can tell you. If your driver values come from measured geometry — heights, distances, areas — let Bounds compute their extent, and the definition keeps working when the geometry changes.

Remap Numbers

Remap Numbers (Maths > Domain) is the workhorse. It takes a value V, a source domain S and a target domain T, and carries the value proportionally from one interval to the other: 30% of the way through the source comes out 30% of the way through the target. The arithmetic:

t = (v - source_start) / (source_end - source_start)
r = target_start + t * (target_end - target_start)

Three behaviours to understand before you trust it in production:

  • Values outside the source domain extrapolate. A value below the source start maps below the target start. The component’s second output gives the clipped result, held within the target domain — use it when overshoot would break geometry downstream.
  • A reversed target inverts the relationship. Domains are allowed to run downhill. Construct your target as 0.65 To 0.10 instead of 0.10 To 0.65 and the tallest panels get the smallest openings. No extra components, no subtraction tricks — just swap the wires into Construct Domain.
  • A zero-length source domain is meaningless. If every driver value is identical, Bounds produces an interval of zero width and there is no proportion to preserve. When a remap chain misbehaves, panel the source domain first.

Graph Mapper: easing without equations

Remap Numbers is strictly linear: double the input change, double the output change. Real facades rarely want that — you want openings that grow slowly near the base and accelerate towards the top, or bulge in the middle and taper at the ends. That shaping is the job of the Graph Mapper (Params > Input).

The Graph Mapper reads each incoming value along the horizontal axis of its graph and outputs the corresponding value from the curve — X in, Y out. Right-click it to choose a graph type: Linear, Bezier, Parabola, Sine, Gaussian and Power are the ones you will reach for most, each with draggable handles for tuning the curve by eye. The graph itself is shaped by dragging the handles on the component face. Its axes are fixed to the 0 To 1 range, which is why the conversion happens outside the component.

The professional pattern is unit in, unit out: keep the Graph Mapper working in the 0 To 1 range on both axes, and do the unit conversion either side of it with Remap Numbers. This keeps one easing curve reusable across every remap in the definition:

driver values → Remap (S: Bounds of driver, T: 0 To 1)
             → Graph Mapper
             → Remap (S: 0 To 1, T: real-world domain)

Worked example: facade openings without an attractor

Attractor-point tutorials are everywhere, but the attractor is a distraction: the real engine is always a remap. So we will drive a facade with the plainest scalar there is — height. A circle on every node of a 12 × 8 grid — 117 openings, each straddling four panels, growing with elevation.

  1. Place an XZ Plane component (Vector > Plane) so the grid stands upright like a facade, then a Square grid component (Vector > Grid). Wire the plane into P. Add sliders: Size = 1.50 (panel module in metres), Extent X = 12, Extent Y = 8. On an XZ plane, the grid’s second direction runs up the facade.
  2. The grid’s Points output arrives as a data tree, split into branches. Data trees are demystified in the next lesson; for today, right-click the Points output and choose Flatten so we work with one simple list.
  3. Wire the flattened points into a Deconstruct component (Vector > Point) and take the Z output. This list of heights is our driver — panel it to see values from 0 up to the top of the grid.
  4. Wire the same Z list into Bounds. Panel the result: the source domain, computed from the geometry itself, not typed in by you.
  5. Build the target: two sliders named Min Opening (0.10) and Max Opening (0.65) into Construct Domain. Slider-bounds discipline in action: set the Max Opening slider’s own maximum to 0.70, safely under half the panel module, so no slider position can make neighbouring openings collide.
  6. Place Remap Numbers: V = the Z list, S = the Bounds output, T = the constructed domain. The output is one radius per panel point, small at the base, large at the top.
  7. Draw the openings with Circle CNR (Curve > Primitive): C = the flattened grid points, R = the remapped radii. The circles’ normal must point out of the wall, so wire a Unit Y vector (Vector > Vector) into N — left at the default, the circles would lie flat, as if in plan.
  8. Now add easing with the unit-in, unit-out pattern: Remap Z from the Bounds domain into 0 To 1, pass the result through a Graph Mapper set to a Bezier graph, then Remap from 0 To 1 into the opening domain, and feed those radii to Circle CNR instead. Drag the graph handles and watch the gradient of openings redistribute in real time — slow growth low on the facade, rapid growth near the parapet, or the reverse.
  9. Stress-test it. Change Extent Y from 8 to 20: Bounds recomputes the source domain and the gradient stretches gracefully over the new height with no other edits. That is what data-driven source domains buy you.

Nothing in this example depended on height specifically — the driver could be distance to a boundary, daylight hours or floor area. Any list of numbers, passed through Bounds, Remap Numbers and a Graph Mapper, becomes a controlled, eased, dimensionally honest design driver. That pipeline is the pattern; attractors are merely one way of generating the driver list.


Practice

  • Change the driver. Rebuild the facade using the X output of Deconstruct instead of Z, so openings grade horizontally across the elevation. Then invert the effect using only a reversed target domain — no new components allowed.
  • Compare easings. Duplicate the eased chain three times with Linear, Sine and Bezier graphs, feed all three from the same normalised driver, and panel the outputs side by side. Find the height on the facade where the curves disagree most.
  • Break it deliberately. Replace Bounds with a hard-coded Construct Domain of 0 To 12, then make the facade taller than 12 m. Panel both outputs of Remap Numbers and explain, in one sentence, what happens above 12 m and why the clipped output differs.

Sliders set the inputs, domains describe the ranges, remapping carries value to consequence — that pipeline sits under nearly every definition you will ever build. When you are comfortable with it, carry on with the rest of the Foundations track in the Members Library.

Members Library

That was one of the three free lessons

The other nine — data trees, geometry, C# scripting and fabrication — are in the Members Library, along with every new lesson we publish.

12 tutorials · 4 tracks · Foundations free

Previous lesson
Next lesson

← Back to the Members Library