RR Block Model Custom Shading
In the Designer tab > Display panel > Block Model section > Shading dropdown > there is a preloaded list of automatic shadings for the level hierarchy and reserves fields. We can add to this list by configuring custom shading sets.
Create a simple custom shading:
Select the gear icon next to the Shading dropdown. This opens the configuration dialog.
Press the blue plus icon to add a new shading set.
Rename the shading to "Materials".
Drop down the Shading Field and select 'Parcel'.
Press the 'Create Entries' button to populate all parcel names.
Assign a colour to each parcel.
Press OK to accept.
Simple shading on material type.
Block model shaded by material type.
Create a complex custom shading:
Select the gear icon next to the Shading dropdown. This opens the configuration dialog.
Press the blue plus icon to add a new shading set.
Rename the shading to "Ranges".
Select the 'Complex' tab to open the code editor.
Paste in one of the sample code snippets located below.
Press OK to accept.
Shading high Fe (pink and blue) vs. high Al (grey and blue).
Simple Grade Shading
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Linq;
using Alastri.RR.Ui;
using Alastri.RR.Service;
public class CustomBlockShading : IBlockShading
{
public Color GetColor(BlockContext context)
{
double fe = context.N("DryTonnes.FE");
if(fe > 60) return Color.FromArgb(255,0,138); //pink
else if(fe > 58) return Color.Red;
else if(fe > 56) return Color.Orange;
else return Color.WhiteSmoke;
}
}
Multi-Variable Shading
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Text;
using System.Linq;
using Alastri;
using Alastri.RR.Ui;
using Alastri.RR.Service;
public class CustomBlockShading : IBlockShading
{
Color e1_low_e2_low = Color.Magenta;
Color e1_high_e2_low = Color.DeepSkyBlue;
Color e1_low_e2_high = Color.Yellow;
Color e1_high_e2_high = Color.White;
double element1_Min = 0;
double element1_Max = 12;
double element2_Min = 1.5;
double element2_Max = 3;
public Color GetColor(BlockContext context)
{
double element1 = context.N("Head_Tonnes.SiO2");
double element2 = context.N("Head_Tonnes.Al2O3");
double x = element2 - element2_Min;
x = Math.Max(0, x);
x = Math.Min(x, element2_Max - element2_Min);
double y = element1 - element1_Min;
y = Math.Max(0, y);
y = Math.Min(y, element1_Max - element1_Min);
Color topLerp = Lerp(e1_low_e2_high, e1_high_e2_high, x / (element2_Max - element2_Min));
Color lowLerp = Lerp(e1_low_e2_low, e1_high_e2_low, x / (element2_Max - element2_Min));
Color lerp = Lerp(lowLerp, topLerp, y / (element1_Max - element1_Min));
return lerp;
}
public Color Lerp(Color one, Color two, double pct)
{
return Color.FromArgb( (int)(one.R + pct * (two.R-one.R)) ,
(int)(one.G + pct * (two.G-one.G)) ,
(int)(one.B + pct * (two.B-one.B)) );
}
}
Â