Search code examples
rubysketchup

Sketchup API Draw a concave polygon in view class


Does View class in Sketchup API have method for drawing concave polygon. I found no method for doing it. Method draw of View class: view.draw GL_POLYGON, @arr_vertex can only draw convex polygon.

Any suggestions would be appreciated.


Solution

  • No, there isn't one. View.draw is basically straight-to-OpenGL drawing so it requires convex polygons. You'll need to tessellate the polygon into convex polygons yourself.