I'm using Helix toolkit with WPF, and I'm trying to make a 3D image that includes a pipe/tube that has a varying diameter. Essentially, I'm trying to take a non-straight line and rotate it around an axis, creating a tube. I only care about the resulting tube, not the actual rotation (I'm not trying to visualize the rotation, I mean).
Is there a way to do this with Helix toolkit, or for that matter, with any other 3D surface generating tool? The best solution I've been able to come up with is to create a series of pipes with different diameters, but I can't figure out how to smooth the transitions between each of the pipes. This is also a less than ideal solution, because there are a lot of points on the pipe, so I end up with about 150 very small pipe segments. The documentation for Helix is somewhat lacking, but I've gone through the source code without finding an obvious solution.
MeshBuilder.AddRevolvedGeometry()
or MeshBuilder.AddSurfaceOfRevolution()
should do this.
See the source code with comments here and here saying
/// <summary> /// Adds a surface of revolution /// </summary> /// <param name="origin">The origin.</param> /// <param name="axis">The axis.</param> /// <param name="section">The points defining the curve to revolve.</param> /// <param name="sectionIndices">The indices of the line segments of the section.</param> /// <param name="thetaDiv">The number of divisions.</param> /// <param name="textureValues">The texture values.</param> public void AddSurfaceOfRevolution( Point3D origin, Vector3D axis, IList<Point> section, IList<int> sectionIndices, int thetaDiv = 37, IList<double> textureValues = null)
and
/// <summary> /// Adds a surface of revolution. /// </summary> /// <param name="points">The points (x coordinates are distance from the origin along the axis of revolution, y coordinates are radius, )</param> /// <param name="textureValues">The v texture coordinates, one for each point in the <paramref name="points" /> list.</param> /// <param name="origin">The origin of the revolution axis.</param> /// <param name="direction">The direction of the revolution axis.</param> /// <param name="thetaDiv">The number of divisions around the mesh.</param> /// <remarks> /// See http://en.wikipedia.org/wiki/Surface_of_revolution. /// </remarks> public void AddRevolvedGeometry(IList<Point> points, IList<double> textureValues, Point3D origin, Vector3D direction, int thetaDiv)