Configurator Patterns

This document covers the FCS patterns used to build reusable, parameter-driven configurators.

1. Single-file component (GClass / GBlock)

A simple reusable part can live in one .fcs file and be instantiated multiple times with different placements.

gclass {gcFence} filename "fence.fcs"
gblock {gbFence1} gclass {gcFence} lcs { Origin={0,0,0}, Axes=GCS.Axes }
gblock {gbFence2} gclass {gcFence} lcs { Origin={5,0,0}, Axes=GCS.Axes }

What this pattern gives you

Typical use cases

Design advice

Keep the component file focused on geometry and internal calculations. Use the parent file to decide how many instances to place and where.


2. Parameter passing

gclass instances can receive parameters from the parent context.

gclass {gcWeight} filename "weight.fcs" parameters { H = T, B = T }
gblock {gbW1} gclass {gcWeight} lcs { Origin={0,0,0}, Axes=GCS.Axes }

This lets the parent drive child behavior without hard-coding dimensions inside the component file.

Good pattern

GOTCHA: parameter typos fail silently

If you misspell a parameter name, FCS creates a new variable instead of overriding the intended one. That means the child file keeps using its default or internal value and nothing obviously crashes.

Example of the danger:

gclass {gcWeight} filename "weight.fcs" parameters { Heigth = T }

If the child expects Height, Heigth becomes a new variable and the override never happens.

Defensive practice


3. Conditional placement

A component can be placed only when a condition is true.

gblock {gbWindow} gclass {gcWindow} lcs { ... } if (buildingHasWindows)

Why this matters

Conditional placement is the backbone of configurators. It lets the same component definition support many variants without maintaining separate files.

Common conditions

Pattern recommendation

Compute readable boolean variables first, then use them in if (...) clauses.

showWindowOnSideA = buildingHasWindows && facadeType == "Openings"
gblock {gbWindowSideA} gclass {gcWindow} lcs { ... } if (showWindowOnSideA)

That makes downstream debugging much easier.


4. Distribution — repeated elements

Use distribution when you need repeated placement of the same component along a rule.

distribution {dCols} gclass {gcColumn}
    lcs { Origin={0,0,0}, Axes=GCS.Axes.Ry(-PI/2).Rx(PI/2) }
    transformation translation direction {1,0,0}
    repetitions spacings (columnSpacings)
    specialization ithparameters {
        ith 0 parameters { CssHead:= { h:=0.34 } },
        ith 1 parameters { CssHead:= { h:=0.30 } }
    }

What this pattern does

Best use cases

Key concepts

Why ithparameters is powerful

It allows one repeated system to still express local exceptions: first/last element conditions, edge cases, or architectural tweaks.


5. Multi-file architecture pattern

Real components usually outgrow a single file. A robust configurator often splits responsibilities across several files.

Recommended structure

Why split files?

Example layering

Main.fcs

Inputs.fcs

Geometry files

Practical rule

Keep files organized by responsibility, not by convenience. If a file mixes UI, geometry, API integration, and repeated calculations, it is usually a sign to split it.


6. Pattern selection guide

Start with a single file when:

Move to gclass + gblock when:

Move to distribution when:

Split into multiple files when:


7. Checklist for robust parametric components