public static new List<FigSynthProblem> SubtractShape(Figure outerShape, List<Connection> conns, List<Point> points) { // Possible quadrilaterals. List<Quadrilateral> quads = null; if (outerShape is ConcavePolygon) quads = Quadrilateral.GetQuadrilateralsFromPoints(outerShape as ConcavePolygon, points); else quads = Quadrilateral.GetQuadrilateralsFromPoints(points); List<FigSynthProblem> composed = new List<FigSynthProblem>(); foreach (Quadrilateral quad in quads) { // Select only kites that don't match the outer shape. if (quad.VerifyKite() && !quad.HasSamePoints(outerShape as Polygon)) { Kite kite = new Kite(quad); SubtractionSynth subSynth = new SubtractionSynth(outerShape, kite); try { subSynth.SetOpenRegions(FigSynthProblem.AcquireOpenAtomicRegions(conns, kite.points, kite)); composed.Add(subSynth); } catch (Exception) { } } } return FigSynthProblem.RemoveSymmetric(composed); }
public static Figure ConstructDefaultShape(ShapeType type) { switch (type) { case ShapeType.TRIANGLE: return(Triangle.ConstructDefaultTriangle()); case ShapeType.ISOSCELES_TRIANGLE: return(IsoscelesTriangle.ConstructDefaultIsoscelesTriangle()); case ShapeType.RIGHT_TRIANGLE: return(RightTriangle.ConstructDefaultRightTriangle()); case ShapeType.EQUILATERAL_TRIANGLE: return(EquilateralTriangle.ConstructDefaultEquilateralTriangle()); case ShapeType.KITE: return(Kite.ConstructDefaultKite()); case ShapeType.QUADRILATERAL: return(Quadrilateral.ConstructDefaultQuadrilateral()); case ShapeType.TRAPEZOID: return(Trapezoid.ConstructDefaultTrapezoid()); case ShapeType.ISO_TRAPEZOID: return(IsoscelesTrapezoid.ConstructDefaultIsoscelesTrapezoid()); case ShapeType.PARALLELOGRAM: return(Parallelogram.ConstructDefaultParallelogram()); case ShapeType.RECTANGLE: return(Rectangle.ConstructDefaultRectangle()); case ShapeType.RHOMBUS: return(Rhombus.ConstructDefaultRhombus()); case ShapeType.SQUARE: return(Square.ConstructDefaultSquare()); case ShapeType.CIRCLE: return(Circle.ConstructDefaultCircle()); case ShapeType.SECTOR: return(Sector.ConstructDefaultSector()); } return(null); }
public new static List <FigSynthProblem> SubtractShape(Figure outerShape, List <Connection> conns, List <Point> points) { // Possible quadrilaterals. List <Quadrilateral> quads = null; if (outerShape is ConcavePolygon) { quads = Quadrilateral.GetQuadrilateralsFromPoints(outerShape as ConcavePolygon, points); } else { quads = Quadrilateral.GetQuadrilateralsFromPoints(points); } List <FigSynthProblem> composed = new List <FigSynthProblem>(); foreach (Quadrilateral quad in quads) { // Select only kites that don't match the outer shape. if (quad.VerifyKite() && !quad.HasSamePoints(outerShape as Polygon)) { Kite kite = new Kite(quad); SubtractionSynth subSynth = new SubtractionSynth(outerShape, kite); try { subSynth.SetOpenRegions(FigSynthProblem.AcquireOpenAtomicRegions(conns, kite.points, kite)); composed.Add(subSynth); } catch (Exception) { } } } return(FigSynthProblem.RemoveSymmetric(composed)); }
public override bool StructurallyEquals(Object obj) { Kite thatKite = obj as Kite; if (thatKite == null) { return(false); } //return base.StructurallyEquals(obj); return(base.HasSamePoints(obj as Quadrilateral)); }
private static List<EdgeAggregator> InstantiateToTheorem(Kite kite, GroundedClause original) { List<EdgeAggregator> newGrounded = new List<EdgeAggregator>(); // Instantiate this kite diagonals ONLY if the original figure has the diagonals drawn. if (kite.diagonalIntersection == null) return newGrounded; // Determine the CongruentSegments opposing sides and output that. Strengthened newPerpendicular = new Strengthened(kite.diagonalIntersection, new Perpendicular(kite.diagonalIntersection)); // For hypergraph List<GroundedClause> antecedent = new List<GroundedClause>(); antecedent.Add(original); newGrounded.Add(new EdgeAggregator(antecedent, newPerpendicular, annotation)); return newGrounded; }
private static List<EdgeAggregator> InstantiateFromKite(Kite kite, GroundedClause original) { List<EdgeAggregator> newGrounded = new List<EdgeAggregator>(); // // Determine the CongruentSegments opposing sides and output that. // GeometricCongruentSegments gcs1 = new GeometricCongruentSegments(kite.pairASegment1, kite.pairASegment2); GeometricCongruentSegments gcs2 = new GeometricCongruentSegments(kite.pairBSegment1, kite.pairBSegment2); // For hypergraph List<GroundedClause> antecedent = new List<GroundedClause>(); antecedent.Add(original); newGrounded.Add(new EdgeAggregator(antecedent, gcs1, annotation)); newGrounded.Add(new EdgeAggregator(antecedent, gcs2, annotation)); return newGrounded; }