【发布时间】:2021-11-05 23:47:54
【问题描述】:
我正在做一个计算几何问题,它使用 C# 库中的 TriangularMeshQuadtree,它的一些构造函数编写如下(来自元数据,所以我看不到实现的细节):
构造函数 1:
// Summary:
// Constructor to use if you are going to store the objects in x/y space, and there
// is a smallest node size because you don't want the nodes to be smaller than a
// group of pixels.
//
// Parameters:
// xMax:
// eastern border of node coverage.
//
// xMin:
// western border of node coverage.
//
// yMax:
// northern border of node coverage.
//
// yMin:
// southern border of node coverage.
//
// maxItems:
// number of items to hold in a node before splitting itself into four branch and
// redispensing the items into them.
public TriangularMeshQuadtree(double xMax, double xMin, double yMax, double yMin, int maxItems);
构造函数 2:
//
// Summary:
// Gets quad tree of a list of triangular surface in the plane with normal of dir
//
// Parameters:
// surfaces:
// A list of triangular surface
//
// dir:
// The normal of plane on which quad tree is projected
//
// maxItemNumber:
// The maximum number of items in each node of quad tree
//
// transformator:
// Coordinate transformator
//
// Returns:
// A quad tree
public static TriangularMeshQuadtree GetQuadTree(List<SubTSurf> surfaces, Vector3 dir, int maxItemNumber, out CoordinateTransformator transformator);
我对四叉树的理解是,它将一组点递归地划分为 4 个部分,直到每个点在一个部分中都是唯一的。我不明白上述代码中 maxItem 的定义以及它如何与四叉树一起使用。
【问题讨论】:
标签: quadtree