| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 906cf73 commit b27bcf5
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,26 +41,27 @@ static void FindVertsOnCurve(List<SInter> *l, const SCurve *curve, SShell *sh) { | |||
| 41 | 41 | Vector amax, amin; | |
| 42 | 42 | curve->GetAxisAlignedBounding(&amax, &amin); | |
| 43 | 43 | ||
| 44 | - for(const auto &sc : sh->curve) { | ||
| 45 | - if(!sc.isExact) continue; | ||
| 46 | - | ||
| 47 | - Vector cmax, cmin; | ||
| 48 | - sc.GetAxisAlignedBounding(&cmax, &cmin); | ||
| 49 | - | ||
| 50 | - if(Vector::BoundingBoxesDisjoint(amax, amin, cmax, cmin)) { | ||
| 51 | - // They cannot possibly intersect, no curves to generate | ||
| 52 | - continue; | ||
| 53 | - } | ||
| 54 | - | ||
| 55 | - for(int i=0; i<2; i++) { | ||
| 56 | - Vector pt = sc.exact.ctrl[ i==0 ? 0 : sc.exact.deg ]; | ||
| 57 | - double t; | ||
| 58 | - curve->exact.ClosestPointTo(pt, &t, /*must converge=*/ false); | ||
| 59 | - double d = pt.Minus(curve->exact.PointAt(t)).Magnitude(); | ||
| 60 | - if((t>LENGTH_EPS) && (t<(1.0-LENGTH_EPS)) && (d < LENGTH_EPS)) { | ||
| 61 | - SInter inter; | ||
| 62 | - inter.p = pt; | ||
| 63 | - l->Add(&inter); | ||
| 44 | + // The vertices of the shell are the endpoints of its trims, not the | ||
| 45 | + // endpoints of its curves: an exact intersection curve may extend past | ||
| 46 | + // the real geometry on both sides (e.g. out to the padded bounds of a | ||
| 47 | + // surface that got enlarged by SShell::MergeCoincidentSurfaces()), and | ||
| 48 | + // splitting some other curve at such a phantom point--which is not a | ||
| 49 | + // vertex of the trims adjacent across that other curve--produces | ||
| 50 | + // T-junctions and naked edges in the triangulated shell (issue #1452). | ||
| 51 | + for(const SSurface &ss : sh->surface) { | ||
| 52 | + for(const STrimBy &stb : ss.trim) { | ||
| 53 | + for(int i = 0; i < 2; i++) { | ||
| 54 | + Vector pt = (i == 0) ? stb.start : stb.finish; | ||
| 55 | + if(pt.OutsideAndNotOn(amax, amin)) continue; | ||
| 56 | + | ||
| 57 | + double t; | ||
| 58 | + curve->exact.ClosestPointTo(pt, &t, /*mustConverge=*/false); | ||
| 59 | + double d = pt.Minus(curve->exact.PointAt(t)).Magnitude(); | ||
| 60 | + if((t > LENGTH_EPS) && (t < (1.0 - LENGTH_EPS)) && (d < LENGTH_EPS)) { | ||
| 61 | + SInter inter = {}; | ||
| 62 | + inter.p = pt; | ||
| 63 | + l->Add(&inter); | ||
| 64 | + } | ||
| 64 | 65 | } | |
| 65 | 66 | } | |
| 66 | 67 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -63,6 +63,7 @@ set(testsuite_SOURCES | |||
| 63 | 63 | request/line_segment/test.cpp | |
| 64 | 64 | request/ttf_text/test.cpp | |
| 65 | 65 | request/workplane/test.cpp | |
| 66 | + group/boolean_coplanar_union/test.cpp | ||
| 66 | 67 | group/boolean_knife_edge/test.cpp | |
| 67 | 68 | group/boolean_tangent_edge/test.cpp | |
| 68 | 69 | group/boolean_tangent_fillet/test.cpp | |
| Back | FazBrowse Home | New Git URL |
0 commit comments