LFTree evaluateNnary(LibFive_Operation op, params LFTree[] trees) { if (trees.Length > 0 && trees[0] != null) { if (trees.Length == 1) { return(trees[0]); } if (op == LibFive_Operation.Union) { return(LFMath.Union(trees)); } else if (op == LibFive_Operation.Intersection) { return(LFMath.Intersection(trees)); } else if (op == LibFive_Operation.Difference) { return(LFMath.Difference(trees)); } else if (op == LibFive_Operation.Blend) { return(LFMath.Blend(0.1f, trees)); } } return(tree); }
LFTree evaluateNonary(LibFive_Operation op) { if (op == LibFive_Operation.Circle) { return(LFMath.Circle(0.5f)); } else if (op == LibFive_Operation.Sphere) { return(LFMath.Sphere(0.5f)); } else if (op == LibFive_Operation.Box) { return(LFMath.Box(-Vector3.one * 0.5f, Vector3.one * 0.5f)); } else if (op == LibFive_Operation.Cylinder) { return(LFMath.Cylinder(0.5f, 1f, Vector3.back * 0.5f)); } return(tree); }
LFTree evaluateUnary(LibFive_Operation op, LFTree tree) { if (tree != null) { if (op == LibFive_Operation.Transform) { return(tree); } else if (op == LibFive_Operation.Inverse) { return(-tree); } else if (op == LibFive_Operation.Mirror) { return(LFMath.SymmetricX(tree)); } else if (op == LibFive_Operation.Shell) { return(LFMath.Shell(tree, 0.025f)); } } return(this.tree); }