A SketchUp Tool Box
I’ve made a collection of some of the Ruby Scripts that I use with some frequency in SketchUp. The file SketchUpToolBox.zip includes:
With the exception of formdraw.rb, these are scripts created by others and offered up free around the ‘net with a couple of minor changes. Feel free to distribute/modify formdraw.rb too.
Read about installing and using Ruby Scripts in SketchUp here. Basically you’ll just place the contents of the file SketchUpToolBox.zip into the appropriate PlugIn directory, (re)start SketchUp, and select the new items from either the Draw menu or Plugins menu.
Below I’ll describe the basic work flow/issues in using some of these.
Bezier.rb and TubeAlongPath.rb are invaluable for drawing curvy knots.
In Bezier.rb, you draw a cubic bezier curve by first drawing the two endpoints and then indicating the tangencies of your desired curve to those endpoints. To make this a non-planar curve, it helps to have a rig for the points to snap to.
Then having selected the curve, TubeAlongPath.rb gives a nice tube.
Bezier.rb with curvestitcherwreverse.rb helps make those nice flowing surfaces. In SketchUp all curves are polygonal and all surfaces are assembled from planar faces. The curvestitching works by “stitching” two polygonal curves together with triangles.
Here I’ve deleted the supporting rig and drawn a separate straight line. This line is just a single segment. So I have to divide it into many pieces (right click – divide) and then use weld.rb to make it into a single curve. (Sketchup distinguishes between polylines and curves.)
Select both curves now and run Curve Stitcher.
Depending on how SketchUp reads the ordering of the vertices of the curves, Curve Stitcher will give you one of the two results.
My old officemate Katerman pointed out the simple modification to curvestitcher.rb that allows you to reverse the direction of one of the curves, hence Reverse Curve Stitcher. If Curve Stitcher doesn’t give you the desired result, undo and use the Reverse Curve Stitcher. (Incidentally, Katerman gets the credit for introducing me to SketchUp back in the day. Shout out to RLM 11.108!!!!)
I know you’d never had guessed, but drawhelix13.rb draws a helix. I’ve used it with these recent open books to get the surface curve around the knot (which was just a straight line segment). Then I’d curvestitch the helix to the knot and the the helix to where ever else I wanted the surface to go.
formdraw.rb is a script my friend Matt Scholl wrote with me when we were first investigating the ruby scripting possibilities of SketchUp. It draws the 2-plane field associated to a 1-form. The default entry is [-y, 0 , 1] which translates to the contact 1-form -y dx + dz. It doesn’t always work right. Some of the earliest contact structures shown on this site used this script (though I had to flip over the planes on the y-axis for some reason). Later contact structures I built by hand.