Skip to content

Commit

Permalink
Correctly handle the case where the vertex corresponding to an edge l…
Browse files Browse the repository at this point in the history
…ying on the decoration border is given.

See #49
  • Loading branch information
nvcleemp committed Feb 26, 2018
1 parent ff37715 commit cd177c3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cage/decoration/embedder/SingleChamberDecorationEmbedder.java
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,16 @@ public SingleChamberDecorationEmbedder initialise(){
}
Neighbour[][] neighbours = new Neighbour[realVertices.size()][];
for (int i = 0; i < neighbours.length; i++) {
final int iFinal = i;
neighbours[i] = decoration.getNeighboursAsStream(realVertices.get(i))
final int iFinal = i;
final DecorationVertex source = realVertices.get(i);
neighbours[i] = decoration.getNeighboursAsStream(source)
.filter(v -> !FacetType.FACE.equals(v.getType()))
.map(v -> {
if(FacetType.VERTEX.equals(v.getType())){
return new Neighbour(original2new[v.getId()], null);
} else if(v.getPosition().isEdge() && FacetType.EDGE.equals(v.getType()) && (source.getPosition().equals(v.getPosition()) || v.getPosition().isAdjacentCorner(source.getPosition()))) {
DecorationVertex target = decoration.getNeighboursAsStream(v).filter(u -> FacetType.VERTEX.equals(u.getType()) && !u.equals(source)).findAny().get();
return new Neighbour(original2new[target.getId()], null);
} else {
return new Neighbour(
iFinal,
Expand Down

0 comments on commit cd177c3

Please sign in to comment.