mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-10 02:13:58 +01:00
use data of topo-object for half edges
This commit is contained in:
parent
a52c57ea4b
commit
1654fa8e9c
2 changed files with 9 additions and 8 deletions
|
|
@ -902,25 +902,25 @@ function EdgeSolveData() {
|
|||
EdgeSolveData.EMPTY = new EdgeSolveData();
|
||||
|
||||
EdgeSolveData.get = function(edge) {
|
||||
if (!edge.__edgeSolveData) {
|
||||
if (!edge.data[MY]) {
|
||||
return EdgeSolveData.EMPTY;
|
||||
}
|
||||
return edge.__edgeSolveData;
|
||||
return edge.data[MY];
|
||||
};
|
||||
|
||||
EdgeSolveData.createIfEmpty = function(edge) {
|
||||
if (!edge.__edgeSolveData) {
|
||||
edge.__edgeSolveData = new EdgeSolveData();
|
||||
if (!edge.data[MY]) {
|
||||
edge.data[MY] = new EdgeSolveData();
|
||||
}
|
||||
return edge.__edgeSolveData;
|
||||
return edge.data[MY];
|
||||
};
|
||||
|
||||
EdgeSolveData.clear = function(edge) {
|
||||
delete edge.__edgeSolveData;
|
||||
delete edge.data[MY];
|
||||
};
|
||||
|
||||
EdgeSolveData.transfer = function(from, to) {
|
||||
to.__edgeSolveData = from.__edgeSolveData;
|
||||
to.data[MY] = from.data[MY];
|
||||
};
|
||||
|
||||
function Node(vertex, normal, splitsEdge, splittingFace) {
|
||||
|
|
|
|||
|
|
@ -10,9 +10,10 @@ export class Edge extends TopoObject {
|
|||
}
|
||||
}
|
||||
|
||||
export class HalfEdge {
|
||||
export class HalfEdge extends TopoObject {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.edge = null;
|
||||
this.vertexA = null;
|
||||
this.vertexB = null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue