DrawPolygon - Concave shapes


(Paul Poinet) #1

Hi,

I am drawing polygons with the DisplayPipeline.
It seems that it handles only convex shapes.
The input points for the polygon (filled) are the same as the ones used to create the naked curve.
Have I done something wrong?


(Luis Fraguada) #2

I see that too. Logged. This behavior is not documented anywhere, in case it is the intended behavior. Have you tried doing the same but with DrawMeshShaded or similar?


(Paul Poinet) #3

Cheers! Yes I was thinking that it computes a sort of convexHull or so. Would be really good to have it work for concave shapes.
In the end, I just drew a bunch quad polygons along the arc offset to make it work… Not the most efficient method probably :sweat_smile:.

Yes, I did and it works, but for that I also needed to construct a mesh with all the quads along the offset, which is computationally more expensive than the previous solution.

Any alternatives are welcome!


(Luis Fraguada) #4

Well, you could do this: http://developer.rhino3d.com/api/RhinoCommonWin/html/M_Rhino_Geometry_Mesh_CreateFromClosedPolyline.htm and pass it to DrawMesh…


(Paul Poinet) #5

Nice, thanks. I always forget to search for more generic functions embedded in RhinoCommon!
I will try and let you know about the outcome.


(Paul Poinet) #6

@fraguada Just tried it, works like a charm! Not necessarily faster though. But it lightens the code anyway.


(Brian Gillespie) #7

RH-39256 is fixed in the latest WIP


(Paul Poinet) #8

nice, thanks!


(Luis Fraguada) #9

p.s. Paul, this was only a change to the SDK Documentation summary, not the code itself. Note, the docs have not been updated yet to reflect this change.