Skip to content

Conversation

@BenLewis-Seequent
Copy link
Contributor

Description

This adds typed object for triangle-mesh.

In addition I have also added support for casting tables and data frames to the correct format during saving of the data. This cast operation will only succeed if there is no loss of data, and I have forbidding the conversion of integers to floats(as that would only succeed if all floats are exact integers). This avoids the user having to cast or specify the data types themselves. For example without this, the following would not work as the arrays would default to int32, not uint64, which the schema expects.

triangles_df = pd.DataFrame(
    {
        "n0": [0, 1, 2, 3, 0, 0],  # First vertex of each triangle
        "n1": [1, 2, 3, 0, 2, 3],  # Second vertex of each triangle
        "n2": [4, 4, 4, 4, 1, 2],  # Third vertex of each triangle
    }
)
mesh_data = TriangleMeshData(
    name="Test Pyramid Mesh 20240601_123456_2",
    vertices=vertices_df,
    triangles=triangles_df,
)

Checklist

  • I have read the contributing guide and the code of conduct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant