simplicialmanifold
SimplicialManifold
Bases: SimplicialComplex
Embodies the concept of simplicial manifold.
Source code in src/dxtr/complexes/simplicialmanifold.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
deficit_angles
property
Returns the deficit angles computed on all (n-2)-simplices.
Notes
The deficit angle is a discrete version of the gaussian curvature.
dihedral_angles
property
Returns the dihedral angles computed on all (n-1)-simplices.
name
property
writable
Name of the manifold.
__init__(simplices, vertices, name=None)
Initializes a SimplicialManifold object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
simplices
|
list of list of int
|
The list of vertex indices forming the highest degree simplices. |
required |
vertices
|
iterable of iterable of float
|
The coordinates of the vertices. Default is None. |
required |
name
|
str
|
A name for the manifold. Default is None. |
None
|
Source code in src/dxtr/complexes/simplicialmanifold.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | |
__str__()
Returns a string representation of the manifold.
Returns:
| Type | Description |
|---|---|
str
|
A string representation of the manifold. |
Source code in src/dxtr/complexes/simplicialmanifold.py
62 63 64 65 66 67 68 69 70 71 72 73 | |
build_dual_geometry()
Computes 0-cells positions, covolumes, deficit & dihedral angles.
Notes
Position vectors of 0-cells/n-simplices are taken as the circumcenter of the position vectors of the surrounding n-cells/0-simplices. Sign of mtrx_inv is set to satisfy: mtrx_inv * mtrx = -1 ^(k*(n-k))
Source code in src/dxtr/complexes/simplicialmanifold.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 | |
from_file(path, name=None)
classmethod
Instantiates a SimplicialManifold from a .ply file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
The path to the |
required |
name
|
str
|
A name for the manifold. Default is None. |
None
|
Returns:
| Type | Description |
|---|---|
SimplicialManifold
|
The instantiated simplicial manifold. |
Source code in src/dxtr/complexes/simplicialmanifold.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
update_geometry(displacement)
Updates some vertices and the corresponding geometrical properties.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
displacement
|
dict of int to np.ndarray of float
|
The displacement to add to the selected vertices. - keys: The indices of the vertices to move. - values: The displacement to add to the selected vertices. |
required |
Notes
The SimplicialManifold version of this method calls the one from
the mother class SimplicialComplex to update the positions of
the vertices and the volumes of the simplices.
In this specific version, circumcenters and covolumes are also
updated.
Deficit angles are updated through a specific method:
update_deficit_angle().
Source code in src/dxtr/complexes/simplicialmanifold.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
dual_edge_vectors(of, normalized=False)
Computes vectors along the dual 1-cells of a SimplicialManifold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
of
|
SimplicialManifold
|
The |
required |
normalized
|
bool
|
If True, returned unit vectors. Default is False. |
False
|
Returns:
| Type | Description |
|---|---|
np.ndarray of float
|
A (N,D) array with N = number of (n-1)-simplices, D = the dimension of the embedding space. |
Notes
In the case of a non-closed manifold, the outer dual edges are oriented outward from the circumcenters of the top-simplices toward the circumcenters of the (n-1)-simplices on the border.
Source code in src/dxtr/complexes/simplicialmanifold.py
585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | |
edge_vectors(manifold, dual=False, normalized=False)
Computes edge vectors on SimplicialComplex or SimplicialManifold.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
manifold
|
SimplicialManifold or SimplicialComplex
|
The |
required |
dual
|
bool
|
If True, the computation is performed on the dual complex. Else, it is performed on the primal one. Default is False. |
False
|
normalized
|
bool
|
If True, the computed vectors are of unit norm. Default is False. |
False
|
Returns:
| Type | Description |
|---|---|
np.ndarray of float
|
A (N,D) array with N = number of (n-1)-simplices if on==True else number of 0-simplices, D = the dimension of the embedding space. |
Notes
Can only compute dual edges on SimplicialManifold not on
SimplicialComplex.
Source code in src/dxtr/complexes/simplicialmanifold.py
642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 | |