public override bool Prepare(Vector3I[] marks) { a = marks[0]; c = marks[1]; b = marks[2]; d = new Vector3I(a.X + c.X - b.X, a.Y + c.Y - b.Y, a.Z + c.Z - b.Z); Bounds = new BoundingBox( Math.Min(Math.Min(a.X, b.X), Math.Min(c.X, d.X)), Math.Min(Math.Min(a.Y, b.Y), Math.Min(c.Y, d.Y)), Math.Min(Math.Min(a.Z, b.Z), Math.Min(c.Z, d.Z)), Math.Max(Math.Max(a.X, b.X), Math.Max(c.X, d.X)), Math.Max(Math.Max(a.Y, b.Y), Math.Max(c.Y, d.Y)), Math.Max(Math.Max(a.Z, b.Z), Math.Max(c.Z, d.Z)) ); Coords = Bounds.MinVertex; if (!base.Prepare(marks)) return false; normal = (b - a).Cross(c - a); normalF = normal.Normalize(); BlocksTotalEstimate = GetBlockTotalEstimate(); s1 = normal.Cross(a - b).Normalize(); s2 = normal.Cross(b - c).Normalize(); s3 = normal.Cross(c - d).Normalize(); s4 = normal.Cross(d - a).Normalize(); return true; }
public override bool Prepare(Vector3I[] marks) { a = marks[0]; c = marks[1]; b = marks[2]; d = new Vector3I(a.X + c.X - b.X, a.Y + c.Y - b.Y, a.Z + c.Z - b.Z); Bounds = new BoundingBox( Math.Min(Math.Min(a.X, b.X), Math.Min(c.X, d.X)), Math.Min(Math.Min(a.Y, b.Y), Math.Min(c.Y, d.Y)), Math.Min(Math.Min(a.Z, b.Z), Math.Min(c.Z, d.Z)), Math.Max(Math.Max(a.X, b.X), Math.Max(c.X, d.X)), Math.Max(Math.Max(a.Y, b.Y), Math.Max(c.Y, d.Y)), Math.Max(Math.Max(a.Z, b.Z), Math.Max(c.Z, d.Z)) ); Coords = Bounds.MinVertex; if (!base.Prepare(marks)) { return(false); } normal = (b - a).Cross(c - a); normalF = normal.Normalize(); BlocksTotalEstimate = GetBlockTotalEstimate(); s1 = normal.Cross(a - b).Normalize(); s2 = normal.Cross(b - c).Normalize(); s3 = normal.Cross(c - d).Normalize(); s4 = normal.Cross(d - a).Normalize(); return(true); }
public override bool Prepare(Vector3I[] marks) { a = marks[0]; b = marks[1]; c = marks[2]; if (a == b || b == c || c == a) { if (a != c) b = c; isLine = true; } Bounds = new BoundingBox( Math.Min(Math.Min(a.X, b.X), c.X), Math.Min(Math.Min(a.Y, b.Y), c.Y), Math.Min(Math.Min(a.Z, b.Z), c.Z), Math.Max(Math.Max(a.X, b.X), c.X), Math.Max(Math.Max(a.Y, b.Y), c.Y), Math.Max(Math.Max(a.Z, b.Z), c.Z) ); Coords = Bounds.MinVertex; if (!base.Prepare(marks)) return false; normal = (b - a).Cross(c - a); normalF = normal.Normalize(); BlocksTotalEstimate = GetBlockTotalEstimate(); s1 = normal.Cross(a - b).Normalize(); s2 = normal.Cross(b - c).Normalize(); s3 = normal.Cross(c - a).Normalize(); return true; }
public override bool Prepare(Vector3I[] marks) { a = marks[0]; b = marks[1]; c = marks[2]; if (a == b || b == c || c == a) { if (a != c) { b = c; } isLine = true; } Bounds = new BoundingBox( Math.Min(Math.Min(a.X, b.X), c.X), Math.Min(Math.Min(a.Y, b.Y), c.Y), Math.Min(Math.Min(a.Z, b.Z), c.Z), Math.Max(Math.Max(a.X, b.X), c.X), Math.Max(Math.Max(a.Y, b.Y), c.Y), Math.Max(Math.Max(a.Z, b.Z), c.Z) ); Coords = Bounds.MinVertex; if (!base.Prepare(marks)) { return(false); } normal = (b - a).Cross(c - a); normalF = normal.Normalize(); BlocksTotalEstimate = GetBlockTotalEstimate(); s1 = normal.Cross(a - b).Normalize(); s2 = normal.Cross(b - c).Normalize(); s3 = normal.Cross(c - a).Normalize(); return(true); }