Geometry and shading not fit together

Hello,

Into the attached file, it is possible to see that the surfaces and their rendering does not occupy the same position in the document
pos1.3dm (130.5 KB)

The document has been created with 6 surfaces (and also three curves) placed into X+ demi-plane, where at the moment it is possible to observe their shading.

After a file copy, the document presents as now: the surfaces shading is in its original position, while the surfaces result rotated around the Z and Y axis (now they are entirely into X- demi-plane).

Do you know how is it possible that this inconsistency happened?
Is it an inconsistency? Otherwise can you explain to me what is this “feature”?

I have to add that I use a c++ plug-in developed by me, I would like to say that it is not my plug-in fault, also because I don’t know how I would have caused this problem. But I cannot exclude anything.

Any advice would be very appreciated,
Thank you in advance,
Alberto

Run RefreshShade on your surface and the ‘phantom’ object will disappear.

I do not know what your plug-in is doing, but it is creating render meshes that are not congruent with your surfaces. Maybe something to check. Vanilla Rhino generally does not create these kinds of problems - at least not this far off.

Or, as you say

Then maybe somehow the geometry is getting translated somehow without the render meshes which stayed in place. I don’t know how this is possible to do, but with code, a lot of impossible things are…

YOu can see that it is indeed the render meshes that are not in the right place relative to the surfaces, if you run ExtractRenderMesh on your surfaces, they correspond with your phantom objects. And, of course if you join the surfaces, that re-creates the render mesh and the phantom disappears.

Thank you very much for your support.
I understood that the problem has been generated by my plug-in. The surfaces should not be moved at all, so now I have to investigate why somewhere in the code I perform that rotation.

Hello,

the same problem I described in the post above happened again.

This time I noticed that the problem occurs at Rhino closing time.
The file seemed to be fine and, after to have saved the file, at exit time, a pop-up reported the following message:
You placed a large amount of data on the Rhinoceros clipboard. Do you want this data to be available in other sessions after you quit this one? Yes No or Cancel

At that point, clicking on Yes, Rhino closed.
Next time I opened the file, it presented the geometry moved.

Is it possible to save geometries on the clipboard via c++ code? How?
This way I can investigate if I place something on the clipboard somewhere in my plug-in.
I’m sure @dale will be able to give me some hints!

Thank you in advance,
Alberto

Moved to Developer category

If you want to do what Rhino does, then script the CopyToClipboard command using CRhinoApp::RunScript.

If you want to do something else, then you might start here:

Clipboard: Using the Windows Clipboard

– Dale