3

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.

Eliza Bennet
  • 179
  • 4
  • 17

1 Answers1

4

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)
wkl
  • 1,896
  • 2
  • 15
  • 26
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/14841572) – Jose Rodriguez Jan 10 '17 at 15:18
  • @Joseph why not? The OP wanted to create a revolved geometry using Helix toolkit. The given methods do create such a geometry and they are part of the Helix toolkit. I did neither critique nor request clarification. – wkl Jan 10 '17 at 15:21
  • Can you provide more information about these methods, an example of how to use them or a link where more information is provided? – Jose Rodriguez Jan 10 '17 at 15:32
  • @Joseph There does not seem to be an online documentation (seems you have to build your own from the sources). However, I have added links to the source code where the methods have comments describing them. – wkl Jan 10 '17 at 15:36
  • @wkl Thank you, the `AddRevolvedGeometry()` method did exactly what I was looking for, once I understood that the `Vector3D` wanted the axis for revolution. – Eliza Bennet Jan 10 '17 at 17:29