function pointRayCrossesSegments( point, segments ) {

	let crossings = 0;
	const firstSeg = segments[ segments.length - 1 ];
	let prevSegmentGoesDown = firstSeg.start.y > firstSeg.end.y;
	for ( let s = 0, l = segments.length; s < l; s ++ ) {

		const line = segments[ s ];
		const thisSegmentGoesDown = line.start.y > line.end.y;
		if (
			pointRayCrossesLine( point, line, prevSegmentGoesDown, thisSegmentGoesDown )
		) {

			crossings ++;

		}

		prevSegmentGoesDown = thisSegmentGoesDown;

	}

	return crossings;

}
Count how many times a ray cast from the given point crosses the segments.
@param {THREE.Vector3} point
@param {Array<THREE.Line3>} segments
@returns {number}