Coincidentally, I am currently working of this type of transformation which I call Non Uniform Linear Transformations (NULT), that are not native in Sketchup and end up recreating the drawing element.
I had completed the Plane Shear a while ago and need to finish the box shear.
Plane Shear is actually a transformation that would deform a rectangle into a parallelogram (in 3D space). Box shear, is a variant that allows non uniform scaling, typically transform a sphere into an egg. The question here is more how you specify what you want to do (my current idea is to do it via a transformation box)
Attached in the Plane Shear. You specify the plane, the reference direction and the angle. This is why the tool behaves pretty much as a Protractor tool. The tool applies to the Selection, but you can include what you want in it (groups, components, images, etc...) at any nested level. It preserves and deforms textures, as well as layers, attributes and properties. The only restrictions are:
- Components are transformed into Groups, because there is no way to preserve the component definition for all instances, as they may be rotated and scaled
- Images are transformed in planar face, with the image texture sheared (Sketchup does not support images in parallelogram as far as I know!)
- Dimensions are not transformed because Sketchup does not provide a Ruby API for these objects
- Interestingly, the transformation preserves Bezier and other Spline curves
Here is a basic example with a simple parallelepiped, but you can find a more complex situation at http://escargot-archi.eu/forum/viewtopic.php?t=2299 (a French site, but the image is self explanatory). For this kind of objects with 1,400 faces, it takes longer (the macro has a progress bar anyway).
There is no documentation at the moment, and this is why I do not publish it yet.
The Zip archive attached contains 5 files, all to go to the Plugins Directory:
- Nult.rb, the main macro
- LibProtractorTool.rb, a utility to emulate the Protractor tool (if anyone interested, it can be used as an independent tool for other purposes).
- LibTraductor.rb, a utility to language translation. You may already have it with the Bezierspline macro, but this one is more recent and anyway compatible.
- LibTraductor.def, an optional configuration file to force language.
- **iconshear.png**which is for the toolbar button
- **cursorshear.png**for the cursor shape
Feedback welcome. Thanks
Fredo
to unzip in Plugins folder