Esempio n. 1
0
        public override bool Execute()
        {
            var mainAxis = Dependency[0].Axis3D.GpAxis;
            var xAxis    = Dependency[1].Axis3D.GpAxis;
            var radius   = Dependency[2].Real;
            var radius2  = Dependency[3].Real;
            var ax2      = new gpAx2(mainAxis.Location, mainAxis.Direction)
            {
                XDirection = xAxis.Direction
            };

            var torusShape = new BRepPrimAPIMakeTorus(ax2, radius * 3, radius2 / 3, 2 * Math.PI);

            Shape = torusShape.Shape;
            //Shape = GeomUtils.CreateWireCircle(mainAxis, radius * 3);

            return(true);
        }
Esempio n. 2
0
        public override bool Execute()
        {
            var centerAxis = Dependency[0].Axis3D;
            var ax2        = new gpAx2 {
                Axis = (centerAxis.GpAxis)
            };
            var radius1 = Dependency[1].Real;
            var radius2 = Dependency[2].Real;

            //BRepPrimAPIMakeTorus cylinderShape = new BRepPrimAPIMakeTorus(
            //    p, radius1, radius2, angle1, angle2, angle);
            var torusShape = new BRepPrimAPIMakeTorus(ax2, radius1, radius2, 2 * Math.PI);

            //if (!torusShape.IsDone())
            //    return false;

            //Pivot = centerAxis.Location;
            Shape = torusShape.Shape;

            return(true);
        }