# Surface from curve tangent to pipe

tangent plate.3dm (133.2 KB)
tangent plate.gh (12.2 KB)

Goodday,

For a small project, I need a flexible way to form a surface between a curve that is not straight, tangent to a pipe that is not straight.
It must be possible to change the form of the curve as well as of the pipe.
The theory that I use for this is that there are equally spaced points on the lower curve from where the closest points on the centerline of the pipe are determined.
At these points a circle with the same diameter as the pipe are placed perpendicular to the centreline of the pipe.
From the points on the lower curve, tangent lines to the circles are made, and through the endpoints of the tangent lines a curve is made.
Finally a surface through the lower curve and the curve on the pipe is made.
This works fine as long as the lower curve and pipe have not to extreme forms, and sometimes raising the amount of points on the lower curve helps.

During testing I made some checks:
1 Intersection of circles with pipe.
-Allways works fine.
2 Intersection of the curve through the endpoints of the tangent lines with the pipe
-Mostly works when the amount of points on the lower curve is raised.
3 Intersection of the surface with the pipe
-Doesn’t allways work, sometimes even not when the curve through the endpoints of the
tangent lines works well.
4 When the surface and pipe are baked, the intersection between these two elements happens even
less then in point 3

Maybe someone knows why these failures happen, and how to change this.
I’m not using Grasshopper regularly, actually this is the 3rd project I’m doing in the last 7 years, so there may be a lot of things that should be done different. Please let me know.

Dirk

It’s better you just tell what kind of project you are engaging.
Because there could be infinite number of surfaces by the definition of starting from a curve and being tangent to a pipe.
Or do you want a surface that has minimal area?

Hallo Quan Li,