Problem with projecting points

  1. Solution exception:index must be less than the size of the collection

I am trying to project points, but those points are not projected, what am I doing wrong?

20190109 problem projecting point 00.gh (23.9 KB)

Try putting a boundary surface component on your curves and using a Z vector.

As Rickson said. Just keep in mind that Project doesn’t work along the projection axis in both directions. I.e if your geometry is below the target then you should project +Z, if the target is below, project -Z. If you want to limit the deformation of the points, try finding the best fit plane of the surface and use the Z component from there instead of world Z.

Thank you both for your response.
Another question about projection.

What I want to get is that the points in the middle project to some specific curves. When I take branch 0 of both the points and the curve groups it works, but when I try to let the component run the other branches it does not work.

I am using the y unit because it is all flat on the surface of the plane.

I know not all points will be projected, but I only want the ones that are projected. From there I can python things.

Or the python code for this kind of ‘projection,’ it might work when running it with python.

Your branch alignment of points and curves aren’t aligned.

Yes, that is what I am trying to work with. The setup is correct. I intended it all like that. The branches are aligned.

Wrong language, he he. Anyway translate (or get the gist of it and write your own P thingy) the attached and be a happy bunny.

Curves_Ccx_InsideOut_V1.gh (124.1 KB)

PS: Always do Curve/Curve ccx stuff for cases like this. If you want to use Ray3d for some other type of “targets” take into account the limitations (see SDK).

1 Like

Thank you.
I cannot understand how to use the C# script. I want to project the things like in the setup of branches; wherefrom I want to get the list of points including the 's.

I am trying to find a way of projecting the points in the setup per branch. Like the branch in the image below for example, but for all branches. The component seems not to allow it or I have to branch it different I guess.

I am now trying to find a way around as you suggested with the CCX component.

Since you want to play P games the C# is just indicative. Other than that the whole procedure It’s rather elementary:

  1. Sample points in a Tree and Curves in a List.
  2. For a given Tree branch you work against a Curve … meaning that the branches in the points Tree and the items (Curves) in the List MUST match 1:1 (your example is 100% wrong on that matter). If the Curve is closed you can use the inclusion option. If is open all points are taken. No co-planarity checks are included. If a Curve closest point is at distance < tol to any point in the List … then this point is discarded (meaning that points on Curves are NOT yielding any ccx Event (a “projection” as you wrongly descride it)).
  3. Then define a direction and the rest are easy.

In general and given the state of things in your example I would strongly suggest to make a brake and fully understand what a Data Tree is. 99.999% of issues seen in this Forum are related with the simple fact that the basic GH data organization schema is a terra firma for the vast majority of new users.

1 Like

BTW: The attached is using Planes (as an option) for the ccx Events. Far more safer in case that your Curves are not planar or you think that they are or your Points are not co-planar with the Curves or … anything in between as it happens in real-life (in 99.99% of cases).

Curves_Ccx_InsideOut_V1A.gh (124.9 KB)