Cleaning up the Curve.Project output

Hello,

I am projecting a sketch on a solid, but the node Curve.Project returns both top and bottom intersections. Basically, it goes “through” the object.

I would like to have a behavior similar to RayBounce, which stops at the first hit.

The problem with RayBounce is that it projects (finds) points, and it does not project curves onto the surface of the solid (topo).

Just wondering if there is a way to clean up the results of Curve.Project to only include the first intersection. (The list of geometry that Curve.Project returns is quite random).

Thank you

Assuming all surfaces are planar;

  1. Explode the cube to surfaces.
  2. Get the angle between each surface’s normal and your projection vector.
  3. Filter out any surfaces which had an angle less than 90 degrees (or less than or equal to 90 degrees if you don’t want the ‘sides’)
  4. Build a poly surface of the remaining surfaces, and protect onto that, or project onto the original solid and remove any curves which don’t have a midpoint that’s intersects with the polysurface.