### Install pyinstantmeshes from source Source: https://github.com/greenbrettmichael/pyinstantmeshes/blob/main/README.md Clone the repository and install pyinstantmeshes from source. Ensure you clone with the --recursive flag to include submodules. ```bash git clone --recursive https://github.com/greenbrettmichael/pyinstantmeshes.git cd pyinstantmeshes pip install . ``` -------------------------------- ### Install pyinstantmeshes via pip Source: https://github.com/greenbrettmichael/pyinstantmeshes/blob/main/README.md Install the pyinstantmeshes library using pip. Pre-built binary wheels are available for common platforms and Python versions. ```bash pip install pyinstantmeshes ``` -------------------------------- ### Install PyInstantMeshes with Test Dependencies Source: https://github.com/greenbrettmichael/pyinstantmeshes/blob/main/README.md Install the package in editable mode with test dependencies included. This is necessary for running the local test suite. ```bash pip install -e .[test] ``` -------------------------------- ### Run Pytest Suite Source: https://github.com/greenbrettmichael/pyinstantmeshes/blob/main/README.md Execute the project's test suite using pytest. This command runs all defined tests to ensure code correctness. ```bash pytest ``` -------------------------------- ### Run Pytest with Coverage Report Source: https://github.com/greenbrettmichael/pyinstantmeshes/blob/main/README.md Run the test suite and generate a coverage report. This helps identify which parts of the code are covered by tests. ```bash pytest --cov=pyinstantmeshes --cov-report=term-missing --cov-report=html ``` -------------------------------- ### remesh_file(input_path, output_path, **kwargs) Source: https://github.com/greenbrettmichael/pyinstantmeshes/blob/main/README.md Remeshes a mesh from a file and saves the result to another file. This function simplifies the process of remeshing by handling file I/O directly. ```APIDOC ## remesh_file(input_path, output_path, **kwargs) ### Description Remesh a file directly. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **input_path** (str) - Required - Path to the input mesh file (e.g., .obj) - **output_path** (str) - Required - Path to save the output remeshed file - **target_vertex_count** (int) - Optional - Target number of vertices (default: -1, uses 1/16 of input) - **target_face_count** (int) - Optional - Target number of faces (default: -1) - **target_edge_length** (float) - Optional - Target edge length (default: -1) - **rosy** (int) - Optional - Orientation symmetry type (default: 4) - **posy** (int) - Optional - Position symmetry type (default: 4) - **crease_angle** (float) - Optional - Crease angle threshold in degrees (default: -1) - **extrinsic** (bool) - Optional - Use extrinsic mode (default: False) - **align_to_boundaries** (bool) - Optional - Align field to boundaries (default: False) - **smooth_iterations** (int) - Optional - Number of smoothing iterations (default: 2) - **knn_points** (int) - Optional - kNN points for point clouds (default: 10) - **pure_quad** (bool) - Optional - Generate pure quad mesh (default: False) - **deterministic** (bool) - Optional - Use deterministic mode (default: False) ### Request Example ```python output_vertices, output_faces = pyinstantmeshes.remesh_file( "input_mesh.obj", "output_mesh.obj", target_vertex_count=5000 ) ``` ### Response #### Success Response (200) - **vertices** (numpy.ndarray) - Output vertex positions as Nx3 float array - **faces** (numpy.ndarray) - Output face indices as Nx3 or Nx4 int array #### Response Example ```json { "vertices": [[0.1, 0.2, 0.3], ...], "faces": [[0, 1, 2], ...] } ``` ``` -------------------------------- ### Remeshing Directly from Files Source: https://github.com/greenbrettmichael/pyinstantmeshes/blob/main/README.md Remesh a mesh file (e.g., OBJ) and save the output to another file. Specify input and output file paths and the target vertex count. ```python import pyinstantmeshes # Remesh a file directly output_vertices, output_faces = pyinstantmeshes.remesh_file( "input_mesh.obj", "output_mesh.obj", target_vertex_count=5000 ) ``` -------------------------------- ### Basic Mesh Remeshing with NumPy Arrays Source: https://github.com/greenbrettmichael/pyinstantmeshes/blob/main/README.md Perform basic remeshing on mesh data defined by NumPy arrays for vertices and faces. Specify the target vertex count for the output mesh. ```python import numpy as np import pyinstantmeshes # Create or load your mesh data vertices = np.array([ [0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0] ], dtype=np.float32) faces = np.array([ [0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3] ], dtype=np.int32) # Remesh with target vertex count output_vertices, output_faces = pyinstantmeshes.remesh( vertices, faces, target_vertex_count=100 ) print(f"Input: {len(vertices)} vertices, {len(faces)} faces") print(f"Output: {len(output_vertices)} vertices, {len(output_faces)} faces") ``` -------------------------------- ### Advanced Remeshing Parameters Source: https://github.com/greenbrettmichael/pyinstantmeshes/blob/main/README.md Utilize advanced parameters for the remesh function to control mesh generation. Options include target face count, edge length, symmetry, crease angle, and more. ```python output_vertices, output_faces = pyinstantmeshes.remesh( vertices, faces, target_vertex_count=1000, # Target number of vertices target_face_count=-1, # Target number of faces (alternative to vertex count) target_edge_length=-1.0, # Target edge length (alternative sizing method) rosy=4, # Orientation symmetry (4 or 6) posy=4, # Position symmetry (4 for quads, 3 for triangles) crease_angle=-1.0, # Crease angle threshold (-1 to disable) extrinsic=False, # Use extrinsic mode align_to_boundaries=False, # Align field to boundaries smooth_iterations=2, # Number of smoothing iterations knn_points=10, # kNN for point cloud processing pure_quad=False, # Generate pure quad mesh (vs quad-dominant) deterministic=False # Use deterministic mode ) ``` -------------------------------- ### remesh(vertices, faces, **kwargs) Source: https://github.com/greenbrettmichael/pyinstantmeshes/blob/main/README.md Remeshes a triangular or quad mesh to improve its topology. This function takes NumPy arrays for vertices and faces and accepts various optional parameters to control the remeshing process. ```APIDOC ## remesh(vertices, faces, **kwargs) ### Description Remesh a triangular or quad mesh for better topology. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **vertices** (numpy.ndarray) - Required - Input vertex positions as Nx3 float array - **faces** (numpy.ndarray) - Required - Input face indices as Nx3 or Nx4 int array - **target_vertex_count** (int) - Optional - Desired vertex count (default: -1, uses 1/16 of input) - **target_face_count** (int) - Optional - Desired face count (default: -1) - **target_edge_length** (float) - Optional - Desired edge length (default: -1) - **rosy** (int) - Optional - Orientation symmetry type (default: 4) - **posy** (int) - Optional - Position symmetry type (default: 4) - **crease_angle** (float) - Optional - Crease angle threshold in degrees (default: -1) - **extrinsic** (bool) - Optional - Use extrinsic mode (default: False) - **align_to_boundaries** (bool) - Optional - Align field to boundaries (default: False) - **smooth_iterations** (int) - Optional - Number of smoothing iterations (default: 2) - **knn_points** (int) - Optional - kNN points for point clouds (default: 10) - **pure_quad** (bool) - Optional - Generate pure quad mesh (default: False) - **deterministic** (bool) - Optional - Use deterministic mode (default: False) ### Request Example ```python import numpy as np vertices = np.array([ [0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0] ], dtype=np.float32) faces = np.array([ [0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3] ], dtype=np.int32) output_vertices, output_faces = pyinstantmeshes.remesh( vertices, faces, target_vertex_count=100, smooth_iterations=5 ) ``` ### Response #### Success Response (200) - **vertices** (numpy.ndarray) - Output vertex positions as Nx3 float array - **faces** (numpy.ndarray) - Output face indices as Nx3 or Nx4 int array #### Response Example ```json { "vertices": [[0.1, 0.2, 0.3], ...], "faces": [[0, 1, 2], ...] } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.