curve intersection with volume in animation nodes How can we detect the intersection of a spline with a volume? I've been trying to create edges from the splines to detect the crossing between lines and planes but I'm not sure if thats the correct approach.

What I am trying to accomplish is to detect where a curve enters and exits a volume, any ideas? 

EDIT 

I'm trying to reproduce the solution but I found that my evaluation spline node doesn't look like yours, it actually has the parameters from "Get spline samples" node, but also differs in its outputs. Checked hidden parameters but all is unhidden. 

EDIT

seems "get spline samples" does the job fine. Might be a custom naming issue 

EDIT 2

After downloading @Omar Ahmad blend file I noticed that this method is far more efficient but still produces inconsistent results. When a play with the spline points moving them around and increasing all evaluate and get sample nodes to resolution up to 5000 the problem persists. I'm sorry if I'm being too strict with this detail (which could be due to a resolution factor) but is very important for me this works as foreseeable as posible. Here the screenshot showing the problem:
Naively intersecting lines with planes could be problematic as the Intersect Line Plane node, or the Python function behind it, considers the plane to be infinite. Therefore, as a second step, you would have to check if the intersection really is on the polygon.

I suggest using the BVHTree > Ray Cast node instead.



With the Evaluate Spline node (for Aimation Nodes v2.1; Get Spline Samples for AN v2.0) and two different slices of the node's Locations list – vectors[:-1] and vectors[1:] – I create small line segments along the spline.



start vector and end vector of these segments (as iterators) as well as the BVH Tree of the object (as parameter) are fed into a loop. Within this loop I call Ray Cast with a maximum distance of the segments' lengths and a minimum distance of zero. (The minimum distance by default is 0.001 or something which might result in some missed intersections.)  

With the Condition input of the loop's Vector List output I collect all location vectors of ray casts that resulted in a hit.



The Ray Cast node also has a Normal output that lets you align objects on the face where there is an intersection – e.g. by using the Direction to Rotation node. If you also want to distinguish entries into and exits from the volume then you can calculate the angles between the normal and the segment and check if it's smaller or larger than 90°.