New API doc - typos and questions
-
http://code.google.com/intl/nb/apis/sketchup/docs/releases.html
The release notes says:@unknownuser said:
Cleaner, hash-based syntax for initializing
But there's nowhere any example of what the hash should look like, keys etc.
-
Thom, you are right it needs to be documented.
This is from the webtextures_loader.rb. The constants are defined a little earlier in the code, but this gives some idea about the keys:
# Create our dialog. keys = { ;dialog_title => title, ;scrollable => false, ;preferences_key => WT_DIALOG_REGISTRY_KEY, ;height => WT_DIALOG_HEIGHT, ;width => WT_DIALOG_WIDTH, ;left => WT_DIALOG_X, ;top => WT_DIALOG_Y, ;resizable => true, ;mac_only_use_nswindow => true} @dialog = UI;;WebDialog.new(keys)
-
Thanks Jim. Would probably be able to guess most - but...
What's unexpected there is
:mac_only_use_nswindow
- Same asWebDialog.navigation_buttons_enabled
? -
@thomthom said:
What's unexpected there is
:mac_only_use_nswindow
- Same asWebDialog.navigation_buttons_enabled
?Isn't 'nswindow' a base Cocoa (or Carbon) window class?
-
@dan rathbun said:
@thomthom said:
What's unexpected there is
:mac_only_use_nswindow
- Same asWebDialog.navigation_buttons_enabled
?Isn't 'nswindow' a base Cocoa (or Carbon) window class?
hm... I Googled 'mac nswindow' seems that you might be onto something.
http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindow_Class/Reference/Reference.htmlDoes it give any visible difference when it's set to
true
as oppose tofalse
? -
@thomthom said:
Does it give any visible difference when it's set to
true
as oppose tofalse
?I don't know. I don't have an Apple machine. [..wish I could install OSX of my 686 clone for devlopment. XCode looks like a neat IDE.] There are so many attributes, methods, etc. there it's hard to guess what the SU API is refering to.
-
Edge.reversed_in?
http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/edge.html#reversed_in?
The reversed_in? method is used to determine if the EdgeUse object is traversed in the corresponding direction as its corresponding edge.Apart from the EdgeUse typo - what does the method really do. I don't understand at all from the description what it does.
-
@thomthom said:
Edge.reversed_in?
http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/edge.html#reversed_in?
The reversed_in? method is used to determine if the EdgeUse object is traversed in the corresponding direction as its corresponding edge.Apart from the EdgeUse typo - what does the method really do. I don't understand at all from the description what it does.
I use it in my 'orient faces' method - although I agree that it all seems pretty arcane and badly explained. If an edge is reversed in a face it is going contrary to that face's logical loop direction. If you test an edge belonging to a selected face and that edge has that face face plus another one that both return as being either reversed or not-reversed then you know that this other face has the same 'orientation' as the selected face: if the other face has the opposite 'reversed-ness' to the selected face then it needs to be flipped over (reversed) so it orients the same way as the selected face...
-
There's a logical orientation of the loops?
-
@thomthom said:
There's a logical orientation of the loops?
If you get a set of vertices for a face's loop it's always listed as an ordered array: it will be rotating 'counter-clockwise' to the face's normal if it's an external loop, or 'clockwise' if it's an internal loop... If an edge's start/end vertices break this 'rule' I think it's said to be 'reversed in the face' ? That is the order of the edge's vertices don't follow the loops 'handed-ness' so are flagged thus...
-
@unknownuser said:
Your help in finding typos/missing details are very welcome!
On http://code.google.com/intl/da/apis/sketchup/docs/ourdoc/point3d.html#+ it says that the argument is a Point3d, but it should say a Vector3d.
Jarl
-
Geom;;Point3d.new(10,10,10) + Geom;;Point3d.new(20,20,20) Error; #<ArgumentError; (eval);261;in `+'; Cannot convert argument to Sketchup;;Vector3d> (eval);261
-
@jarl said:
@unknownuser said:
Your help in finding typos/missing details are very welcome!
On http://code.google.com/intl/da/apis/sketchup/docs/ourdoc/point3d.html#+ it says that the argument is a Point3d, but it should say a Vector3d.
Jarl
If you add two pointstogether it returns a vector (or another point if it's taken as an array) ?
-
Color
http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/color.htmlWhen creating a Color object you can specify an alpha value. Not mentioned in the examples.
Color.new
http://code.google.com/intl/nb/apis/sketchup/docs/ourdoc/color.html#new
The way the arguments are presented now it looks like they are all equal, but it's actually wither RGB(A) values or a String. It also takes Hex, array with Integers or Floats.Oddly enough, you can do:
Sketchup::Color.new(128)
and get a Red-ish color. But notSketchup::Color.new(128, 255)
- where it will throw an error saying at least 3 values are required. So if you can specify 1, 3 or 4 values for the RGBA combination. -
But the Color's Alpha value is always ignored anyway ?
Whereas Alpha value for the material is used ! -
@tig said:
But the Color's Alpha value is always ignored anyway ?
Whereas Alpha value for the material is used !Yea, that's what I've noticed as well. Confusing. Should be mentioned in the docs. I had hoped that the alpha channel would be used the the view.draw2d method, but alas - it does not. Wondering if it's by design or if it's a bug.
-
I guess it was perhaps an early implementation when perhaps Color and Material were the same thing ?
Also I suppose it allows you to import a RGBA value from elsewhere directly into a Color, but then using the first 3 items in the array is no hardship ???
Seems that the alpha could be removed as it's not needed/useful ? -
I'd rather see view.drawingcolor= make use of the alpha channel and let us draw transparent objects to the viewport.
-
@tig said:
That would be much more use... unfortunately with drawaren't we limited to the built-in color-set, and that has no transparency setting ?
draw
is currently bugged an only draws black fill.
draw2d
works, and you can specify anyColor
object (or hex,int,float,array that equal to a colour) but it ignores the alpha. -
@thomthom said:
I'd rather see view.drawingcolor= make use of the alpha channel and let us draw transparent objects to the viewport.
That would be much more use... unfortunately with
draw
aren't we limited to the built-in color-set, and that has no transparency setting ?
Transparency ispossible with OpenGL but not as I can seem in it's port to Ruby and SUp ???
Advertisement