private void addChain(Chain chain, S2Point x, S2Point y, S2Point z, double maxPerturbation, S2PolygonBuilder builder) { // Transform the given edge chain to the frame (x,y,z), perturb each vertex // up to the given distance, and add it to the builder. var vertices = new List <S2Point>(); getVertices(chain.str, x, y, z, maxPerturbation, vertices); if (chain.closed) { vertices.Add(vertices[0]); } for (var i = 1; i < vertices.Count; ++i) { builder.AddEdge(vertices[i - 1], vertices[i]); } }
private void addChain(Chain chain, S2Point x, S2Point y, S2Point z, double maxPerturbation, S2PolygonBuilder builder) { // Transform the given edge chain to the frame (x,y,z), perturb each vertex // up to the given distance, and add it to the builder. var vertices = new List<S2Point>(); getVertices(chain.str, x, y, z, maxPerturbation, vertices); if (chain.closed) { vertices.Add(vertices[0]); } for (var i = 1; i < vertices.Count; ++i) { builder.AddEdge(vertices[i - 1], vertices[i]); } }