OrientOnMesh?

Hi All,

Is there a way to do interactive orient on Mesh, similar way we have OrientOnSfr command? I can’t figure it out (probably scriptable, but I am after nice a interactive way like the Surface equivalent does…)

Thanks,

Jarek

HI Jarek - none that I know of - a workaround might be to Drape or Patch the area with a surface.

@Jarek, just thinking a little about this… would you expect the location to be limited to vertices? if not, would the normal be the face normal? And if on an edge, the average between faces?

Added as http://mcneel.myjetbrains.com/youtrack/issue/RH-30260

-Pascal

Hi @pascal

Yes, exactly - not limited to vertices, rather face normal or average of normal for edges and vertices. An interactive way like OrientOnSrf would be very helpful. I can script this now with RhinoScript, but its is of not much use without ‘live’ preview.

-jarek

I see from the jetbrains tracker this has been bumped from the 6.0 release to 6.x. I really would like to vote to have this yesterday.

Right now I use orient3pt and pick 3 planar points on my object base. Then for my target, I switch my osnaps to just vertex and just grab 3 neighboring points on the mesh. That effectively lines it up with the normal, but makes for a lot of clicking.

Someone could probably script that for me in v5, but I’m not sure how to grab neighboring vertex points.

I’ll see if I can make something that works ok for now. Unless Mitch beats me to it of course.

-Pascal

Would an undo be pushing my luck? Like if you lay a polyline point down wrong, you can _Undo and grab the right point. Sometimes using orient like that, you can click in the wrong order and flip the normal so to speak. You figure out quick how not to do that, but a script just grabbing nearby points would have a hard time grabbing them in order.

Yep…

-Pascal

I kinda figured. Maybe if I open up the parameters a bit you can think of an alternative.

Basically I’m trying to orient and scale rigid objects by the target normal. Splop and OrientOnSrf are limited to only working on a surface rather than a polysrf. PersistentOnPolySrf with Orient3pt turns off after each copy. The fastest way I found is to create a dummy mesh and use its vertex points. But that’s 3 clicks with no undo and I’m making 20 copies, so thats ~70 clicks with errors. Then I go back and scale each object individually.

If you can’t think of anything existing, What about:

  • a rigid only version of Splop that took polysrfs as a target?
  • orientonsrf accepting a polysrf as input?

Hi Eric- here is a very crude Pythony start - it might even be useful -
OrientOnMesh.py (2.9 KB)

Use RunPythonScript for now- if it more or less works, I’ll clean up and make it easier to use. I suppose the same code could make at least a ‘rigid’ OrientOnPolysrf by just using the object’s render mesh.

@Jarek, I’m sure you can make it better as well- so far no preview drawing or anything like that, just rs functions for the most part.

-Pascal

Hi Pascal - thanks - in general it works but let’s me do only one placement over here, then exits.
I guess the idea was to do many at once.

I can’t do even crude Pythony scripting yet! The day will come I will catch up, I hope…
I have some ideas how to do in in RhinoScript too - I’ll give it a shot.

thanks–

jarek

It should repeat… mine does! Let me check, there is a bunch of cleanup to do on this thing, I just wanted to see if it basically does the right thing.

This one repeats here - should be the same as above but maybe not - it’s a bit ugly still because you need to answer the Flip question with every copy. OrientOnMesh.py (2.9 KB)

-Pascal

1 Like

Hey Pascal - it asks for the scale reference point twice, then exits…

OK- thanks - works perfectly here of course. I’ll poke at it some more - lot’s of support stuff today so it may be a while…

-Pascal

how to run the script?
I cannot understand how it works.

Hi -

Use RunPythonScript in Rhino.
-wim

1 Like

thanks for a great cool tool.
only flip infuriates.
can you turn on the view of the object when you select the position?
how to disable grouping?

OrientOnMesh.py (2.9 KB)

Yeah, there is certainly some room for improvement, I’ll take a look. Thanks.
@taraskydon - see if this one works any better -

OrientOnMesh.py (3.1 KB)

-Pascal

2 Likes

all very well, thank you. :+1: :fist:
live preview. is it possible to screw it on?

Not easily - this is a cheap script using some top level Rhino commands, nothing very sophisticated.

-Pascal

1 Like

very sorry. in python is it possible?