示例#1
0
    public void Generate()
    {
        poly = JohnsonPoly.Polygon(sides);
        poly = poly.Loft(new OpParams(0.5f));

        for (int i = 0; i < 3; i++)
        {
            poly = poly.SplitFaces(new OpParams(FaceSelections.Existing));

            poly.ClearTags();
            poly.TagFaces("split1", FaceSelections.New, introvert: true);
            poly.TagFaces("split2", FaceSelections.New, introvert: true);

            poly = poly.Loft(new OpParams(0.01f, 1f, FaceSelections.AllNew));
            poly = poly.FaceSlide(new OpParams(amount1, direction1 * i, selectByTags: "split1"));
            poly = poly.FaceSlide(new OpParams(amount2, direction2 * i, selectByTags: "split2"));
        }

        poly = poly.Transform(Position, Rotation, Scale);
        var mesh = PolyMeshBuilder.BuildMeshFromConwayPoly(poly, false, null, ColorMethod);

        GetComponent <MeshFilter>().mesh = mesh;
    }