Dear colleagues,
I am trying to find intersection between a trimmed surface and a line, using c# common operator:
Rhino.Geometry.Intersect.CurveIntersections Cross = Rhino.Geometry.Intersect.Intersection.CurveSurface(cline, surf, 0.001, tl);

In case “cline” intersect “surf” in the trimmed area CurveSurface() returns a point, but it is not a valid point.
In previous implementation of the same algorithm in RVB script, I used operator:

If Rhino.IsPointOnSurface(arrSurfs(j), arrPoint) Then …
endif

and it solved a problem.
Could anybody be so kind to help me for finding a solution of this problem?

Surfaces do not have trims. Trimmed surfaces are represented by Breps, which contain structures which maintain the active/inactive portions of a surface. A Brep face, in other words.

Thus, when you intersect a surface with a curve, you are always evaluating against an untrimmed surface, as surfaces do not have trims.

Hi @dale, thank you for your quick reply. However, I was wondering if its possible to do so using Open Nurbs methods. Right now I am using the “GetClosestPoint” method of the ON_Surface class. The method returns the closest point even if it is outside of the trimmed area. My problem is that I need to get only those points that lies inside the trimmed area.
Thanks in advance,

Andrés Uribe

Example: Due to the untrimmed gray surface is bigger, I am getting points outside of it (the expected point should lie only inside)

Since you are using C++, just use the RhinoCurveFaceIntersect utility function to calculate the intersection of your curve and your trimmed Brep face. See rhinoSdkUtilities.h for more details.

Another useful function is RhinoIsPointOnFace, which determines if a point is in the active region of a face. Again, see rhinoSdkUtilities.h for more details.