Wish:snap view function

for example, in ug/nx : Press the Snap View function key, F8, to orient the current view to the closest orthographic view.
it’s very useful.
so i’ll no longer need to switch between different viewport to observe my models.
thx

If you are in the Perspective viewport, and you have a perspective projection, when you “snap” the view to, say “Front”, what do you expect to happen to the projection - should it be set to parallel? If so, when you rotate the view away from that you want it to go back to a perspective projection?

–Mitch

I feel a script coming on…

-Pascal

hi Mitch

just keep the projection method as its original.  it should works better in parallel projection viewport. and view rotate method set to "rotate relative to view".

like this http://youtu.be/s6oKx1yCWC4?t=22s

and the orient view normal to selected surface function is also very efficient.

You can try the attached script and see if we are getting close to what you want.
To use the script, extract and save the .rvb file from the attached zip archive, then drag and drop the saved rvb over an open Rhino V4 or v5 window. This will load the script, set it up to load on startup in the future and register the aliases

NearestWorldView (sets view and Cplane, you can put this alias on your F8 key to match NX…)

WorldCplaneToView (sets only the cplane)

OrientViewCplaneToWorld (keeps the current Cplane origin location but orients the plane parallel to the nearest World plane- not different from the above unless you have a custom cplane origin.

that will run the script much like a regular command. An alias can be typed or added to a toolbar button or keyboard shortcut (F-key).

WorldCPlaneToView (2).zip

Only somewhat tested =)

-Pascal

Here’s my entry to try - tested even less than Pascal’s, probably… :smile:

–Mitch

TestSetViewToNearestWorldPlane.rvb

You can try this script: CameraToNormal.rvb

To load it from a button i´ve used this button command, note you need to change it to your proper path:

! _-LoadScript C:\Scripts\CameraToNormal.rvb

Its roughly tested with perspective and parallel views on surfaces, breps, extrusions and meshes. if meshes are large, it can take some time to find the normal. Known bugs are camera up vector jumps when the command is used repetetive in top or bottom view (vertical camera & target) and some stuttering if the mouse is moved during the camera animation.

Pascal & Mitch, i´ve thought the anim was a precondition :wink: How would you get rid of the stuttering ?

c.

hi pascal:

   thx for your script,but a got a problem to run the script,when I try to run the nearestworldview command I just got an error window(see attached).I keep getting this problem either at home or work,both computer run 32bit r5sr3.win7sp1

any help?
ne.jpg

thx,works like a magic.

but i want a little more,(greedily; ), your script resulting a ZoomExtents view,it will make me a little inconvenience when I observing a focused model part of an assemble.because it will zoom out the view to fit the whole assemble,so I had to zoom back to my model part after run the script.

can you help to update the script?

There is a typo in the script. If you open it in a text editor, change line 8 from :

Rhino.AddAlias "NearestWorldView", "_NoEcho _-Runscript (NearestOrthoView)"

to this:

Rhino.AddAlias "NearestWorldView", "_NoEcho _-Runscript (NearestWorldView)"

I think that should fix it… No time to test…

–Mitch

hi Mitch

thx for your advise,now i can run the script.

@pascal 's script resulting a nearest world view and the camera still look at the previous focus point.this is what I always want,but after run the nearestworldview command I can not continue rotate the current view,right mouse function turn to pan.and I don’t want to change the cplane.

awesome animation effect,it makes my rhino looks far more smart and cool.

can you do it a combination to the nearest world view function?

Sorry about the typo- thanks Mitch… So, I fixed that and it now does not change the cplane, however, if you want to tumble the view after setting it, I need to do one of:

  1. Make the view projection Perspective,

  2. Knock the view slightly off the true Top. Front etc

  3. Start the RotateView command at the end of it.

( Rhino will not tumble a view that is both parallel and plan to the CPlane. You can also Ctrl-Shift arrow key to start the view tumple in one of these views and then continue with the mouse)

WorldCPlaneToView (3).zip

-Pascal

thx again,
a little knock off is acceptable.now the script does exactly what I want. ^ _ ^

…er,one more request,how ahout a animated camera transition?

Probably possible, one way or another, but best handled as a real feature in Rhino, I would say, rather than a scripted band-aid.

-Pascal

As Pascal said, this should be best handled as a real feature in Rhino which does not act on mouse interventions while the animation runs. Imho the abrupt movement of Rhino’s navigation (eg. rotate and pan camera) is something which could be further refined. Occasionally, an animated camera which starts and stops it`s movement smoothly but does not distract the user, would make the process of navigation easier to follow…

c.

While the animation might be fun, if you have a heavy model, it’s going to be slow, as you need to redraw the screen with a number of frames to make the move. Every redraw (every frame) will slow things down.

–Mitch