Mesh entities not visible in Rhino 6 opening a Rhino 5 drawing

(Andrew) #1

Our plugin draws entities including meshes with an RGB defined color.

When the drawing is done in Rhino 5, and then opened in Rhino 6, the meshes are not visible.

mytest.3dm (36.6 KB)

        The meshes exist and are are selectable in Rhino 6

         The meshes can be re coloured in Rhino 6 and show OK

          Other entities (polylines, lines, points) all show OK.

          Drawings made in Rhino 5 open OK in Rhino 5
          Drawings made in Rhino 6 open OK in Rhino 6

       Drawings made in Rhino 5, 
                    with the mesh color changed in the properties, show OK in Rhino 6

The attached drawing has a mesh inside a polyline, if you open it in Rhino 6 you will see the problem.

My code to set the colour is:

            Dim atts As New DocObjects.ObjectAttributes
   		atts = doc.CreateDefaultAttributes()
            atts.ColorSource = DocObjects.ObjectColorSource.ColorFromObject
            atts.ObjectColor = System.Drawing.Color.FromArgb(XXXX)
                Dim guid As Guid = doc.Objects.AddMesh(mymesh, atts)

(Dale Fugier) #2

Hi @andrew3,

Looks like you are setting an alpha value of 255, which make the color transparent. Might want to stick with Alpha=0.

– Dale

(Andrew) #3

Thanks for this hint, but I don’t think it the full answer.

a) I don’t specify the alpha value at all, I supply a RGB integer, which I think means an alpha =0

b) The meshes display OK with the correct color in Rhino 5 and Rhino 6. It’s only when they are drawn in Rhino 5, and then opened in Rhino 6 that they become transparent.

c) This only happens with meshes, other entities drawn in the same way behave ok.

(Dale Fugier) #4

Hi @andrew3,

I understand that you may not have known that you specified an alpha component.

There several overrides to System.Drawing.Color.FromArgb . You might consider using a different one that does not allow you to specify an alpha component. Or, always specify A = 0.

Also, I understand that Rhino 5 behaves differently than Rhino 6. I am not if this is expected or not. So I’ve logged an issue.


– Dale

(Andrew) #5

Thanks Dale.

I think there is one item in the ticket that may be misleading
(I don’t think I can add to / edit the ticket)

When you say

" The developer specified an object color that contains transparency (argb = 255,0,0,0)"

We really didn’t. For example, to specify a blue mesh we used Integer argb = 255 like this:

atts.ObjectColor = System.Drawing.Color.FromArgb (255)

I believe this implies an alpha of zero.