@@ -620,8 +620,8 @@ def cell_centroids(self) -> torch.Tensor:
620620 """Compute the centroids (geometric centers) of all cells.
621621
622622 The centroid of a cell is computed as the arithmetic mean of its vertex positions.
623- For an n-simplex with vertices (v0, v1, ..., vn), the centroid is:
624- centroid = (v0 + v1 + ... + vn) / (n + 1)
623+ For an n-simplex with vertices (v0, v1, ..., vn), the centroid is
624+ `` centroid = (v0 + v1 + ... + vn) / (n + 1)``.
625625
626626 The result is cached in ``_cache["cell", "centroids"]`` for efficiency.
627627
@@ -1541,24 +1541,28 @@ def get_facet_mesh(
15411541 ----------
15421542 manifold_codimension : int, optional
15431543 Codimension of extracted mesh relative to parent.
1544+
15441545 - 1: Extract (n-1)-facets (default, immediate boundaries of all cells)
15451546 - 2: Extract (n-2)-facets (e.g., edges from tets, vertices from triangles)
15461547 - k: Extract (n-k)-facets
15471548 data_source : {"points", "cells"}, optional
15481549 Source of data inheritance:
1550+
15491551 - "cells": Facets inherit from parent cells they bound. When multiple
15501552 cells share a facet, data is aggregated according to data_aggregation.
15511553 - "points": Facets inherit from their boundary vertices. Data from
15521554 multiple boundary points is averaged.
15531555 data_aggregation : {"mean", "area_weighted", "inverse_distance"}, optional
15541556 Strategy for aggregating data from multiple sources
15551557 (only applies when data_source="cells"):
1558+
15561559 - "mean": Simple arithmetic mean
15571560 - "area_weighted": Weighted by parent cell areas
15581561 - "inverse_distance": Weighted by inverse distance from facet centroid
15591562 to parent cell centroids
15601563 target_counts : list[int] | {"boundary", "shared", "interior", "all"}, optional
15611564 Which facets to keep based on how many parent cells share them:
1565+
15621566 - "all": Keep all unique facets (default)
15631567 - "boundary": Keep only boundary facets (appearing in exactly 1 cell)
15641568 - "shared": Keep only shared facets (appearing in 2+ cells)
@@ -1969,6 +1973,7 @@ def get_cell_to_cells_adjacency(self, adjacency_codimension: int = 1):
19691973 ----------
19701974 adjacency_codimension : int, optional
19711975 Codimension of shared facets defining adjacency.
1976+
19721977 - 1 (default): Cells must share a codimension-1 facet (e.g., triangles
19731978 sharing an edge, tetrahedra sharing a triangular face)
19741979 - 2: Cells must share a codimension-2 facet (e.g., tetrahedra sharing
@@ -2201,6 +2206,7 @@ def draw(
22012206 ----------
22022207 backend : {"auto", "matplotlib", "pyvista"}
22032208 Visualization backend to use:
2209+
22042210 - "auto": Automatically select based on n_spatial_dims
22052211 (matplotlib for 0D/1D/2D, PyVista for 3D)
22062212 - "matplotlib": Force matplotlib backend (supports 3D via mplot3d)
@@ -2211,12 +2217,14 @@ def draw(
22112217 customization before display.
22122218 point_scalars : torch.Tensor or str or tuple[str, ...], optional
22132219 Scalar data to color points. Mutually exclusive with cell_scalars. Can be:
2220+
22142221 - None: Points use neutral color (black)
22152222 - torch.Tensor: Direct scalar values, shape (n_points,) or
22162223 (n_points, ...) where trailing dimensions are L2-normed
22172224 - str or tuple[str, ...]: Key to lookup in mesh.point_data
22182225 cell_scalars : torch.Tensor or str or tuple[str, ...], optional
22192226 Scalar data to color cells. Mutually exclusive with point_scalars. Can be:
2227+
22202228 - None: Cells use neutral color (lightblue if no scalars,
22212229 lightgray if point_scalars active)
22222230 - torch.Tensor: Direct scalar values, shape (n_cells,) or
@@ -2787,12 +2795,14 @@ def subdivide(
27872795 levels : int, optional
27882796 Number of subdivision iterations to perform. Each level
27892797 increases mesh resolution exponentially:
2798+
27902799 - 0: No subdivision (returns original mesh)
27912800 - 1: Each cell splits into 2^n children
27922801 - 2: Each cell splits into 4^n children
27932802 - k: Each cell splits into (2^k)^n children
27942803 filter : {"linear", "butterfly", "loop"}, optional
27952804 Subdivision scheme to use:
2805+
27962806 - "linear": Simple midpoint subdivision (interpolating).
27972807 New vertices at exact edge midpoints. Works for any dimension.
27982808 Preserves original vertices.
0 commit comments