Grasshopper

algorithmic modeling for Rhino

Hello

I am using quad tree to group a collection of 3d points to a 2d grid of rectangles.

since the points are in 3d space, the output is projected points of the initial 3d points.

I would like to ask how could i match the data structure of the points per leaf to the initial 3d points collection. (perhaps having the indexes of the initial points as outputs in quad tree component)

What i am trying to is to compute the average distance of the initial points, per leaf plane.

thank you in advance for your time.

best

alex

Views: 2341

Attachments:

Replies to This Discussion

This can be solved with closest point, but I also want the components quad/oct tree return other information such as indexes and topology, why not?

Attachments:

Testing each leaf with every 3d point kind of makes the benefits of quad/oct go away.

maybe i have not understood your suggestion correctly.

thank you

You're right, but what else can you do? (I know you already know this solution). You can ask to David, to add that output, and I have responded to join to the proposal. Sorry for the misunderstanding.

I guess since they are projected both indices and distances could be there as outputs.

Daniel i missed a question mark. i did not say i knew it.:-). But working with large set of points all the available components are too expensive to use.

I am out of ideas.

thank you again for your input.

Another possibility would be to make a mesh with the rectangles of quadtree, and a line for each point intersecting the mesh. Thus, only iterates once for each point and should be faster. The face intersecting with each line is the index of the branch of the quadtree points.

Daniel that's it! I skipped quad tree because when meshing quad tree's curves some curves created two faces etc.

so i created mesh plane, check for all the points the intersections according to mesh face indices and that gives the paths for the tree of the points that are for each face.

for 1milion640k point it spends 1 minute for the intersection and 45 seconds for the mempber indexes. the other compoents needed are quick.

i quess i can live with that. but still having the indices in qt and oct would be best.

thank you all fro your input and help

best

alex

I don't know if this helps?  It's a cluster I created and posted here back in July for getting the average point in a "point cloud":

Inside the 'PtCloudCntr' cluster:

Hello Joseph,

thank you for your answer, this could work when using octree, finding the average per 3d leaf and then go to 2d with those averages. will test it and post results.

but still, are there any other ideas?

OK, this looks crazy but it might be correct?

"average distance of the initial points, per leaf plane" is in the panel on the right:

Attachments:

thank you again Joseph. it is correct. problem is that brep inclusion still checks every point for every brep making it impossible for very large point collections.

i turned my interest to octtree and quad tree for that reason. maybe i a missing something there.

thank you again.

best

alex

Fascinating.  I've never heard of 'QuadTree' or 'OcTree'.

Attachments:

you can check this post it has very interesting links to David Ruttens blog

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