public SharedLine(Point3D point1, Point3D point2, Vector3D normal1, Vector3D normal2) : this() { Point1 = point1; Point2 = point2; Normal1 = normal1; Normal2 = normal2; }
void InsertIntoCollection(List<SharedLine> sharedLines, Point3D pt1, Point3D pt2, Vector3D normal) { bool foundMatch = false; for (int i = 0; i < sharedLines.Count; i++) { if ((sharedLines[i].Point1 == pt1 && sharedLines[i].Point2 == pt2) || (sharedLines[i].Point1 == pt2 && sharedLines[i].Point2 == pt1)) { SharedLine sharedLine = sharedLines[i]; sharedLine.Normal2 = normal; sharedLines[i] = sharedLine; foundMatch = true; break; } } if (!foundMatch) { SharedLine sharedLine = new SharedLine(pt1, pt2, normal, new Vector3D()); sharedLines.Add(sharedLine); } }
public static Vector3D CrossProduct(Vector3D v1, Vector3D v2) { return new Vector3D(v1.Y * v2.Z - v1.Z * v2.Y, v1.Z * v2.X - v1.X * v2.Z, v1.X * v2.Y - v1.Y * v2.X); }