1
0
Fork 0
freesewing/markdown/dev/reference/api/point/sitson/en.md
2021-11-07 13:34:23 +01:00

1,014 B

title
Point.sitsOn()

Returns true if this point has the exact same coordinates as the point you pass to it.

Too exact?

This method is very precise, so points with an X-coordinate of 10 and 10.0001 are considered to be different.

To check if two points have the same coordinates rounded to the nearest millimeter, use Point.sitsRoughlyOn() instead.

Point.sitsOn() signature

bool point.sitsOn(Point check)

Point.sitsOn() example

let { Point, points, Snippet, snippets } = part.shorthand();

let s;
for (let i = 0; i < 10; i++) {
  points[`a${i}`] = new Point(i * 10, 40);
  points[`b${i}`] = new Point(i * 10, i * 8);
  if (points[`a${i}`].sitsOn(points[`b${i}`])) s = "notch";
  else s = "bnotch";
  snippets[`b${i}`] = new Snippet(s, points[`b${i}`]);
  snippets[`a${i}`] = new Snippet(s, points[`a${i}`]);
}