Skip to content

Commit

Permalink
Disable breaking all for now
Browse files Browse the repository at this point in the history
  • Loading branch information
MuTsunTsai committed Oct 7, 2023
1 parent a83dff7 commit cccf6c0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/core/design/tasks/combine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ function toRationalContour(contour: RoughContour): RationalContour {
*/
function toGraphicalContour(contour: RationalContour): Contour {
const outers = contour.$outer.map(simplify);
let outer = outers.length == 1 ? outers[0] : generalUnion.$get(outers)[0];
let outer = outers.length <= 1 ? outers[0] : generalUnion.$get(outers)[0];
const inner = contour.$inner?.map(simplify);
if(!outer.length) {
if(!outer || !outer.length) {
return { outer: inner![0] };
} else if(outer.isHole && inner) {
const innerHoleIndex = inner.findIndex(p => p.isHole);
Expand Down
21 changes: 11 additions & 10 deletions src/core/design/tasks/roughContourContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,17 @@ export class RoughContourContext {

const result = groups.flatMap(g => {
const contours = expand(g.$children, this.$node.$length);
const sets = g.$nodeSets;
if(sets) {
// Now we check again to see if the missing corners are exposed.
// In some edge cases, it is possible that some are still missing at this point.
const corners = [...this._cornerMap.entries()].filter(e => sets.includes(e[1])).map(e => e[0]);
const testMap = new Set(corners);
if(!checkCriticalCorners(contours.flatMap(c => c.$outer), testMap)) {
for(const contour of contours) this._breakAllContour(contour);
}
}
//TODO: This part needs more thoughts
// const sets = g.$nodeSets;
// if(sets) {
// // Now we check again to see if the missing corners are exposed.
// // In some edge cases, it is possible that some are still missing at this point.
// const corners = [...this._cornerMap.entries()].filter(e => sets.includes(e[1])).map(e => e[0]);
// const testMap = new Set(corners);
// if(!checkCriticalCorners(contours.flatMap(c => c.$outer), testMap)) {
// for(const contour of contours) this._breakAllContour(contour);
// }
// }
return contours;
});
return result;
Expand Down

0 comments on commit cccf6c0

Please sign in to comment.