I'm in search of the three items you set in Model Info/Animation page.
Are these in the API?
I'm in search of the three items you set in Model Info/Animation page.
Are these in the API?
@fletch said:
Sorry Martin, haven't tried it yet, but can you, in your initial post, please explain the "send data" "get data" buttons?
Try it. If these are not immediately meaningful, tell me and I'll add some words.
@thomthom said:
I've used to use tabs four space wide. But copying the code into other editors got a tendency to make the indent too wide. So I moved to 2 spaces instead.
Poke around your editor settings. Tell it to output space characters, not tab characters.
@dan rathbun said:
WHY predessesor languages chose certain indents.
Ruby was released in 1995, a vintage year for computer languages. The same year saw Java, JavaScript and PHP released. Three of four chose four-space indentation.
For more history see http://www.MartinRinehart.com/articles/genealogy-programming-languages.html
@dan rathbun said:
Why (Martin,) should I stop using 2 space identation ??
20 years ago, when bytes cost money, the standard advice was "indent 3 or 4 spaces." Between then and now the world has settled on 4 spaces. In addition to Crockford in JavaScript, K&R used 4 spaces in C. Stroustrup used 4 spaces in C++. Sun recommended four spaces for Java. Matz mandated 4 spaces for Python. Except for Ruby, the world has decided on four-space indentation.
I've used conventional 4-space indentation in Basic, C, C++, Java, Python, JavaScript, HTML and CSS, among others. Four spaces are more readable. It's easy to see who aligns with whom, even over a substantial vertical range. Two-space indentation is less readable and it encourages deep nesting levels. Deep nesting is not something to be encouraged.
Here's a bit of my code that multiplies matrices:
def * ( m2 )
vals = []
for r in 0..(@nrows-1)
for c in 0..(m2.ncols-1)
vals.push( row_col(row( r ), m2.col( c )) )
end
end
return MovableCI_Matrix.new( @nrows, m2.ncols, vals )
end # of *()
Here's the same code, but with two-space indentation.
def * ( m2 )
vals = []
for r in 0..(@nrows-1)
for c in 0..(m2.ncols-1)
vals.push( row_col(row( r ), m2.col( c )) )
end
end
return MovableCI_Matrix.new( @nrows, m2.ncols, vals )
end # of *()
@jim said:
Windows users can try this for feedback:
> Sketchup.send_action(10624)
>
Wish I'd known that!
Frustum? Adjusted or not?
Edit: I looked it up. Make a pyramid. Make a horizontal slice and discard the top. What's left is a frustum. What this has to do with a camera is a mystery.
@jclements said:
Martin, so does this just report the camera parameters or can it be used to controll the camera as well?
Both.
@emy said:
I don't have an experience in ruby programming. Is it something that will take a lot of time?
Well, start 11 and decide for yourself.
In the long run it will save you tons of time.
@gilbertomorden said:
Hello all, I am new to this wonderful site.
Hi, and you're right: best forums on earth.
I built this as part of another project. Looking at it I wondered if there wouldn't be uses for it on its own. For example, being able to view two different models from exactly the same camera position or to focus exactly on the origin or some other point.
To install, extract to your Plugins directory. To use, restart SketchUP and click "Camera Statistics" in your Plugins menu. Continuous mode updates constantly as you zoom, pan, orbit, etc. The "Continuous" button becomes the "On Command" button in continuous mode.
Mac: my guess is that it will work but be ugly. Screen shots appreciated.
If you're doing fancy veneering, good luck!
This article will show you how to turn "Wood_Cherry_Original" into a variety of lighter and darker woods that work for models. http://www.MartinRinehart.com/models/tutorial/tutorial_ww_tip_01.html
If your goal is a beautiful model, this isn't enough. If your goal is a beautiful finished piece, the model doesn't have to have perfect grains.
@dadoing said:
I've been struggling up the initial learning curve with Sketchup.
I struggled up it and then wrote a tutorial so the next person wouldn't have a struggle.
http://www.MartinRinehart.com/models/tutorial/index.html
In the future I'll be adding a "send-me-money" feature, but that's not happened yet.
This is what you can do with SketchUp Ruby programming: http://www.MartinRinehart.com/models/tutorial/movie.html
The how-to is in my tutorial's Chapter 16.
Never programmed? Start with Chapter 11.
Sorry to say, Ruby programming is required. (More exactly, "still required.")
If you do not have the book, get the book.
From my tutorial, Chapter 19: "Before we begin, I should state that we are not covering all of JavaScript here. We are covering the subset that JavaScript guru Doug Crockford identifies in his book, JavaScript: The Good Parts."
@rickgraham said:
create a standing seam roof generator.
There are lots of varietys: http://www.ultraseam.com/
What do you need?
If there's no option to change a setting, you have no way to express your preference.
To be very technical, a "setting" is something that is "set." Your Ruby interpreter expects a ".rb" file extension. (One example of a setting that is not optional.)
If you can choose, for example, a level of indentation in your source code editor (please don't choose two!) you have an option. If you are writing Python, four spaces is mandatory so you don't have an option.
Preferences are probably best left to purely personal choices. I've set my browser's default background to an off-white color that I prefer; it's default font size to a my compromise between viewing more and reading easily. (And I dislike web pages, such as this forum, where the webmaster overrides my preference by specifying a pure white background. We should all respect our viewers preferences.)
The API doc for Camera.set()
isn't right.
Camera.set()
, as the name implies, sets the camera. It might have been better to call it Camera.set!()
. It does not return a reference to a new Camera object.
Camera.new()
returns a reference to a new Camera object and should not be deprecated.
c = cam.set( ... )
c == cam # true
The code example camera = camera.set ...
is bad practice. The camera =
part should be discarded.
Anyone with a copy of my Chapter 16 and its associated code should get a new copy.
Tracking: problem does not appear in Opera of Firefox. It's a Chrome bug.
Googled "how to report a Chrome bug." Following thru, closed and reopened Chrome. Problem gone. Glad I took that screenshot showing the problem.
@dan rathbun said:
Check your stylesheets especially for any style changes to <h2> elements (as that seems to be the one with the skyblue background on the API pages.)
Only stylesheet, in its entirety:
/* api-doc.css
copyright 2009, Martin Rinehart */
a { text-decoration; none; }
body { font-family; FreeSans, arial, sans-serif; }
.blue { background-color; #c8c8ff; }
.white { background-color; #e8e8ff; }
/* end of api-doc.css */
This is more than a little odd. It appears that an empty <h2>, stretched to the full height of the Methods <div> has been laid on top of what you want to see. Opening the Google page on its own (not in a frame) eliminates the problem. Odd.
Edit: Problem is now gone.
Recently (last few days?) Google changed the API Doc's HTML/CSS/JavaScript. They added an option to show/hide the left-side navbar.
Click the bar and it hides.
You have to look closely, but the bar itself is still there. Another click restores. Nice.
Except that it has totally destroyed my system. I was displaying Google's doc in a large center frame with my own top and left navigation frames. (Among the other advantages of this system is that it let me add links to other doc.) Now when I load the Google page it works fine at first, but after a second or so, a large div (or ?) locates itself over the methods doc:
The method doc is still there. You can see little hints of it peeking out on the far right, but the covering thingie hides everything until the "add your own comments" at the bottom. I was very happy with my API doc system until this happened. I cannot think why a page would fail this way just because you load it into a frame. Any ideas?