fix collect wires bug

This commit is contained in:
Val Erastov 2015-11-06 12:34:21 -08:00
parent a3fa22de62
commit 5eee8db233
2 changed files with 4 additions and 3 deletions

View file

@ -686,7 +686,7 @@ TCAD.Solid.prototype.collectWires = function(face) {
}
return false;
}
var paths = TCAD.craft.reconstructSketchBounds(this.csg, face);
var paths = TCAD.craft.reconstructSketchBounds(this.csg, face, true);
for (var i = 0; i < paths.length; i++) {
var path = paths[i];
var p, q, n = path.vertices.length;

View file

@ -186,7 +186,8 @@ TCAD.craft.polygonsToSegments = function(polygons) {
return segmentsByPolygon;
};
TCAD.craft.reconstructSketchBounds = function(csg, face) {
TCAD.craft.reconstructSketchBounds = function(csg, face, strict) {
strict = strict || false;
var polygons = csg.toPolygons();
var plane = face.csgGroup.plane;
var outerEdges = [];
@ -194,7 +195,7 @@ TCAD.craft.reconstructSketchBounds = function(csg, face) {
for (var pi = 0; pi < polygons.length; pi++) {
var poly = polygons[pi];
if (TCAD.utils.equal(poly.plane.normal.dot(plane.normal), 1)) {
if (TCAD.utils.equal(plane.w, poly.plane.w)) {
if (TCAD.utils.equal(plane.w, poly.plane.w) && (!strict || !!poly.shared.__tcad && poly.shared.__tcad.faceId === face.id)) {
planePolygons.push(poly);
}
continue;