Hi;
I use CRhinoDisplayConduit Draw Shaded Brep, but it seam not good, how can I solve it ?
My file is here Display.3dm (233.1 KB)
Here is my code:
class DSP : public CRhinoDisplayConduit
{
public:
DSP();
~DSP() {};
bool ExecConduit(
CRhinoDisplayPipeline& dp, // pipeline executing this conduit
UINT nChannel, // current channel within the pipeline
bool& bTerminate // channel termination flag
);
ON_SimpleArray<ON_Brep*> rc_drabw;
};
DSP::DSP()
: CRhinoDisplayConduit(CSupportChannels::SC_DRAWOVERLAY | CSupportChannels::SC_POSTDRAWOBJECTS)
{}
bool DSP::ExecConduit(
CRhinoDisplayPipeline& dp,
UINT nChannel,
bool& bTerminate
)
{
if(nChannel == CSupportChannels::SC_DRAWOVERLAY)
{
if (rc_drabw.Count() > 0)
{
for (int i = 0; i < rc_drabw.Count(); i++)
{
CDisplayPipelineMaterial mat;
dp.SetupDisplayMaterial(mat, HsvToRgb(215, 122, 250));
dp.DrawShadedBrep(rc_drabw[i], &mat, nullptr);
}
}
}