예제 #1
0
        RayTracer.IRayTraceable MakerGearXCariage()
        {
#if false
            MatterHackers.Csg.ObjectCSG total    = new MatterHackers.Csg.Box(30, 32, 65);
            MatterHackers.Csg.ObjectCSG minusBox = new MatterHackers.Csg.Box(20, 22, 55);
            minusBox = new MatterHackers.Csg.Translate(minusBox, 5, -5, 5);
            total   -= minusBox;
#else
            //MatterHackers.Csg.ObjectCSG frontRodHolder = new MatterHackers.Csg.Cylinder(11, 70, name: "front rod holder");
            MatterHackers.Csg.CsgObject frontRodHolder = new MatterHackers.Csg.Box(22, 22, 70, createCentered: false, name: "front rod holder");
            frontRodHolder = new MatterHackers.Csg.SetCenter(frontRodHolder, Vector3.Zero);
            MatterHackers.Csg.CsgObject total = frontRodHolder;

#if true
            MatterHackers.Csg.CsgObject backRodHolder = new MatterHackers.Csg.Cylinder(11, 70, name: "back rod holder");
            backRodHolder = new MatterHackers.Csg.Translate(backRodHolder, 0, 50, 0);
            //total += backRodHolder;

            MatterHackers.Csg.CsgObject plate = new MatterHackers.Csg.Box(7, 32, 65, createCentered: false);
            plate = new MatterHackers.Csg.SetCenter(plate, total.GetCenter());
            plate = new MatterHackers.Csg.Align(plate, Csg.Face.Bottom, frontRodHolder, Csg.Face.Bottom);
            //total += plate;

            MatterHackers.Csg.CsgObject beltMount = new MatterHackers.Csg.Box(7, 32, 30, createCentered: false);
            beltMount = new MatterHackers.Csg.SetCenter(beltMount, frontRodHolder.GetCenter() + new Vector3(6, -19, 0));

            // belt mount screw holes
            MatterHackers.Csg.CsgObject screwHole = new MatterHackers.Csg.Cylinder(2, beltMount.YSize + 1, MatterHackers.Csg.Alignment.x);
            screwHole = new MatterHackers.Csg.SetCenter(screwHole, beltMount.GetCenter());
            //beltMount -= new MatterHackers.Csg.Align(screwHole, Face.Front | Face.Top, beltMount, Face.Front | Face.Top, 0, 3, -4);
            //beltMount -= new MatterHackers.Csg.Align(screwHole, Face.Front | Face.Top, beltMount, Face.Front | Face.Top, 0, 18, -4);
            //beltMount -= new MatterHackers.Csg.Align(screwHole, Face.Front | Face.Bottom, beltMount, Face.Front | Face.Bottom, 0, 3, 4);
            //beltMount -= new MatterHackers.Csg.Align(screwHole, Face.Front | Face.Bottom, beltMount, Face.Front | Face.Bottom, 0, 18, 4);

            total += beltMount;
#endif

            // smooth rod holes
            //total -= new MatterHackers.Csg.Cylinder(8, 70, name: "front rod bearing hole");
            //total -= new MatterHackers.Csg.Cylinder(8, 70, name: "front rod bearing hole");
            total -= new MatterHackers.Csg.SetCenter(new MatterHackers.Csg.Box(16, 16, 70, createCentered: false, name: "front rod hole"), Vector3.Zero);
            //total -= new MatterHackers.Csg.SetCenter(new MatterHackers.Csg.Cylinder(8, 70, name: "back rod bearing hole"), backRodHolder.GetCenter());
#endif

            total = MatterHackers.Csg.CsgObject.Flatten(total);
            MatterHackers.Csg.OpenSCadOutput.Save(total, "MakerGearXCariage.scad");

            CsgToRayTraceable visitor = new CsgToRayTraceable();

            return(visitor.GetIRayTraceableRecursive((dynamic)total));
        }
예제 #2
0
        RayTracer.IRayTraceable MakerGearXCariage()
        {
#if false
            MatterHackers.Csg.ObjectCSG total = new MatterHackers.Csg.Box(30, 32, 65);
            MatterHackers.Csg.ObjectCSG minusBox = new MatterHackers.Csg.Box(20, 22, 55);
            minusBox = new MatterHackers.Csg.Translate(minusBox, 5, -5, 5);
            total -= minusBox;
#else
            //MatterHackers.Csg.ObjectCSG frontRodHolder = new MatterHackers.Csg.Cylinder(11, 70, name: "front rod holder");
            MatterHackers.Csg.CsgObject frontRodHolder = new MatterHackers.Csg.Box(22, 22, 70, createCentered: false, name: "front rod holder");
            frontRodHolder = new MatterHackers.Csg.SetCenter(frontRodHolder, Vector3.Zero);
            MatterHackers.Csg.CsgObject total = frontRodHolder;

#if true
            MatterHackers.Csg.CsgObject backRodHolder = new MatterHackers.Csg.Cylinder(11, 70, name: "back rod holder");
            backRodHolder = new MatterHackers.Csg.Translate(backRodHolder, 0, 50, 0);
            //total += backRodHolder;

            MatterHackers.Csg.CsgObject plate = new MatterHackers.Csg.Box(7, 32, 65, createCentered: false);
            plate = new MatterHackers.Csg.SetCenter(plate, total.GetCenter());
            plate = new MatterHackers.Csg.Align(plate, Csg.Face.Bottom, frontRodHolder, Csg.Face.Bottom);
            //total += plate;

            MatterHackers.Csg.CsgObject beltMount = new MatterHackers.Csg.Box(7, 32, 30, createCentered: false);
            beltMount = new MatterHackers.Csg.SetCenter(beltMount, frontRodHolder.GetCenter() + new Vector3(6, -19, 0));

            // belt mount screw holes
            MatterHackers.Csg.CsgObject screwHole = new MatterHackers.Csg.Cylinder(2, beltMount.YSize + 1, MatterHackers.Csg.Alignment.x);
            screwHole = new MatterHackers.Csg.SetCenter(screwHole, beltMount.GetCenter());
            //beltMount -= new MatterHackers.Csg.Align(screwHole, Face.Front | Face.Top, beltMount, Face.Front | Face.Top, 0, 3, -4);
            //beltMount -= new MatterHackers.Csg.Align(screwHole, Face.Front | Face.Top, beltMount, Face.Front | Face.Top, 0, 18, -4);
            //beltMount -= new MatterHackers.Csg.Align(screwHole, Face.Front | Face.Bottom, beltMount, Face.Front | Face.Bottom, 0, 3, 4);
            //beltMount -= new MatterHackers.Csg.Align(screwHole, Face.Front | Face.Bottom, beltMount, Face.Front | Face.Bottom, 0, 18, 4);

            total += beltMount;
#endif

            // smooth rod holes
            //total -= new MatterHackers.Csg.Cylinder(8, 70, name: "front rod bearing hole");
            //total -= new MatterHackers.Csg.Cylinder(8, 70, name: "front rod bearing hole");
            total -= new MatterHackers.Csg.SetCenter(new MatterHackers.Csg.Box(16, 16, 70, createCentered: false, name: "front rod hole"), Vector3.Zero);
            //total -= new MatterHackers.Csg.SetCenter(new MatterHackers.Csg.Cylinder(8, 70, name: "back rod bearing hole"), backRodHolder.GetCenter());
#endif

            total = MatterHackers.Csg.CsgObject.Flatten(total);
            MatterHackers.Csg.OpenSCadOutput.Save(total, "MakerGearXCariage.scad");

            CsgToRayTraceable visitor = new CsgToRayTraceable();

            return visitor.GetIRayTraceableRecursive((dynamic)total);
        }