How to colour a brep in GHPython and visualize it in the Rhino?

Hi,
How to colour a brep in GHPython and visualize it in the Rhino?

I have created the colour using the ghcomp,
c1 = ghcomp.ColourRGB(255,75,107,169)

@AndersDeleuran @Giulio

Thanks

You can implement the DrawBrepShaded and DrawBrepWires methods similar to how the mesh is drawn here:

1 Like

Thank you I was trying it.
Does this work directly?
r.Display.DisplayPipeline.DrawBrepShaded(brep, material_colour)

While I try am getting error as below, and am unable to track it.

Runtime error (ArgumentTypeException): expected DisplayPipeline, got Brep
Traceback:
line 22, in script

No you need to implement the DrawViewportMeshes and DrawViewportWires methods in SDK mode. Here’s a quick example extending the file from the thread I posted above:


230606_GHPython_DrawViewportWires_00.gh (25.6 KB)

2 Likes