Eccentric ConeTube
#1
Is there a way to create an Eccentric ConeTube?
#2
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));

MainViewport.Children.Add(geometryModel3D.CreateModelVisual3D());

This produces the following model:
   
Andrej Benedik
#3
Hi Abenedik, thank you for the tip.

Best regards.

Mattia
  


Forum Jump:


Users browsing this thread:
1 Guest(s)