// // Given a set of points, can we construct any shape? // If we can construct a shape, we then have a resultant mess... // public static List <FigSynthProblem> SubtractShape(Figure outerShape, ShapeType type) { List <FigSynthProblem> problems = new List <FigSynthProblem>(); List <Connection> conns = new List <Connection>(); List <Point> points = new List <Point>(); try { conns = outerShape.MakeAtomicConnections(); points = outerShape.allComposingPoints; } catch (Exception) { return(problems); } switch (type) { case ShapeType.TRIANGLE: problems = Triangle.SubtractShape(outerShape, conns, points); break; case ShapeType.ISOSCELES_TRIANGLE: problems = IsoscelesTriangle.SubtractShape(outerShape, conns, points); break; case ShapeType.RIGHT_TRIANGLE: problems = RightTriangle.SubtractShape(outerShape, conns, points); break; //case ShapeType.ISO_RIGHT_TRIANGLE: // problems = Triangle.SubtractShape(outerShape, conns, points); case ShapeType.EQUILATERAL_TRIANGLE: problems = EquilateralTriangle.SubtractShape(outerShape, conns, points); break; case ShapeType.KITE: problems = Kite.SubtractShape(outerShape, conns, points); break; case ShapeType.QUADRILATERAL: problems = Quadrilateral.SubtractShape(outerShape, conns, points); break; case ShapeType.TRAPEZOID: problems = Trapezoid.SubtractShape(outerShape, conns, points); break; case ShapeType.ISO_TRAPEZOID: problems = IsoscelesTrapezoid.SubtractShape(outerShape, conns, points); break; case ShapeType.PARALLELOGRAM: problems = Parallelogram.SubtractShape(outerShape, conns, points); break; case ShapeType.RECTANGLE: problems = Rectangle.SubtractShape(outerShape, conns, points); break; case ShapeType.RHOMBUS: problems = Rhombus.SubtractShape(outerShape, conns, points); break; case ShapeType.SQUARE: problems = Square.SubtractShape(outerShape, conns, points); break; case ShapeType.CIRCLE: problems = Circle.SubtractShape(outerShape, conns, points); break; case ShapeType.SECTOR: problems = Sector.SubtractShape(outerShape, conns, points); break; } return(problems); }