Ejemplo n.º 1
0
    public SliceFeature(Mesh input)
    {
        MeshCheck meshCheck = new MeshCheck();

        meshCheck.setMesh(input);
        DMesh3 mesh = meshCheck.ToUnityWatertightMesh().ToDMesh3();

        if (!mesh.IsClosed())
        {
            return;
        }
        // center mesh above origin
        AxisAlignedBox3d bounds       = mesh.CachedBounds;
        Vector3d         baseCenterPt = bounds.Center - bounds.Extents.z * Vector3d.AxisZ;

        MeshTransforms.Translate(mesh, -baseCenterPt);

        // create print mesh set
        meshes = new PrintMeshAssembly();
        meshes.AddMesh(mesh, PrintMeshOptions.Default());

        // create settings
        //MakerbotSettings settings = new MakerbotSettings(Makerbot.Models.Replicator2);
        //PrintrbotSettings settings = new PrintrbotSettings(Printrbot.Models.Plus);
        //MonopriceSettings settings = new MonopriceSettings(Monoprice.Models.MP_Select_Mini_V2);
        settings = new RepRapSettings(RepRap.Models.Unknown);
    }