public void Generate() { poly = JohnsonPoly.Polygon(sides); poly = poly.Loft(new OpParams(0.5f)); var gableSel = FaceSelections.Existing; for (int i = 0; i < Iterations; i++) { poly = poly.Gable(new OpParams(Bud1, Bud2, FaceSelections.Existing)); poly.ClearTags(); var newFaces = poly.GetFaceSelection(FaceSelections.New); poly.TagFaces("fork1", filter: x => x.index == newFaces.FirstOrDefault(), introvert: true); poly.TagFaces("fork2", filter: x => x.index == newFaces.LastOrDefault(), introvert: true); poly = poly.Loft(new OpParams(BranchLengthScale, BranchLength, FaceSelections.New)); // poly = poly.Loft(new OpParams((5f-i)/10f, (BranchLength-i)/BranchLengthScale, FaceSelections.New)); poly = poly.FaceSlide(new OpParams(amount1, direction1 * i, selectByTags: "fork1")); poly = poly.FaceSlide(new OpParams(amount2, direction2 * i, selectByTags: "fork2")); } // poly = poly.Transform(Position, Rotation, Scale); var mesh = PolyMeshBuilder.BuildMeshFromConwayPoly(poly, false, null, ColorMethod); GetComponent <MeshFilter>().mesh = mesh; }
public void Generate() { poly = JohnsonPoly.Polygon(4); poly = poly.Loft(new OpParams(0, height)); var loop = poly.GetFaceLoop(poly.Halfedges.First()); poly = poly.MultiSplitLoop(loop, divisions); // poly = poly.Transform(Position, Rotation, Scale); var mesh = PolyMeshBuilder.BuildMeshFromConwayPoly(poly, false, null, ColorMethod); GetComponent <MeshFilter>().mesh = mesh; }
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; }