pyprt.pyprt_utils module

faces_indices_vectors_to_matrix(indices, faces) List[List[int]][source]

PyPRT outputs the GeneratedModel face information as a list of vertex indices and a list of face indices count. This function converts these two lists into one list of lists containing the vertex indices per face.

Parameters:
  • indices – List[int]

  • faces – List[int]

Returns:

List[List[int]]

Example

[[1, 0, 3, 2], [4, 5, 6, 7], [0, 1, 5, 4], [1, 2, 6, 5], [2, 3, 7, 6], [3, 0, 4, 7]] = faces_indices_vectors_to_matrix(([1, 0, 3, 2, 4, 5, 6, 7, 0, 1, 5, 4, 1, 2, 6, 5, 2, 3, 7, 6, 3, 0, 4, 7],[4, 4, 4, 4, 4, 4]))

vertices_vector_to_matrix(vertices) List[List[float]][source]

PyPRT outputs the GeneratedModel vertex coordinates as a list. The list contains the x, y, z coordinates of all the vertices. This function converts the vertex list into a list of N vertex coordinates lists (with N, the number of geometry vertices).

Parameters:

vertices – List[float]

Returns:

List[List[float]]

Example

[[-10.0, 0.0, 10.0], [-10.0, 0.0, 0.0], [10.0, 0.0, 0.0], [10.0, 0.0, 10.0]] = vertices_vector_to_matrix([-10.0, 0.0, 10.0, -10.0, 0.0, 0.0, 10.0, 0.0, 0.0, 10.0, 0.0, 10.0])

visualize_prt_results(models)[source]

This helper function is used to output the geometry and report information of a list of GeneratedModel instances.

Parameters:

models – List[GeneratedModel]