Repository navigation
node switch
< Previous: Compare | Next: Series >
Route one of two inputs to the output: the toggle off takes A, on takes B.
Category: Data | Add menu: Data > Numbers > Switch
Switch is a routing node. It takes two inputs and passes exactly one of them through, chosen by a boolean: with Toggle off the output is A, with it on the output is B. Nothing is converted, merged or combined, so whatever arrives on the winning input leaves the node unchanged.
It is type-agnostic. Geometry, numbers, colors, strings and whole collections all travel through it the same way. That is what makes it useful for an A/B comparison: wire two variants of a pattern into A and B, leave the rest of the graph wired exactly as it is, and flip the toggle to see one or the other. Two variants feeding a single Realize is the common shape.
- A (any): the value taken when Toggle is off.
- B (any): the value taken when Toggle is on.
- Toggle (boolean): which input wins. Wire a Toggle node in, or any other boolean source.
- Result (any): whichever input the toggle chose, passed through untouched.
Note
A number wired into Toggle reads as a boolean: 0 is off, any other finite number is on. A non-finite number, the kind a bad division produces upstream, counts as off rather than on. Without that guard a NaN would read as "not zero" and silently flip the switch.
If the chosen input has nothing wired to it, the output is empty geometry rather than an error or a missing value, so downstream nodes see exactly what they would see from any other empty source.
< Previous: Compare | Next: Series >
- Toggle: the boolean source that usually drives it.
- Data nodes | Lists & collections
Found a bug or have feedback? Open an issue | Docs home | Videos | Credits
Getting Started
- Welcome
- How Locus came to be
- Videos
- Community & support
- Installing & launching
- Licensing & activation
- Beta License Agreement
- Core concepts
- Interface tour
- Your first pattern
Modeling - Drawing
- Canvas basics
- Points
- Typing coordinates
- Lines, rays & segments
- Circles & arcs
- Ellipses
- Compass & straightedge
- Rectangles & squares
- Constraining with Shift
Modeling - Editing
- Selecting objects
- Transform tools
- Align & distribute
- Duplicate, detach & ownership
- Regions & booleans
- Cleanup
- Weld & seams
- Style palettes & Re-ink
Annotation
Layers
Modeling Menus
- File
- Edit
- View
-
Draw
- Select
- Point
- Segment
- Line
- Ray
- Circle: Center Point
- Circle: Center Radius
- Circle: Through 3 Points
- Arc: Center, Start, End
- Straightedge
- Compass
- Compass: Radius
- Ellipse: Center + Axes
- Elliptical Arc
- Rectangle: XY-Aligned
- Rectangle: Directed
- Square
- Regular Polygon: Edge
- Regular Polygon: Center, Vertex
- Regular Polygon: Center, Edge Midpoint
- Dimension: Linear
- Dimension: Angle
- Dimension: Radial
- Label
- Construct
- Combine
- Transform
- Select
- Nodes
The Nodes Window
- Basics of visual programming
- How the node graph works
- Sockets & wires
- Adding & connecting nodes
- Sliders & number inputs
- Keeping the node graph tidy
- View menu (Nodes)
- Lists & collections
- Constants & unit conversions
Node Library
- Overview
- Input
-
Primitives
- Point
- Point: Polar
- Segment
- Line
- Ray
- Circle: Center Point
- Circle: Center Radius
- Circle: Apollonius
- Circle Tangent to...
- Circle: 3 Points
- Arc
- Ellipse
- Elliptical Arc
- Rectangle: XY-Aligned
- Rectangle: Directed
- Square
- Regular Polygon: Edge
- Regular Polygon: Center
- Rectangular Grid
- Oblique Grid
- Triangular Grid
- Construct
- Transform
- Image & Fields
- Combine
-
Data
- Measure
- Numbers
- Lists
- Select
- Clean up
- Display
Clusters
Bridging Modeling & Nodes
Patterns & Symmetry
Image-Driven Fields
Saving, Exporting & Files
Preferences & Language
CLI
Reference
