private void pMinimum(GeoLibPoint p) { for (int x = 0; x < 2; x++) { for (int y = 0; y < 2; y++) { GeoLibPoint pos3 = point; pos3.Offset(new GeoLibPoint(pitch.X * x * (count_x - 1), pitch.Y * y * (count_y - 1))); GeoLibPoint pos1 = new(p.X - pos3.X, p.Y - pos3.Y); pos1.Y = trans.mirror_x switch { true => -pos1.Y, _ => pos1.Y }; GeoLibPoint pos2 = pos1; cell_ref.maximum(pos1); cell_ref.minimum(pos2); switch (trans.mirror_x) { case true: pos1.Y = -pos1.Y; pos2.Y = -pos2.Y; break; } pos1.Offset(pos3); pos2.Offset(pos3); p.X = Math.Min(p.X, pos2.X); p.X = Math.Min(p.X, pos1.X); p.Y = Math.Min(p.Y, pos2.Y); p.Y = Math.Min(p.Y, pos1.Y); } } }
private void pMinimum(GeoLibPoint p) { GeoLibPoint pos1 = new(p.X - point.X, p.Y - point.Y); pos1.Y = trans.mirror_x switch { true => -pos1.Y, _ => pos1.Y }; switch (Math.Abs(trans.angle - 180)) { case <= double.Epsilon: pos1.Y = -pos1.Y; pos1.X = -pos1.X; break; } GeoLibPoint pos2 = pos1; cell_ref.maximum(pos1); cell_ref.minimum(pos2); switch (trans.mirror_x) { case true: pos1.Y = -pos1.Y; pos2.Y = -pos2.Y; break; } switch (Math.Abs(trans.angle - 180)) { case <= double.Epsilon: pos1.Y = -pos1.Y; pos1.X = -pos1.X; break; } switch (Math.Abs(trans.angle - 180)) { case <= double.Epsilon: pos2.Y = -pos2.Y; pos2.X = -pos2.X; break; } pos1.Offset(point); pos2.Offset(point); p.X = Math.Min(p.X, pos2.X); p.X = Math.Min(p.X, pos1.X); p.Y = Math.Min(p.Y, pos2.Y); p.Y = Math.Min(p.Y, pos1.Y); }
private void pMove(GeoLibPoint p) { point.Offset(p); }