pytower.mesh

class pytower.mesh.OctreeBVH(centroid, size)[source]
Parameters:
__init__(centroid, size)[source]
Parameters:
add_point(p)[source]
Parameters:

p (XYZ)

class pytower.mesh.OctreeNode(centroid, size, point)[source]

Axis-aligned octree node implementation

Parameters:
__init__(centroid, size, point)[source]
Parameters:
contains(point)[source]
Return type:

bool

Parameters:

point (XYZ)

traverse(point)[source]
Return type:

Optional[OctreeNode]

Parameters:

point (XYZ)

pytower.mesh.convert_triangle(face)[source]

Given a triangular face, convert the face into one or two canvas wedges

Parameters:

face (ndarray) – List of triangle face’s vertices

Return type:

list[TowerObject]

Returns:

List of TowerObject corresponding to the new canvas wedges

pytower.mesh.divide_triangle(face)[source]

Given a triangular face as input, divide it into two right triangles using the altitude

Parameters:

face (ndarray) – List of triangle face’s vertices

Return type:

ndarray | None

Returns:

Triangle subdivided into two right triangles (i.e., canvas wedges)

pytower.mesh.load_mesh(path)[source]
Return type:

list[ndarray]