How does DrawMeshVertices() work?

Hi!
In the SDK there is a call

void DrawMeshVertices(const ON_Mesh&, const ON_Color& color);

So I tried to use it in my conduit, but nothing visible appeared on the screen. Is there anything more (e.g. vertex atributes) that I have to set up?

What I tried instead was something like this:

   int iVertexCount = mesh.m_V.Count();
   ON_3fPoint P;
   for (int i = 0; i < iVertexCount; i++)
   {
      P = mesh.m_V[i];
      pipeline.DrawPoint(P, 1, RPS_CIRCLE, color);
   }

This works, but I would assume there maybe a more efficient way inside DrawMeshVertices(). The mesh uses ON_3fPoint for the vertex array, *DrawPoint() uses ON_3DPoint

Hi @Peter_Salzman,

Honestly, CRhinoDisplayPipeline::DrawMeshVertices works just about the same as your code sample.

void CRhinoDisplayPipeline::DrawMeshVertices(const ON_Mesh& mesh, const ON_Color& color)
{
  if (nullptr == m_pDisplayAttrs || m_pDisplayAttrs->m_nMeshVertexSize <= 0)
    return;

  int count = mesh.VertexCount();
  for (int i = 0; i < count; i++)
  {
    ON_3dPoint pt = mesh.m_V[i];
    DrawPoint(pt, RPS_VARIABLE_DOT, color, color, (float)m_pDisplayAttrs->m_nMeshVertexSize, 0, 0, 0, true, true);
  }
}

– Dale

Hi Dale,

ok thanks! So I can use my code for the purpose I want.
Then I still had the question, why nothing appears on the screen, if I use the SDK function…

So I used exactly the code above, and still nothing is displayed. Finally I found out, that

m_pDisplayAttrs->m_nMeshVertexSize

is Zero - so if I give it a value >0 it works!

Best Peter

1 Like