I have a feature implemented as reported in these 5 steps:
1’ the plugin creates a surface with the script _-PictureFrame on the plane WorldXY, to show a jpg image with aspect ratio 10:7 on the diagonal from (100,100,0) to (1100,800,0)
2’ the user decides to crop the image keeping its pixels where they were located, for example by drawing a rectangle with aspect ratio 2:1 on the diagonal from (200,200,0) to (400,300,0)
3’ the plugin crops the image created at 1’ with the rectangle defined in 2’. I have done this using public Brep[] Split(Brep cutter, double intersectionTolerance); on the Brep given by the RhinoObject created at step 1’
4’ the plugin copies the ObjectAttributes from the Brep created at 1 to the Brep created at 3’
5’ the plugin hides the layer of the RhinoObject created at 1’
After upgrading my plugin from Rhinoceros 5 to Rhinoceros 7, the picture is stretched on the new area. Before the absolute position of the picture was preserved by step 4’.
If I try to apply the texture mapping, I can’t preserve the absolute position of the picture. Which linear transformation should I input to Rhino.Render.TextureMapping.CreatePlaneMapping?
I have attached a VS2019 solution with the problem. The same code gives two different visual results as reported in the 2 print screen attached. In the production code the picture frame is created with the script but the problem is the same. Splitting with the Rhinoceros 7 UI gives the result as expected in the Rhinocceros 5 Rhinocommon, so maybe it’s a bug in Rhinoceros 7 Rhinocommon?
So it seems that my vmware virtual machine with hardware virtualization enabled has
some discrepancies.
This could be a problem, if you need more info let me know