Grasshopper

algorithmic modeling for Rhino

Sorting list of points depending on their location in different curves

Hello everyone,

I am stuck with a problem and don't know how to solve it.

I am trying to sort a list of points depending in which curve they are placed.

So I have a 3D scene with simple boxes and points which are located on different surfaces of these boxes. Now I want to divide the points in such a way that I have all the points located on each different surface in a branch of a list.

So if I have a tree for the points with 10 branches (for 10 different situations) and 4 different surfaces the points can be located on. I would like to have one tree as a result where I have the following struture:

{Situation 1, Surface 1}

{Situation 1, Surface 2}

{Situation 1, Surface 3}

{Situation 1, Surface 4}

{Situation 2, Surface 1}

...

{Situation 10, Surface 4}

My goal is to make individual surfaces based on the point clusters on each surface.

For now I tried the Point in Curves function, but somehow I still get points on different surfaces even though I should just get them for one of the surfaces.

Kind regards,

Florian

Views: 1129

Replies to This Discussion

"situations"?  Wow.  Please: Read this first! How to get help on this forum.

Sorry, I'll try to explain it better.

I have geometrical calculations of reflections on geometry for different time steps during the year (each time step is a branch in the tree).

As a result I get a tree with the points where the reflections hit the surface.

The tree therefore has the time step as the branch index and in each branch I can have a different amount of points.

Now I want to see on which surface the different points are located.

So I need to divide the list with the different branches for the time steps further into several subbranches one for each possible surface.

Attached I have a file with some internalized data and how I tried and failed so far (I also had other versions of the script but they also did not work). Maybe I just have a simple logic error but I can't see it.

Thank you.

Attachments:

I'm not satisfied with these results but don't know if it's "bad data" or bad code - or both?

Attachments:

I tried a handful of methods before posting yesterday; maybe should have slept on it, since I wasn't happy with any of them. 'InCurves' wouldn't have been my first choice, given a blank slate, but it seemed to work well enough?

Here is a different take on the problem, in two respects:

  • It uses 'Srf CP (Surface Closest Point)' instead of 'InCurves'.  Note that I had to use 'Smaller' (less than 0.001) instead of 'Equals' zero when using 'Distance (D)' to map points to appropriate surfaces.
  • It uses a slider to choose one timestamp at a time instead of applying the logic to all branches in the tree at once.  I'll need to step away for awhile to see how to do that differently... I couldn't figure it out.

Attachments:

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