如何创建一个直径变化的三维管道

3
我正在使用WPF的Helix工具包,尝试制作一个包含变直径管道/管子的3D图像。基本上,我正在尝试将非直线旋转到轴周围,创建一个管道。我只关心最终的管道,而不是实际的旋转(我的意思是我不想可视化旋转)。
是否有一种方法可以使用Helix工具包或其他任何3D表面生成工具来完成这个任务?我能想到的最好的解决方案是创建一系列具有不同直径的管道,但我无法弄清楚如何平滑过渡每个管道之间的过渡。这也不是一个理想的解决方案,因为管道上有很多点,所以我最终得到了大约150个非常小的管道段。Helix的文档有些缺乏,但我已经查看了源代码,没有找到明显的解决方案。
1个回答

4

MeshBuilder.AddRevolvedGeometry()MeshBuilder.AddSurfaceOfRevolution()可以实现此功能。

请参见带有注释的源代码这里这里

/// <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)
并且。
/// <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)

这并没有提供问题的答案。如果要批评或请求作者澄清,请在他们的帖子下留言。-【来自审查】 - Jose Rodriguez
@Joseph 为什么不呢?OP想要使用Helix工具包创建旋转几何体。给出的方法确实可以创建这样的几何体,并且它们是Helix工具包的一部分。我既没有批评也没有请求澄清。 - wkl
你能提供关于这些方法的更多信息吗?例如如何使用它们或者提供更多相关信息的链接? - Jose Rodriguez
@Joseph,似乎没有在线文档(看起来你必须从源代码中构建自己的文档)。但是,我已经添加了链接到源代码,其中包含有关方法的注释描述。 - wkl
@wkl 谢谢,AddRevolvedGeometry() 方法正是我所需要的,只要我理解了 Vector3D 想要革命轴。 - Eliza Bennet

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接