public override void GenerateNetPo() { float L, li, d, sof, distance1, distance2; //sof是初始偏差值 PO tmp, po; PAINT.GetLL(l0); util u1 = new util(); show_edge_l(); L = l0.Length(); sof = (float)((L - System.Math.Floor(L / dx) * dx) / 2); for (int i = 1; i <= System.Math.Floor(L / dx) - 1; i++) { li = (float)(sof + i * dx); tmp = new PO(); tmp.x = (l0.p1.x * (L - li) + l0.p2.x * li) / L; tmp.y = (l0.p1.y * (L - li) + l0.p2.y * li) / L; distance1 = Cal_distance_po_edge(tmp, u1.po_vertical(tmp, l0.p1, l0.p2, dy)); distance2 = Cal_distance_po_edge(tmp, u1.po_vertical(tmp, l0.p2, l0.p1, dy)); if (distance1 > distance2) { distance1 = distance2; } po = u1.po_vertical(tmp, l0.p1, l0.p2, distance1 * 1 / 2); ge_p_l.Insert(po); PAINT.GetPL(po); po = u1.po_vertical(tmp, l0.p2, l0.p1, distance1 * 1 / 2); ge_p_l.Insert(po); PAINT.GetPL(po); } }
public override void GenerateNetPo() { util u1 = new util(); show_edge_l(); float yita, rx; int ix, id, isita; PO ptmp, pc; PO pk; pc = new PO(); pc.x = (l0.p1.x + l0.p2.x) / 2; pc.y = (l0.p1.y + l0.p2.y) / 2; yita = (float)System.Math.Pow(ro / ri, 1.0 / (nr - 1)); for (id = 0; id <= nd - 1; id++) { ptmp = new PO(); ptmp.x = ((nd - 1 - id) * l0.p1.x + id * l0.p2.x) / (nd - 1); ptmp.y = ((nd - 1 - id) * l0.p1.y + id * l0.p2.y) / (nd - 1); ge_p_l.Insert(ptmp); PAINT.GetPL(ptmp); } for (ix = 0; ix < nr; ix++) { rx = (float)(ri * System.Math.Pow(yita, ix)); for (id = 1; id < nd - 1; id++) { ptmp = new PO(); ptmp.x = ((nd - 1 - id) * l0.p1.x + id * l0.p2.x) / (nd - 1); ptmp.y = ((nd - 1 - id) * l0.p1.y + id * l0.p2.y) / (nd - 1); pk = u1.po_vertical(ptmp, l0.p1, l0.p2, rx); ge_p_l.Insert(pk); PAINT.GetPL(pk); pk = u1.po_vertical(ptmp, l0.p2, l0.p1, rx); ge_p_l.Insert(pk); PAINT.GetPL(pk); } for (isita = 0; isita <= nsta / 2; isita++) { ptmp = new PO(); ptmp.x = (float)(l0.p1.x + rx * System.Math.Cos(2 * 3.1415926 * isita / nsta + u1.CalAgl(l0.p1, l0.p2) + 3.1415926 / 2)); ptmp.y = (float)(l0.p1.y + rx * System.Math.Sin(2 * 3.1415926 * isita / nsta + u1.CalAgl(l0.p1, l0.p2) + 3.1415926 / 2)); ge_p_l.Insert(ptmp); PAINT.GetPL(ptmp); } for (isita = 0; isita <= nsta / 2; isita++) { ptmp = new PO(); ptmp.x = (float)(l0.p2.x + rx * System.Math.Cos(2 * 3.1415926 * isita / nsta + u1.CalAgl(l0.p1, l0.p2) + 3.1415926 * 1.5f)); ptmp.y = (float)(l0.p2.y + rx * System.Math.Sin(2 * 3.1415926 * isita / nsta + u1.CalAgl(l0.p1, l0.p2) + 3.1415926 * 1.5f)); ge_p_l.Insert(ptmp); PAINT.GetPL(ptmp); } } }
//处理两个直井之间的冲突 private void CD_well_well(well2d w1, well2d w2) { util u1 = new util(); PO mid, p1, p2; mid = new PO(); mid.x = (w1.center.x * w1.ro + w2.center.x * w2.ro) / (w1.ro + w2.ro); mid.y = (w1.center.y * w1.ro + w2.center.y * w2.ro) / (w1.ro + w2.ro); p1 = u1.po_vertical(mid, w1.center, w2.center, 5); p2 = u1.po_vertical(mid, w2.center, w1.center, 5); u1.InFile(u1.tri_num, "-------------------IN well"); Cal_new_edge_po_insert(w1, p1, p2); u1.InFile(u1.tri_num, "-------------------end well1"); Cal_new_edge_po_insert(w2, p1, p2); u1.InFile(u1.tri_num, "-------------------end well"); }
public override void Generate_eadge() { PO us, ds, ud, dd; util u1 = new util(); center.x = (l0.p1.x + l0.p2.x) / 2; center.y = (l0.p1.y + l0.p2.y) / 2; center.z = 0.0f; edge_pl.Clear(); us = u1.po_vertical(l0.p1, l0.p1, l0.p2, 2.0f * dy); ds = u1.po_vertical(l0.p1, l0.p2, l0.p1, 2.0f * dy); ud = u1.po_vertical(l0.p2, l0.p1, l0.p2, 2.0f * dy); dd = u1.po_vertical(l0.p2, l0.p2, l0.p1, 2.0f * dy); edge_pl.Insert(us); edge_pl.Insert(ud); edge_pl.Insert(dd); edge_pl.Insert(ds); }