mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-28 03:17:14 +01:00
19 lines
No EOL
317 B
JavaScript
19 lines
No EOL
317 B
JavaScript
import {TopoObject} from './topo-object'
|
|
|
|
export class Vertex extends TopoObject {
|
|
|
|
constructor(point) {
|
|
super();
|
|
this.point = point;
|
|
this.edges = new Set();
|
|
}
|
|
|
|
edgeFor(other) {
|
|
for (let e of this.edges) {
|
|
if (e.vertexB == other) {
|
|
return e;
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
} |