public edge_store find_intial_baseLR(List <point_store> left, List <point_store> right) { point_store left_end = left[left.Count - 1]; // left end // Colinear error fixed point_store right_end = right[0]; // right end edge_store left_bot_edge = left_end.cw_vertical_edge(0); // First Vertical edge at clock wise direction at this point edge_store right_bot_edge = right_end.cc_vertical_edge(0); // First Vertical edge at counter clock wise direction at this point while (true) { // Select the bottom most end by comparing the orientation with the other if (leftof(right_end, left_bot_edge) == true) // check the right_end point and orientation of the left edge { left_end = left_bot_edge.the_other_pt(left_end); // Find the next point (whihc is the endpoint of the left edge) left_bot_edge = left_end.cw_vertical_edge(0); } else if (rightof(left_end, right_bot_edge) == true) // check the left_end point and orientation of the right edge { right_end = right_bot_edge.the_other_pt(right_end); // Find the next point (which is the endpoint of the right edge) right_bot_edge = right_end.cc_vertical_edge(0); } else { break; } } add_edge(left_end, right_end); // Add the base LR edge return(edge_list[edge_list.Count - 1]); // return the last add item (which is the baseLR edge) }
private edge_store get_edge_away_from_this_pt(edge_store the_edge) { // This function returns the edge oriented from this point point_store this_pt = new point_store(this._pt_id, this._x, this._y, this.store_parent_data); if (the_edge.start_pt.Equals(this_pt) == false) { return(new edge_store(the_edge.edge_id, this_pt, the_edge.the_other_pt(this_pt))); } else { return(the_edge); } }