fix complex junction island geometry
This commit is contained in:
1 parent
c3579074fd
commit
0c42eb46cd
19 files changed
+424
-44
No files matched your search
@@ -1,6 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert/strict');
|
||||
const clipping = require('polygon-clipping');
|
||||
const { buildPedestrianIsland, validateFacilityComposition } = require('../src/compile/junction-facility-composition');
|
||||
|
||||
const ring = [
|
||||
@@ -24,7 +25,6 @@ console.log('junction facility composition tests passed');
|
||||
// User's sketch: a horizontal crossing to the right, a vertical crossing down,
|
||||
// and the island in the upper-left quadrant, bounded by doubled short edges.
|
||||
const { buildIslandFromCrossingEdges } = require('../src/compile/junction-facility-composition');
|
||||
const clipping = require('polygon-clipping');
|
||||
const sketchIsland = buildIslandFromCrossingEdges([0, 0], [0, 6.8], [-6.8, 0]);
|
||||
assert.deepEqual(sketchIsland[0], sketchIsland.at(-1));
|
||||
assert.ok(sketchIsland.every(([x, y]) => x <= 0 && y >= 0));
|
||||
@@ -167,6 +167,7 @@ assert.equal(extendedContacts.status, 'solved');
|
||||
assert.ok(extendedContacts.legLengths.every((value) => value >= 9));
|
||||
|
||||
assert.equal(new Set(solvedContacts.greenRing.slice(0, -1).map((p) => p.join(','))).size, 6);
|
||||
assert.equal(clipping.difference([solvedContacts.greenRing], [solvedContacts.ring]).length, 0);
|
||||
|
||||
// Regression: the saved four-node, 21m cluster previously lost two islands.
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user