public ProductShape2(IExplicitShape <GridPoint2> shape1, IImplicitShape <GridPoint2> shape2, GridPoint2 scaleFactor) { var translationShapes = shape1.Points .Select(point => shape2.Translate(point.Mul(scaleFactor))); unionShape = new UnionShape <GridPoint2>(translationShapes); }
public ExclusiveOrShape(Shape2D first, Shape2D second) { First = first; Second = second; Union = new UnionShape(first, second); Overlap = new IntersectionShape(first, second); }
public PlaneCityShape() { UnionShape buildingShape = new UnionShape(); buildingShape.children.Add(new BoxShape(new Vector3(4, 50, 4))); UnionShape compositeShape = new UnionShape(); compositeShape.children.Add(new RotateShape(new RepeatShape(buildingShape, new Vector3(10, 0, 10)), Quaternion.Euler(0, 30, 0))); rootShape = compositeShape; }
public ProductShape1(IExplicitShape <int> shape1, IImplicitShape <int> shape2, int scaleFactor) { var translationShapes = shape1.Points.Select(point => shape2.Translate(point * scaleFactor)); unionShape = new UnionShape <int>(translationShapes); }