09-29-2021, 04:22 PM (This post was last modified: 09-29-2021, 04:29 PM by abenedik.)
This can be created by first creating a symmetrical cone tube and then manually adjusting the top or bottom positions.
For example:
Code:
var coneMesh = new Ab3d.Meshes.TubeMesh3D(bottomCenterPosition: new Point3D(0, 0, 0),
heightDirection: new Vector3D(0, 1, 0),
bottomOuterRadius: 100,
bottomInnerRadius: 90,
topOuterRadius: 50,
topInnerRadius: 40,
height: 100,
segments: 30);
var coneMeshGeometry3D = coneMesh.Geometry;
var positions = coneMeshGeometry3D.Positions; // read Positions DependencyProperty only once
int count = positions.Count;
var offsetVector = new Vector3D(-50, 0, 0); // offest top positions by X = -50; this will make the left edge vertical
for (int i = 0; i < count; i++)
{
if (positions[i].Y > 50) // adjust only top positions (they have Y set to 100, but to avoid using equals on floating point, we just use bigger then 50)
positions[i] += offsetVector;
}
var geometryModel3D = new GeometryModel3D(coneMeshGeometry3D, new DiffuseMaterial(Brushes.Orange));