Grasshopper

algorithmic modeling for Rhino

Hi Everyone,

I'm new to VB.net and really hope someone can help me out. I have managed to create a Vb script that outputs a list of Closed Breps and another that outputs a list of 3dPoints. What i would like to do is use the list of 3dpoints to position each of the Breps. i.e the first brep would be positioned by the first point in the 3dPoint list.

Does anyone know how I could do this VB.net? Even knowing how to move Breps in Vb would be a great help.

Thanks in advance.

Views: 2187

Replies to This Discussion

Hi Axiom,

we actually have a separate forum especially for VB and C# questions, you may consider posting there to avoid confusion.

Moving objects in the Rhino SDK often works in 2 ways:

1) Some object carry a Translate() function, which takes a motion vector. If your points define a motion from world origin to the point, it seems that all you have to do is:

myBrep.Translate(New On3dVector(pt.x, pt.y, pt.z))

2) Generic transformations are achieved via the Transform() function, which takes an OnXForm instance. OnXForm is a class that represents any combination of translation, rotation, scaling, shearing and tapering. In this case, you'd need something like:

Dim x_move As New OnXForm()
x_move.Translation(pt.x, pt.y, pt.z)
myBrep.Transform(x_move)


--
David Rutten
david@mcneel.com
Poprad, Slovakia
Hi David,

Thanks so much for your help, it worked perfectly. I didn't realise that the points needed to be a motion vector.

Thanks again.
Hi David,

Im looking to do the exact same thing although without having any experience in vb.net i would like to achieve this in grasshopper.

I.e

I have a number of breps/surfaces which i am inputting into grasshopper. I want to take their center point and populate them across a uniform grid of points. Like Axiom the first brep would be positioned on the first point, the second brep on the 2nd etc. etc.

If you have any idea it would be greatly appreciated!!
Hi,
I'm also interested in leon's problem.
how to position breps center points on a given point list or grid
is there a component we can feed with center points on one inlet, and with 3d shapes in an other inlet.
Thanks for any clue.
is the vb component the only solution to achieve this?
thanks for your precious help..
Something like this should do it:

1. Graft a list of input breps
2. Find the area centroid of each object
3. Construct vectors from the centroid points to origin (0,0,0)
4. Move all breps to origin on these vectors
5. Make x vectors of different lengths using a series component
6. Array the brep objects using a grafted list of vectors

this will array them breps in a line. To array them into a grid repeat 5 with a y vector and apply this to subsets of the brep list and combine the x and y vectors with a mass addition component

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service