private MeshGeometry3D Build(MDT.DiskOnConeTool t)
        {
            var builder = new MeshBuilder();
            var d       = Math.Abs(t.BodyThickness - t.CuttingThickness) / 2.0;
            var r1      = t.Diameter / 2.0 - t.CuttingRadialThickness;
            var p1      = new Vector3(0.0f, 0.0f, -(float)t.PostponemntLength);
            var profile = new SharpDX.Vector2[]
            {
                new SharpDX.Vector2(0.0f, (float)(t.PostponemntDiameter / 2.0)),
                new SharpDX.Vector2(0.0f, (float)r1),
                new SharpDX.Vector2((float)(-d), (float)r1),
                new SharpDX.Vector2((float)(-d), (float)(t.Diameter / 2.0)),
                new SharpDX.Vector2((float)(t.BodyThickness + d), (float)(t.Diameter / 2.0)),
                new SharpDX.Vector2((float)(t.BodyThickness + d), (float)r1),
                new SharpDX.Vector2((float)t.BodyThickness, (float)r1),
                new SharpDX.Vector2((float)t.BodyThickness, (float)(t.PostponemntDiameter / 2.0)),
            };

            builder.AddRevolvedGeometry(profile.ToList(),
                                        null,
                                        p1,
                                        new Vector3(0.0f, 0.0f, -1.0f),
                                        100);
            builder.AddCylinder(new Vector3(),
                                p1,
                                t.PostponemntDiameter,
                                20);

            return(builder.ToMesh());
        }
Ejemplo n.º 2
0
        private static MDT.Tool ToDiskOnCone(MMT.Tool tool)
        {
            var t   = new MDT.DiskOnConeTool();
            var dct = tool as MMT.DiskOnConeTool;

            t.Diameter = dct.Diameter;
            t.CuttingRadialThickness = dct.CuttingRadialThickness;
            t.BodyThickness          = dct.BodyThickness;
            t.CuttingThickness       = dct.CuttingThickness;
            t.RadialUsefulLength     = dct.RadialUsefulLength;
            t.PostponemntDiameter    = dct.PostponemntDiameter;
            t.PostponemntLength      = dct.PostponemntLength;

            UpdateBaseData(t, tool);

            return(t);
        }