Orient with CopyToPoints

Next
 From:  mkdm
8536.1 
Hi Michael.

I often find myself to repeat this operation :
1) Extract iso curves from some surfaces, 2) use the "_PointsOnCurve" script to distribute some points on the iso curve, 3) use the "orient" command to
make multiple copies of some input object that I want to replicate along curve, but with regards of the surface normal of the surface from which the iso curve was extracted.

I've made a search and if I'm not mistaken, there's only a "vClone" script made by max, but for what I've tested so far,
it's not what I want.

So I'm trying to piece together these operations with a bunch of Moi's Js code, picked here and there to create a new script.

The script I'm trying to write should do these things :

1) Select one input object like the "orient" command
2) Selects a bunch of destination points
3) make multiple copies of input object, like the "orient" command, but without the need of manually select the destination orientation
for each points.

I guess that I'm not made myself clear :)
So, I've recorded this little video to show you what I want to do with this new script : http://take.ms/xOC3v

These are the scripts I have used to create this example : http://take.ms/981KB
(_PointsOnCurve, CenterAtOrigin, CopyToPoints, Orient)

And this is the script I'm trying to write (orientWithCopyToPoints) : http://take.ms/UZM7b

As you can see in the video the problem is that I don't know how to apply destination frame automatically to target points.

This is the 3dm test file you can use to test what I'm saying: http://take.ms/BQkPu



I hope you have some spare time to help me to complete this script.

Thanks a lot and have a nice day.

- Marco (mkdm)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Max Smirnov (SMIRNOV)
8536.2 In reply to 8536.1 
Hi Marco,

use my vSeed script to place orientation vectors to the points or curves. Then you can use those vectors with vClone script.
Also you can use vSeed instead of PointsOnCurve script.
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mkdm
8536.3 In reply to 8536.2 
Hi Max.

I'm glad to hear you here again!

Did you hide under a rock or something this whole time ? :) :)

Thank you very much!!

It seems that your suggestion it's just what I was looking for.

Anyway, I will check the JS code of your scripts to learn more about Moi's Api function to call
in order to better understand the behavior of "orient" command.

Thanks again.

I hope that also Michael want spend some words to explain how to automate that very powerful command.

Have a nice day.

- Marco (mkdm)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8536.4 In reply to 8536.3 
Hi Marco,

> I hope that also Michael want spend some words to explain how to
> automate that very powerful command.

Which one, do you mean orient?

There isn't too much to the orient factory itself, it takes 4 parameters:

0 : ObjectList - objects to transform
1 : CoordinateFrame - base frame
2 : CoordinateFrame - target frame
3 : bool - make copies

Most of the logic for the orient command is more in the orientation picker and not in the orient factory itself. It's not so easy to automate the orientation picker since it relies on snap points that are picked with the mouse.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mkdm
8536.5 In reply to 8536.4 
Hi Michael.

@You : "...It's not so easy to automate the orientation picker since it relies on snap points that are picked with the mouse..."

My aim is just automate the calculation of orientation on destination object.
So, is this impossible ?

I mean, given a bunch of "point" objects how can I calculate or get the "frame" that represents the default axis orientation of each point (inside a loop) ?

Thanks.

- Marco (mkdm)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
8536.6 In reply to 8536.5 
Hi Marco,

re:
> I mean, given a bunch of "point" objects how can I calculate or get the "frame" that represents the
> default axis orientation of each point (inside a loop) ?

Well a point object by itself doesn't have any concept of an orientation. It's just x,y,z coordinates in space, the default would just be world axis directions. But you might check out Max's scripts from here if you've got other additional information like surfaces or curves on a surface: http://moi3d.com/forum/index.php?webtag=MOI&msg=6486.1

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  bemfarmer
8536.7 
Hi Marco.

I used Max's vSeed as follows.
Turn your edge into a curve by doing copy.
Create a 25 by 25 grid, at a spacing of 1 mm by 1mm, of vectors 1mm long, above your helix, in high z, oriented in the +z direction. Color style the vectors Red.
With no objects selected, Select the color style Blue.
Select the Red vectors, select the curve, and select the helix tube.
Run vSeed.
Apparently vSeed first creates a grid of Blue vectors, intermixed with the Red vectors, with each (undropped) Blue vector being oriented,
so that when dropped, it will be oriented normal to the helix tube at the point on the tube to which it is dropped.
A fraction of a second after the Blue vector grid is created, the Blue vectors drop down to the curve, and are normal to the helix tube.
Anyway, they appear to be normal.
I'm thinking that the blue vectors along the curve would be the targets of orient, but have not got that far, if it is possible with orient without manual picking...

- Brian

EDITED: 31 Jul 2017 by BEMFARMER

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  mkdm
8536.8 In reply to 8536.6 
Hi Michael.

Thanks for the quick reply.

Ok. ASAP I'm going to study Max's code.

Have a nice day.

- Marco (mkdm)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  mkdm
8536.9 In reply to 8536.7 
Hi bemfarmer.

Thanks a lot for your suggestion.

ASAP I'm going to repeat your test .

Have a nice day.

- Marco (mkdm)
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All