mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-03 19:48:31 -05:00
Bumps [github.com/blevesearch/bleve/v2](https://github.com/blevesearch/bleve) from 2.5.0 to 2.5.1. - [Release notes](https://github.com/blevesearch/bleve/releases) - [Commits](https://github.com/blevesearch/bleve/compare/v2.5.0...v2.5.1) --- updated-dependencies: - dependency-name: github.com/blevesearch/bleve/v2 dependency-version: 2.5.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
36 lines
1.6 KiB
Go
36 lines
1.6 KiB
Go
// Copyright 2023 Google Inc. All rights reserved.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
package s2
|
|
|
|
const (
|
|
// maxEdgeDeviationRatio is set so that MaxEdgeDeviation will be large enough
|
|
// compared to snapRadius such that edge splitting is rare.
|
|
//
|
|
// Using spherical trigonometry, if the endpoints of an edge of length L
|
|
// move by at most a distance R, the center of the edge moves by at most
|
|
// asin(sin(R) / cos(L / 2)). Thus the (MaxEdgeDeviation / SnapRadius)
|
|
// ratio increases with both the snap radius R and the edge length L.
|
|
//
|
|
// We arbitrarily limit the edge deviation to be at most 10% more than the
|
|
// snap radius. With the maximum allowed snap radius of 70 degrees, this
|
|
// means that edges up to 30.6 degrees long are never split. For smaller
|
|
// snap radii, edges up to 49 degrees long are never split. (Edges of any
|
|
// length are not split unless their endpoints move far enough so that the
|
|
// actual edge deviation exceeds the limit; in practice, splitting is rare
|
|
// even with long edges.) Note that it is always possible to split edges
|
|
// when MaxEdgeDeviation is exceeded.
|
|
maxEdgeDeviationRatio = 1.1
|
|
)
|