The test script below is part of a bigger project. I am trying to rotate a group of objects relative to the world Top view, then shear them over -45° relative to the Right view - using Python/RhinoCommon (WIP).
If you run the script with the first file - “StraightPosts”, it works fine The file is exclusively boxes. If you run it on the second file “StraightPosts2” - which are the same boxes but have some round rods that run through them so they have holes, it fails - on the shear step.
Does anyone know why the shear transformation fails in this case?
I would narrow it down by testing where in the code the Breps looses their Guids. They’re all “0000-0000…0000” at line 51 when processing StraightPosts2, but not on StraightPosts :
50 for obj in objs:
51 objID=sc.doc.Objects.AddBrep(obj) <-- "empty" guids.
Edit: The objects seems to lose their guids at row 62 (I’ve added some lines for testing) :
Yes, that’s correct, the GUIDS end up as System.Guid.Empty - which usually means that the “virtual” geometrical objects in question were invalid and thus not added to the document.
My question is not where they are failing, but why… My feeling is that this particular transformation is valid for linear objects, but not for curved ones, but I want to understand why - and also how to fix it if possible…