HelixToolkit.Wpf.MeshBuilder.AddCone C# (CSharp) Method

AddCone() public method

Adds a cone.
public AddCone ( System.Windows.Media.Media3D.Point3D origin, System.Windows.Media.Media3D.Point3D apex, double baseRadius, bool baseCap, int thetaDiv ) : void
origin System.Windows.Media.Media3D.Point3D The origin point.
apex System.Windows.Media.Media3D.Point3D The apex point.
baseRadius double The base radius.
baseCap bool /// Include a base cap if set to true . ///
thetaDiv int The theta div.
return void
        public void AddCone(Point3D origin, Point3D apex, double baseRadius, bool baseCap, int thetaDiv)
        {
            var dir = apex - origin;
            this.AddCone(origin, dir, baseRadius, 0, dir.Length, baseCap, false, thetaDiv);
        }

Same methods

MeshBuilder::AddCone ( System.Windows.Media.Media3D.Point3D origin, System.Windows.Media.Media3D.Vector3D direction, double baseRadius, double topRadius, double height, bool baseCap, bool topCap, int thetaDiv ) : void

Usage Example

示例#1
0
        public static MeshGeometry3D GetPointedMesh(Tool tool, Point3D position, Vector3D direction)
        {
            var t       = tool as PointedTool;
            var builder = new HelixToolkit.Wpf.MeshBuilder();
            var p1      = position + direction * t.StraightLength;
            var p2      = position + direction * (t.StraightLength + t.ConeHeight);

            builder.AddCylinder(position, p1, t.Diameter / 2.0);
            builder.AddCone(p1, p2, t.Diameter / 2.0, false, 20);

            return(builder.ToMesh());
        }
All Usage Examples Of HelixToolkit.Wpf.MeshBuilder::AddCone