Bake brep with coloured faces

Minimum just as a POC:
2022-09-20 17_33_05-Window
PerFaceColor.gh (12.7 KB)

I’m pretty sure there is no per-face-colors on native GH breps…


code:

 private void RunScript(bool bake, List<Brep> B, List<System.Drawing.Color> C)
  {
    brep = Brep.JoinBreps(B, this.RhinoDocument.ModelAbsoluteTolerance)[0];
    for(int i = 0;i < C.Count;i++){
      brep.Faces[i].PerFaceColor = C[i];
    }
    if(bake){
      GrasshopperDocument.ScheduleSolution(5, SolutionCallback);}
  }
  // <Custom additional code> 
  Rhino.Geometry.Brep brep;
  private void SolutionCallback(GH_Document doc){
    this.RhinoDocument.Objects.Add(brep);
    return;
  }