Vector + Raster renders w/ SafeFrame (was Output Size in Rhinoscript)

Hi,

I teach my students how to combine vector and raster imagery, by layering the results of Make2D, etc. onto a (Brazil) render from the same point of view.  Brian Boyer's handy Viewmaker.rvb script, which grabs the outline of the current Viewport and outputs that along with a Make2D, has always been helpful with this, because it allows fairly precise snapping of the view and the rendering.  BUT, this does not take the Safe Frame into account, unfortunately.

So, two questions:

a) I find no mention of the Safe Frame whatsoever in the Rhinoscript documentation - does anyone know a way to access the screen coordinates of the Safe Frame directly?

b) I'm assuming the answer to a) is "no", so then I want to reconstruct the Safe Frame by just centering a rectangle with the pixel size specific in Brazil's Output Size.  Does anyone know how to access Brazil's Output Size parameters (especially, the width and height of the output) so that I can figure out the correct frame to draw around any Make2D's?

 

Many thanks,

 

George

 

Views: 1145

Reply to This

Replies to This Discussion

I found one part of what I need: the Rhino.Resolution() command gives me the output size in pixels. 

 

Unfortunately the way that the Safe Frame is calculated in relation to the size of the Viewport seems to be a little obscure - the width of the Safe Frame changes in a non-linear way as the Viewport size changes...  I will post a script if I get anything that works in any case (e.g. at least when the entire Safe Frame is visible on the Viewport).

I have developed a partial solution to this problem.  I'm attaching a script, called ViewMaker-SF, which is based on Brian Boyer's original Viewmaker code, but now uses the Safe Frame rather than the Viewport.  Using this script, you should be able to very cleanly overlay vector output (it runs Make2d) with raster output, by locking the vector frame to the rendering's frame.  Here are two critical notes (also included in the script, if you want to read code):

''  IMPORTANT NOTES for USE!
''  1. WARNING - make sure all edges of your Safe Frame are 100%
''        visible in your Viewport!
''        i.e. make sure the viewport edges are not cropping the Safe
''        Frame's outer frame on any side.  The Safe Frame is
''        sized by a slightly mysterious calculation
''        that Rhino does not seem to expose in its options. 
''    2. WARNING: I only tested this with Brazil for Rhino, on Rhino 4 SR9.
''        You may run into problems with other renderers (as noted
''        in the code below)

For the life of me I can't figure out how the Safe Frame is sized in relation to the Viewport - I'm giving up on reverse-engineering it for now.  See my comments on the Safe Frame in my wishlist for the next release of Brazil: http://tinyurl.com/4x6hn4y I guess I would add a wish for easy scripting access to the Safe Frame coordinates!

If anyone uses the script, I would love to hear feedback (here on the forum) in terms of what works and what doesn't.  Cheers, George

Attachments:

Hi George


What is th Rhino.Resolution() command?

 

George Showman said:

I found one part of what I need: the Rhino.Resolution() command gives me the output size in pixels. 

 

Unfortunately the way that the Safe Frame is calculated in relation to the size of the Viewport seems to be a little obscure - the width of the Safe Frame changes in a non-linear way as the Viewport size changes...  I will post a script if I get anything that works in any case (e.g. at least when the entire Safe Frame is visible on the Viewport).

Sorry, that's Rhino.RenderResolution().  It's a scripting command, you can read about it here:

http://www.rhino3d.com/5/rhinoscript/index.html

(search for RenderResolution)

Thanks again, I figured it was a script but I thought it was hidden in Rhino...:)

Thanks

Well, if you want to control the resolution of your rendering from the user side (i.e. you are trying to render out an image in Brazil), then the controls for that are under Output or Output Size in the Brazil Settings (it's one of the roll-outs near the top of the settings).

Reply to Discussion

RSS

Videos

  • Add Videos
  • View All

Members

© 2020   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service