mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-16 05:23:19 +01:00
fix collect wires bug
This commit is contained in:
parent
a3fa22de62
commit
5eee8db233
2 changed files with 4 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue