"Orient on Objects" tool


#1

Hi All,

There’s been talk about orienting objects on meshes or polysurfaces that would come handy in many cases (@leex, @laborda, @EricM, @pascal ).
Here is an experimental tool that should do that, with some more options. It’s a RhinoScript plugin that works in somehow ‘unorthodox Rhino’ way with limited command-line input but by pressing keys instead. See below for the key shortcuts map or press [ i ], and a video showing some of the workflow.

Few notes:

  1. In Rhino 5, to make a copy, press “c”. In Rhino 6 WIP only it is possible to also use LMB click.
  2. the regular Rhino snaps don’t work in real-time preview mode (can snap only to mesh vertex/edge). In order to have Snaps, use “Lock” mode [ v ]-key, from there with no interactive preview it is possible to use OSnaps. In “Lock” mode [c] will make a copy and prompt for the new item location, [ v ] will unlock the location.
  3. [ m ] will switch between keyboard transforms and regular mouse-driven transforms ( in mouse mode, once the specific transform key is pressed it will start prompting for mouse input)
  4. Obviously there may be some bugs and errors, so use with caution.

–jarek



OrientObjectsOnObjects.rhp (60 KB)


Pave Layout Help
3D jewelry
What rhino commands do you use on a regular basis and think others don't know about?
Orient on surface strange works
Help with macro to streamline Orientate on surface command
(Pascal Golay) #2

For un-blocking: http://wiki.mcneel.com/rhino/unblockplugin

Hi Jarek thanks! , at first blush it looks like it probably does good things but so far I’m, finding it a little cryptic … I’ll poke some more.

-Pascal


#3

Hi Pascal - yeah, I knew operating on objects with keyboard presses will be scary ; )

The workflow should be straight-forward (see below) - I am just curious if it works for other users since making Rhino 5 read the key presses in real-time is quite a hack.

  1. Pick Items (Item = a collection of objects) and for each item pick a base point (and optionally a ‘normal’ direction - if skipped, World Z will be used)

  2. Select base objects to orient on

  3. From now on, just mouse-over the base objects - it should show the real-time preview of the Item being oriented. While doing so, you can transform the Item (w-s=scale, a-d=rotate, e-q=move), switch to next item (t-g), make a copy (c, or LMB in V6), etc. There are other options like changing the base point (b), flip (f), undo (u), reset transform (x), zoom to Item (o), lock Item in place (v); change scale mode from 1D to 3D (1,3), and transform method (m - mouse or keyboard); also, in case there are few base objects under the cursor, the ‘dot’ will turn cyan and (n) will toggle between the base objects for orientation. ® will show some more settings like the snap tolerances and the ‘step’ values of the keyboard-driven transforms.

hth,

–jarek


(Joaquin Laborda) #4

Thanks alot for this tool Jarek!
I can imagine multiple cases where I could use it.
I’ll test it and share my experience as soon as I can.

Joaquín


#5

Hi Jarek

First test here, works fine :smiley:
May I ask how did you manage to catch key presses in Rhino ?

Nice tool. Many thanks !


#6

Hi @Emilio,

Thanks for testing - good to know it works on your end as well.

As for catching key presses etc. :

  • In Rhino 6 (WIP) this should be much easier as we now have the 2 new methods for that:
    “GetKey”, “GetAsyncKeyState” (with the 2nd one you can test for mouse clicks as well ).

  • In Rhino 5 it’s trickier. With RS only you can do it by reading the command line input, see the “RS_ReadKeyPress_Sample.rvb” attached.

  • You can do more in V5 by using the DynamicWrapperX2 object (download at the bottom of the page) - with this one you can read keys and mouse presses, plus do many more things, but it may be more complicated if your scripts are intended to be used by others (making sure they have it available too). See “RS_ReadKeyPress_Sample2_with_DynamicWrapperX2.rvb” example.

–jarek

RS_ReadKeyPress_Sample.rvb (1.4 KB)
RS_ReadKeyPress_Sample2_with_DynamicWrapperX2.rvb (904 Bytes)


#7

Thanks a lot for the info and the samples, Jarek !
Cheers


#9

Jarek,

This is a great tool. Thanks!

I’m wondering if there would be a way to implement object snaps in your tool?

-Thomas


#10

Hi @thosmurray,

It may be possible to have it working in future version in real-time.
For now you can get the osnaps working only in 'Locked" mode.
If you press L it will lock the item in place, then C will make a copy and prompt for a new location. It will snap but not give you a ‘live’ preview, but it should orient your item on the surface correctly. In the video around 2:15 it shows how it should work.

hth,

–jarek


#11

It is very cool.
Great work!