Pixel Gradient
Colours facade grid cells by a stepped gradient along one axis (with optional jitter and accent), merges cells of one colour into one mesh per branch, and can bake them to Rhino layers and groups (re-bakes replace earlier ones only when bake_name is set).
Overview
BIM-ready Idempotent Engine. Consolidates Mega-Meshes per surface and binds them into Rhino Groups.
Inputs (9)
- Grid Cells (Curve): Tree of grid cells
- gradient_colors (Colour): List of gradient colors
- accent_color (Colour): Accent color
- axis (Integer): Axis (0=X, 1=Y, 2=Z)
- jitter_pct (Number): Jitter percentage
- accent_pct (Number): Accent percentage
- inset_factor (Number): Inset factor
- bake_trigger (Boolean): Bake trigger
- bake_name (Text): Bake name
Outputs (5)
- panel_mesh (Mesh): Consolidated panels
- panel_colors (Colour): Panel colors
- panel_tags (Text): Panel tags
- panel_geometry (Curve): Panel geometry curves
- Info (Text): Method, assumptions, simplifications and references.
Method, assumptions and simplifications
The same notes appear in the component's Info output.
Method
- For every cell curve in Grid Cells, the bounding-box centre is read on the chosen axis (0 = X, 1 = Y, 2 = Z). These values are normalised between the minimum and maximum over all cells in all branches to a parameter t from 0 to 1.
- If jitter_pct is above 0, a random offset uniformly in ± jitter_pct / 200 is added to t; t is clamped and the colour is picked by stepping: index = floor(t × number of gradient_colors). There is no blending between colours.
- If accent_color is set and accent_pct is above 0, each cell is replaced by the accent colour with probability accent_pct / 100.
- Each cell polyline is scaled about its bounding-box centre by inset_factor (clamped 0 to 1) and meshed as a triangle fan from that centre; if that centre would give flipped triangles (concave cells) the closed outline is triangulated instead. Cells of the same colour in a branch are merged into one mesh, tagged Tile n (n = position of the colour in gradient_colors) or Accent Tile.
- When bake_trigger is true, meshes are baked to Rhino on layers Tiles::HexFacade_TileN with a matching layer material, grouped per branch, with user strings ElefrontBakeName, Surface_Path, Surface_ID and Material_Tag. With bake_name set, objects previously baked with the same bake_name are deleted first and every solution re-bakes; with bake_name empty it bakes once each time bake_trigger turns on.
Assumptions
- Grid cells are closed polylines (at least 3 distinct vertices); other curves are skipped.
- Cells are simple (non self-intersecting) closed outlines; convex cells use the fan, concave ones the outline triangulation.
- The random generator uses a fixed seed (42), so the same inputs always give the same pattern.
Simplifications and limits
- Colour depends only on the cell centre position along one world axis, not on distance along the facade or on the surface parametrisation.
- The random pattern changes if cells are added, removed or reordered, because each cell draws from one shared random sequence in input order.
Workflow
- Facade grid cells (for example from a panelling component) -> Grid Cells; a list of swatches -> gradient_colors.
- panel_tags and the HUD counts give a tile schedule per colour.