My tutorial, Chapter 16 has library code to handle this. You may be able to go straight to Chapter 16 and get your work done. But as TIG points out (reincarnated as the wise old one at the fairytale SketchUCation tavern) that has its drawbacks.
Posts
-
RE: Roller coaster animation - move TO and angle of edge
-
Two JavaScript Points
- Hereabouts I once said that
window.event
is the same asevent
in a browser, becausewindow
is the global object. That was almost right.
This will get a cross-browser event:
onSomeEvent( e ) { e = e || event;
MSIE, and I don't have it pinned down yet, sometimes insists on the
window.
prefix. I've started to routinely includewindow.
even though it looks pretty dumb.- Pop Quiz!
var arr = [1,2,3,4,5]; for ( elem in arr ) { alert(elem); }
What is the first
elem
?Dan, if you know the answer, please be a little slow to post it.
- Hereabouts I once said that
-
RE: Rotating an object
@thespacegamer said:
I want to create a circle and rotate in 90' to make it verticle.
The above advice is all correct, but this may be easier. I assume you start with an empty model.
-
Drag out a Rectangle. (It will be, by default, in the RG plane.) PushPull it up into glorious 3D.
-
Triple-click your box, Right-click Group. (Otherwise your circle sticks to the box.)
-
Choose a face and draw your circle on that face. No rotations required.
-
-
RE: Trees...a possible or not?
@cantonis said:
I would really like to know if there is any way to add trees to projects by designing trees or even import from photoshop without having to put up with a 15-20 MB file.
You have identified a serious problem. Keep your trees in a separate layer. A truly huge tree layer will not slow SketchUp down if the layer isn't visible.
-
RE: Introduction + question
@guy bratt said:
I'd like to draw a milk stool. I can make the seat and the legs but I'd like to splay them 15*.
Welcome. SketchUp is easiest when everything is orthogonal (parallel to the red, green or blue axes). Your legs, I assume, will be 120 degrees apart. Not orthogonal. I'm not so sure about the Rotate tool, either, though I second the advice re watching those excellent videos.
Draw a circle a bit larger than the seat you want, centered on the origin. Draw another circle where the centers of the legs will attach to the seat. Draw a leg-sized circle on an axis.
SketchUp aces will use the Rotate tool to make an outer array and get this all done in one go, but that's kind of advanced. Here's the more straightforward approach. Grab the Protractor. Click the origin to center it; click the center of the first leg's circle to define the 0 line. Type 120 and Enter and you'll have a guide for the second leg.
Draw another leg circle. Repeat for the third leg.
Now triple-click to select everything. Type M for the Move tool, click the origin and start sliding up the blue axis. You'll get a tooltip that says "On blue axis". Type the height of the bottom of the seat and Enter. You'll get a stool bottom floating in the air.
Now clean up. You've no use for that inner circle. Delete it. Sad to say it's in six segments. By the way, the eraser is not your friend, here. With the Select tool (Spacebar) click a segment. If you miss, you just click again. Then press Delete. Once your first model is "done" look up the Eraser tool. It's got magic. But don't use it for erasing.
Now fun times. Orbit under your seat. PushPull the legs down to the ground. (Start the PushPull, then type the distance you want and press Enter.) Double-clicking with PushPull repeats the previous PushPull. (Very handy, but not totally reliable.) Starting to look stoolish.
Now here comes the trick. When you use the scale tool, attached geometry moves along with the geometry you are scaling. Tap S for the scale tool, grab one of the corner handles, hold the Ctrl key down (to scale about the center) and move it in. Magic slants your legs while leaving tops and bottoms parallel to the floor.
Now you PushPull your seat up to seat depth and all that's left is a little cleanup so the legs don't poke through to the seat top. I've not come up with a slick way to handle that. Maybe someone else can help out.
Here's a little woodworker's tip you may want to use before you make your stool. I'm thinking something like hard maple.
-
File not Closed
I was just frogging up a little utility for myself. It opened all the files in a directory. As I was just writing it, that's all it did.
I went to delete all the files in the directory. Six of them were "in use" and could not be deleted. They were "in use" by my little utility stub, though that had run to completion.
Moral: explicitly closing files is not just a good habit.
-
Free PR for Plugin Developers
I'm converting my tutorial to proper treeware. Anyone who would like to be mentioned, please get in touch.
-
RE: String.unpack - signed 4byte little-endian integer?
@thomthom said:
Can't one rearrange the bits using ruby? If one use the RUBY_PLATFORM constant to determine if the host is a PPC, when swap the bits with ruby avoiding the need to C dependencies?
Mucking with bits in Ruby is very easy (though performance?). In VisMap I fiddled with bits in JavaScript to encode the string sent to Ruby and in reverse in the Ruby to unencode. Wrote about that in http://www.MartinRinehart.com/models/tutorial/tutorial_bfr.htmlAppendix BFR[/url].
I apologize for the code. It dates back to when I was first writing Ruby, trying to do things the Ruby way.
-
RE: Noob: Understanding transformation.inverse
@billwheaton said:
Thanks Martin. And I read those and they were a great help, but I didn't find much there about what the 'inverse' method does.
I've never had occasion to use the
inverse()
method. I just use my Chapter 16 classes and theTransformation
class stays out of my life. -
RE: Component
@dominicm143 said:
i've saved my old model as a component, and now it won't ...
~dominic muscatellaExactly how?
I don't know what's in your model, but try this technique which I'll explain as if you've modeled a house.
-
Explode. Delete everything but the top story and roof. Save as 'attic'.
-
Reload. Delete everything above ground. Save as 'basement'.
-
Continue until you have a collection of tractable pieces. You can now delete the original. (Well, save to another name: my_old_model_that_I_may_not_need.skp.)
To rebuild, File/New, then import the parts one at a time, clicking the origin. They should assemble correctly if you import each to the origin.
That will give you a collection of small, easy-to-use models. One other technique. If you move everything in the 'attic' model into a layer named 'attic', when you import you will have a single component named 'attic' in a layer named 'attic'. Very handy for SketchUp animations.
-
-
RE: Noob: Understanding transformation.inverse
The basics of transformation matrices are explained in Appendix T of my tutorial.
The use of transformation matrices is explained in Chapter 15 of my tutorial.
Software that lets you move, rotate and scale component instances is explained in Chapter 16 of my tutorial.
-
RE: [Plugin Update] Ruby Console Pro with SketchTalk in Motion++
UL'd minor bug fix version, 6/14.
-
RE: Clear the Ruby Console with Win32 API?
t=28571
Clears input and output windows. Toggle output off and on to clear just output.
-
RE: How do I convert from imperial to metric
I looked all this up to be sure what I wrote in my tutorial was correct.
The American system is not, in fact, Imperial. It was derived from the British system some time before the Brits created the Imperial System. "At this time, only three countries - Burma, Liberia, and the US - have not adopted the International System of Units (SI, or metric system) as their official system of weights and measures." (CIA World Factbook). Calling the system "American" is very nearly correct.
What we Americans call the "metric" system is more correctly called the international system as it includes measurements (metric), weights, temperatures and other standards. (Many call it the SI, for the French Systeme Internationale.)
-
RE: Ruby 1.9 is fast!
Why do you suppose no one has written a compiler?
20 years ago a top-of-the-line PC was a 25MHz 80386. Interpreters made sense. Today, compile, link and run in a good IDE is done with the press of an F key and doesn't take a full second. Am I missing some good reason to stay interpreted?
-
RE: [Plugin]Architect's First Walkthrough (Tutorial)
Where I really want to go is a nice time line dialog tracking camera and the other things you want to animate. You divide your movie into scenes, specify lengths, camera position(s) and movements, ... The dialog should write the necessary script.
For the moment, scripting is needed if you want to add animations. What I've got is far simpler than the underware which manipulates transformation matrices. Appendix T of my tutorial if you're curious about what that means.
-
RE: [Plugin Update] Ruby Console Pro with SketchTalk in Motion++
Cool!
<body scroll=no> MSIE only and should never be used (unless you are locked into MSIE, as we are).
{overflow: hidden;} This is another one you almost never want to use, but, in the case at hand ...
-
RE: Urgent - Is there a script to reset/zero all transformation?
@pixero said:
This should be an apartment.
Looks like you turned the Dali option on. Is there a checkbox for surreal?
Seriously, it looks like rotations and scalings aren't the issue. Location is the issue. When you originally placed the towels, for example, you put them where you wanted them. They moved. Resetting location to [0,0,0] would move them to the origin. I doubt that would help. I'm afraid you don't have a scriptable problem.