MCPcopy Index your code
hub / github.com/microsoft/SandDance / ringEnd

Function ringEnd

docs/app/js/sanddance-app.js:132709–132732  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

132707 ring = [];
132708 }
132709 function ringEnd() {
132710 pointRing(ring[0][0], ring[0][1]);
132711 ringSink.lineEnd();
132712 var clean = ringSink.clean(), ringSegments = ringBuffer.result(), i, n = ringSegments.length, m, segment, point;
132713 ring.pop();
132714 polygon.push(ring);
132715 ring = null;
132716 if (!n) return;
132717 // No intersections.
132718 if (clean & 1) {
132719 segment = ringSegments[0];
132720 if ((m = segment.length - 1) > 0) {
132721 if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
132722 sink.lineStart();
132723 for(i = 0; i < m; ++i)sink.point((point = segment[i])[0], point[1]);
132724 sink.lineEnd();
132725 }
132726 return;
132727 }
132728 // Rejoin connected segments.
132729 // TODO reuse ringBuffer.rejoin()?
132730 if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
132731 segments.push(ringSegments.filter(validSegment));
132732 }
132733 return clip;
132734 };
132735};

Callers

nothing calls this directly

Calls 4

pointRingFunction · 0.70
resampleLineToFunction · 0.70
lineEndFunction · 0.70
filterMethod · 0.45

Tested by

no test coverage detected