{"record":{"id":"537d6d3220e4b146","repo":"egametang/ET","slug":"rcbuildcontours-bad-outline-for-region-i-conto","errorCode":null,"errorMessage":"rcBuildContours: Bad outline for region {i}, contour simplification is likely too aggressive.","messagePattern":"rcBuildContours: Bad outline for region (.+?), contour simplification is likely too aggressive\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"warning","filePath":"Packages/cn.etetet.recast/Scripts/Core/Share/Recast/RecastContour.cs","lineNumber":953,"sourceCode":"                    }\n\n                    // Finally merge each regions holes into the outline.\n                    for (int i = 0; i < nregions; i++)\n                    {\n                        RcContourRegion reg = regions[i];\n                        if (reg.nholes == 0)\n                            continue;\n\n                        if (reg.outline != null)\n                        {\n                            MergeRegionHoles(ctx, reg);\n                        }\n                        else\n                        {\n                            // The region does not have an outline.\n                            // This can happen if the contour becaomes selfoverlapping because of\n                            // too aggressive simplification settings.\n                            throw new Exception(\"rcBuildContours: Bad outline for region \" + i\n                                                                                           + \", contour simplification is likely too aggressive.\");\n                        }\n                    }\n                }\n            }\n\n            return cset;\n        }\n    }\n}","sourceCodeStart":935,"sourceCodeEnd":963,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.recast/Scripts/Core/Share/Recast/RecastContour.cs#L935-L963","documentation":"Thrown in rcBuildContours when a region has holes (nholes > 0) but its outline is null. With no enclosing outline, holes cannot be merged. The comment in source explains this happens when contour simplification settings are too aggressive, causing a region's outline to become self-overlapping and disappear.","triggerScenarios":"High maxSimplificationError collapsing a region's outline while its holes survive; maxEdgeLength too large merging outline edges into degenerate paths; very small/thin regions.","commonSituations":"Tuning maxSimplificationError up for fewer vertices until outlines self-intersect; aggressive contour settings on intricate geometry.","solutions":["Lower maxSimplificationError to preserve outline fidelity.","Reduce maxEdgeLength so outline edges are not over-merged.","Raise minRegionArea to eliminate tiny hole-bearing regions.","Switch region partitioning strategy if the geometry persistently produces bad outlines."],"exampleFix":"// before\ncfg.maxSimplificationError = 2.5f;\ncfg.maxEdgeLength = 200;\n\n// after\ncfg.maxSimplificationError = 1.1f;\ncfg.maxEdgeLength = 20;","handlingStrategy":"validation","validationCode":"if (cfg.maxSimplificationError > 2.0f) Debug.LogWarning(\"Aggressive simplification may erase outlines leaving holes\");\nif (cfg.maxEdgeLength > 100) Debug.LogWarning(\"Large maxEdgeLength may collapse outlines\");","typeGuard":null,"tryCatchPattern":"try { var cset = RecastContour.BuildContours(ctx, chf, maxError, maxEdge, buildFlags); }\ncatch (Exception e) when (e.Message.Contains(\"Bad outline\"))\n{ /* lower maxSimplificationError / maxEdgeLength, retry */ }","preventionTips":["Keep maxSimplificationError modest (< 1.5) for complex geometry.","Limit maxEdgeLength to prevent outline collapse.","Raise minRegionArea to remove hole-bearing micro-regions.","Switch partitioning strategy if outlines persistently degrade."],"tags":["recast","contour","region","config","simplification"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}