如何创建具有不同直径的 3D 管
How to create a 3D tube with a varying diameter
我正在将 Helix 工具包与 WPF 一起使用,并且我正在尝试制作一个 3D 图像,其中包含具有不同直径的 pipe/tube。本质上,我试图采用非直线并绕轴旋转它,从而创建一个管。我只关心最终的管子,而不关心实际的旋转(我的意思是,我不是想想象旋转)。
有没有办法使用 Helix 工具包或任何其他 3D 表面生成工具来做到这一点?我能想到的最佳解决方案是创建一系列不同直径的管道,但我不知道如何平滑每个管道之间的过渡。这也是一个不太理想的解决方案,因为管道上有很多点,所以我最终得到了大约 150 个非常小的管段。 Helix 的文档有些欠缺,但我浏览了源代码但没有找到明显的解决方案。
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)
我正在将 Helix 工具包与 WPF 一起使用,并且我正在尝试制作一个 3D 图像,其中包含具有不同直径的 pipe/tube。本质上,我试图采用非直线并绕轴旋转它,从而创建一个管。我只关心最终的管子,而不关心实际的旋转(我的意思是,我不是想想象旋转)。
有没有办法使用 Helix 工具包或任何其他 3D 表面生成工具来做到这一点?我能想到的最佳解决方案是创建一系列不同直径的管道,但我不知道如何平滑每个管道之间的过渡。这也是一个不太理想的解决方案,因为管道上有很多点,所以我最终得到了大约 150 个非常小的管段。 Helix 的文档有些欠缺,但我浏览了源代码但没有找到明显的解决方案。
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)