Grasshopper

algorithmic modeling for Rhino

Hi.
I am using a Voronoi script that creates cells inside a simple volume. So I have got a lot of cells consisting of faces. Now I want to select only the faces on the four facades and not those in the middle of the volume. (see attached).
Does anyone know how to do this? Maybe something about finding curves on a surface or something?

Thanks Rasmus

Views: 2623

Attachments:

Replies to This Discussion

Hey

You could create a normal line to all surfaces and check which of the lines intersect your bounding volume, and create a cull-pattern from this. You might need to use a vb.script to keep track of which normal lines go together with what surfaces.

/Thomas
Hi.
When making normals from fx the center of all of the surfaces I will create normal lines. Some of these are inside the volume, some are outside. So some of the surfaces on the facade will have normals pointing "inwards", others will be pointing "outwards"?? Or have I misunderstood you?
Thanks!
You could do it by the following steps:

1. Use the area component to find the centroid
2. Use the Surface Closest Point to get the UV-coordinate at the point.
3. Use Evaluate surface to find the normal vector.
4. Create a Line SDL using the centroid and vector as inputs, make it relatively short.
5. Move it "backwards" (the oppesite direction of the normal) by half the length, so as to place it in the middle of the surface.
6. Carry out the intersection check!

/T
Do i find the centroid of the cell first? And then use a component that kan find the point on the surface that is closest to the centroid? It seems I can only find a Closest Point component that the closest point from a set of points?

red: Oh now I got it! The right component... Srf CP..
So the intersection check component checks that there is a line that is both inside and outside the volume? So how come the lines that are inside are not considered to "intersect" the volume?
if you've made the normal lines short enough, none of those of the interior voronoi faces should intersect the boundary object - the simple volume you've used (the facade). Then when intersecting with the normal lines, only those voronoi surfaces which are lying on the surface of the boundary, should intersect it.
I see... And it works, but now I have got a lot of points on the boundary surfaces, do you have a clever idea for how to make the cull pattern? The C output only returns null for all surfaces.
For me the easiest way would be to use a vb.script. Input the normal lines and the simple volume. Do the intersection test, and output true values where there is intersection and false where there is not.

i'm working on something similar right now, so i'll try to come up with a non-scripting solution.

Does it return null-values for normal lines with no intersection?
Well I have 30 cells. So I get a list with 30 paths containing the a value for each surface in the cell. And all the values are "null". But I can't quite understand why the intersection component creates so many points for on each of the surfaces on the basic volume surface? It seems like it tells me where all of the normals would intersect the BRep if the where infinite?

I don't really know the VB script, since I am only used to scripting in MatLab. But yes like you say, the intersection component should give me true values for all of the normals that are intersection the outer surface and false for all of those inside the volume....
I can't reply to your last post. Is it locked?

But anyways... the output which outputs the points, does it give null values where there is no intersections?
I don't know, maybe it is because I can still edit it!

No it does'nt give null. I seems like it gives med 2 points for each surface in all of the cells. But they are displayed on the BRep surface... Screen dump attached
Attachments:
Hmm... perhaps the lines are regarded as being infinite, and thus intersect on two sides of the brep?

If you only have one normal line pr. voronoi cell and only on brep, the intersect should yield only one intersection pr normal line.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service