Quadrings
forked and built on geometrylab/geometry/meshpy.py
meshpy.py --> quadrings.py --> gridshell_new.py(GeolabGUI)--> gui_basic.py --> guidedprojection_net.py + opt_din.py --> read_file
boundary_vertex_3neibs(self)
Retrieves the neighbors of boundary vertices with valence 3.
This function identifies the neighbors of boundary vertices that have valence 3 and returns their indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
boundary_vertices |
numpy array
|
Indices of boundary vertices with valence 3. |
left_neighbors |
numpy array
|
Indices of the left neighbors. |
right_neighbors |
numpy array
|
Indices of the right neighbors. |
inner_neighbors |
numpy array
|
Indices of the inner neighbors. |
Note
This function assumes that the mesh is a regular mesh. The neighbors are useful for mesh analysis and processing.
bdry(include corner) --> return [vl,vr,vinn]; vl,vr in bdry, vinn in inner bdry_3neibs[0]:= 2nd_boundary_vertices, including corners bdry_3neibs[1]:= left of bdry_vertices bdry_3neibs[2]:= right of bdry_vertices
See Also
boundary_vertices : Retrieves the indices of boundary vertices.
Source code in src/geometry/quadrings.py
get_1family_oriented_polyline(self, diagnet=False, poly2=True)
Retrieves one family of oriented polylines from the mesh.
This function identifies and returns one family of oriented polylines, optionally considering diagonal edges and polyline direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
diagnet
|
(bool, optional(default=False))
|
Whether to consider diagonal edges. |
False
|
poly2
|
(bool, optional(default=True))
|
The direction of the polylines. |
True
|
Returns:
Name | Type | Description |
---|---|---|
polyline |
numpy array
|
The oriented polyline. |
Note
This function assumes that the mesh is a regular mesh. The oriented polylines are useful for mesh analysis and processing.
(!still have problem for the demultiple and oriendted quad faces,bad for thickness)
See Also
get_2families_polyline_from_1closed_bdry : Retrieves two families of polylines.
Source code in src/geometry/quadrings.py
3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 |
|
get_2families_polyline_from_1closed_bdry(self, diagnet=False, direction=True)
Retrieves two families of polylines from a closed boundary.
This function identifies and returns two families of polylines from a closed boundary, optionally considering diagonal edges and direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
diagnet
|
(bool, optional(default=False))
|
Whether to consider diagonal edges. |
False
|
direction
|
(bool, optional(default=True))
|
The direction of the polylines. |
True
|
Returns:
Name | Type | Description |
---|---|---|
polyline1 |
numpy array
|
The first family of polylines. |
polyline2 |
numpy array
|
The second family of polylines. |
Note
This function assumes that the mesh has a closed boundary. The polylines are useful for mesh analysis and processing.
(along one bdry for a patch-shape; two bdry for a star-shape)
See Also
get_1family_oriented_polyline : Retrieves one family of oriented polylines.
Source code in src/geometry/quadrings.py
3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 |
|
get_a_boundary_L_strip(self, direction)
Retrieves an L-shaped strip of boundary vertices.
This function identifies an L-shaped strip of boundary vertices based on the specified direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
direction
|
bool
|
The direction of the L-strip (True for one direction, False for the other). |
required |
Returns:
Name | Type | Description |
---|---|---|
strip |
numpy array
|
The indices of vertices forming the L-strip. |
Note
This function assumes that the mesh is a regular mesh. The L-strip is useful for mesh analysis and processing.
AG-net: only rectangular-patch shape
See Also
get_cylinder_annulus_mesh_diagonal_oriented_vertices : Retrieves diagonal-oriented vertices.
Source code in src/geometry/quadrings.py
1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 |
|
get_all_boundary_vertices(self, order=False)
Retrieves all boundary vertices in the mesh.
This function identifies and returns all boundary vertices in the mesh, optionally in a specific order.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
order
|
(bool, optional(default=False))
|
Whether to return the boundary vertices in a specific order. |
False
|
Returns:
Name | Type | Description |
---|---|---|
boundary_vertices |
numpy array
|
The indices of boundary vertices. |
boundary_positions |
numpy array
|
The positions of boundary vertices. |
Note
This function assumes that the mesh has a boundary. The boundary vertices are useful for mesh analysis and processing.
See Also
boundary_vertices : Retrieves the indices of boundary vertices.
Source code in src/geometry/quadrings.py
get_both_isopolyline(self, diagpoly=False, is_one_or_another=False, is_poly=False, only_inner=False, interval=1, is_demultiple=False)
Retrieves two families of isopolyline curves from the mesh.
This function identifies and returns two families of isopolyline curves based on the specified parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
diagpoly
|
(bool, optional(default=False))
|
Whether to use diagonal polyline. |
False
|
is_one_or_another
|
(bool, optional(default=False))
|
Whether to select one family or the other. |
False
|
is_poly
|
(bool, optional(default=False))
|
Whether to return the result as polylines. |
False
|
only_inner
|
(bool, optional(default=False))
|
Whether to consider only inner vertices. |
False
|
interval
|
(int, optional(default=1))
|
The interval between selected vertices. |
1
|
is_demultiple
|
(bool, optional(default=False))
|
Whether to remove multiple edges. |
False
|
Returns:
Name | Type | Description |
---|---|---|
polylines |
list
|
A list of isopolyline curves. |
Note
This function assumes that the mesh is a regular mesh. The isopolyline curves are useful for mesh analysis and processing.
AG-net:works for any geometry; but the polys are not orderly arranged
menubar_basicplot: show_isoline1,show_isoline2; no multiple edges
See Also
get_isoline_vertex_list : Retrieves isoline vertices.
Source code in src/geometry/quadrings.py
1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 |
|
get_checker_select_vertex(self, first=[0])
Retrieves the checkerboard selection of vertices.
This function identifies and returns the indices of vertices in a checkerboard pattern, starting from the specified vertex.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
first
|
(list, optional(default=[0]))
|
The starting vertex index. |
[0]
|
Returns:
Name | Type | Description |
---|---|---|
indices |
list
|
The indices of vertices in the checkerboard pattern. |
Note
This function assumes that the mesh is a regular mesh. The checkerboard selection is useful for mesh analysis and processing.
self.checker_vertex: all vertex...blue ~ 0 ; red ~ 1; left ~ -1
See Also
get_checkerboard_black : Retrieves the black vertices in a checkerboard pattern. get_checkerboard_white : Retrieves the white vertices in a checkerboard pattern.
Source code in src/geometry/quadrings.py
get_checkerboard_black(self, is_rr=False, is_ck_n=False, is_GI=False)
Retrieves the black vertices in a checkerboard pattern.
This function identifies and returns the black vertices in a checkerboard pattern, optionally considering regular vertices and normal vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
is_rr
|
(bool, optional(default=False))
|
Whether to consider regular vertices. |
False
|
is_ck_n
|
(bool, optional(default=False))
|
Whether to return normal vectors. |
False
|
is_GI
|
(bool, optional(default=False))
|
Whether to compute the gradient of the normal vectors. |
False
|
Returns:
Name | Type | Description |
---|---|---|
black_vertices |
numpy array
|
The indices of black vertices in the checkerboard pattern. |
normals |
numpy array, optional
|
The normal vectors of the black vertices (if is_ck_n=True). |
gradient |
numpy array, optional
|
The gradient of the normal vectors (if is_GI=True). |
Note
This function assumes that the mesh is a regular mesh. The black vertices are useful for mesh analysis and processing.
See Also
get_checker_select_vertex : Retrieves the checkerboard selection of vertices. get_checkerboard_white : Retrieves the white vertices in a checkerboard pattern.
Source code in src/geometry/quadrings.py
2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 |
|
get_checkerboard_white(self)
Retrieves the white vertices in a checkerboard pattern.
This function identifies and returns the white vertices in a checkerboard pattern.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
white_vertices |
numpy array
|
The indices of white vertices in the checkerboard pattern. |
Note
This function assumes that the mesh is a regular mesh. The white vertices are useful for mesh analysis and processing.
See Also
get_checker_select_vertex : Retrieves the checkerboard selection of vertices. get_checkerboard_black : Retrieves the black vertices in a checkerboard pattern.
Source code in src/geometry/quadrings.py
get_cylinder_annulus_mesh_diagonal_oriented_vertices(self, direction)
Retrieves diagonal-oriented vertices for a cylinder or annulus mesh.
This function identifies vertices oriented along the diagonal direction for a cylinder or annulus mesh.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
direction
|
bool
|
The direction of the diagonal (True for one direction, False for the other). |
required |
Returns:
Name | Type | Description |
---|---|---|
vertices |
numpy array
|
The indices of diagonal-oriented vertices. |
Note
This function assumes that the mesh is a cylinder or annulus mesh. The diagonal-oriented vertices are useful for mesh analysis and processing.
AG-net: only work for cylinder-annulus-shape
return loop boundary quads (Lx1): v and only 1diag v
See Also
get_a_boundary_L_strip : Retrieves an L-shaped strip of boundary vertices.
Source code in src/geometry/quadrings.py
get_curvature(self, mesh, order=None)
Computes the curvature properties of the mesh.
This function calculates the curvature properties of the mesh, including principal curvatures, Gaussian curvature, and mean curvature.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mesh
|
Mesh object
|
The input mesh. |
required |
order
|
numpy array, optional (default=None)
|
The order of vertices to consider. |
None
|
Returns:
Name | Type | Description |
---|---|---|
ratio |
list
|
The ratio of principal curvatures. |
K |
list
|
The Gaussian curvature values. |
H |
list
|
The mean curvature values. |
D1, D2 : numpy array
|
The principal curvature directions. |
Note
This function assumes that the mesh is a regular mesh. The curvature properties are useful for mesh analysis and processing.
(from davide' eigen of shape-operator)
See Also
get_curvature_libigl : Computes the curvature properties using libigl.
Source code in src/geometry/quadrings.py
get_curvature_libigl(self, mesh, evalue=False)
Computes the curvature properties of the mesh using libigl.
This function calculates the curvature properties of the mesh using libigl, including principal curvatures, Gaussian curvature, and mean curvature.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mesh
|
Mesh object
|
The input mesh. |
required |
evalue
|
(bool, optional(default=False))
|
Whether to return the eigenvalues of the shape operator. |
False
|
Returns:
Name | Type | Description |
---|---|---|
vertices |
numpy array
|
The vertex positions. |
K |
list
|
The Gaussian curvature values. |
H |
list
|
The mean curvature values. |
D1, D2 : numpy array
|
The principal curvature directions. |
Note
This function assumes that the mesh is a regular mesh. The curvature properties are useful for mesh analysis and processing.
(via quadric fitting (Panozzo, 2010))
See Also
get_curvature : Computes the curvature properties of the mesh.
Source code in src/geometry/quadrings.py
get_diagonal_mesh(self, sort=True, blue=False, whole=False)
Creates a diagonal mesh from the current mesh.
This function constructs a diagonal mesh by connecting the vertices of the current mesh in a specific pattern. The resulting mesh can be sorted and colored based on the specified parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sort
|
(bool, optional(default=True))
|
Whether to sort the vertices. |
True
|
blue
|
(bool, optional(default=False))
|
Whether to color the vertices blue. |
False
|
whole
|
(bool, optional(default=False))
|
Whether to include the whole mesh. |
False
|
Returns:
Name | Type | Description |
---|---|---|
diagonal_mesh |
Mesh object
|
The constructed diagonal mesh. |
Note
This function assumes that the mesh is a regular mesh. The diagonal mesh is useful for mesh analysis and processing.
See Also
make_quad_mesh_from_indices : Creates a quad mesh from vertex indices.
Source code in src/geometry/quadrings.py
2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 |
|
get_i_boundary_vertex_indices(self, i)
Retrieves the indices of boundary vertices for a specified boundary.
This function identifies and returns the indices of boundary vertices for the specified boundary.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
i
|
int
|
The index of the boundary. |
required |
Returns:
Name | Type | Description |
---|---|---|
boundary_vertices |
numpy array
|
The indices of boundary vertices. |
boundary_positions |
numpy array
|
The positions of boundary vertices. |
Note
This function assumes that the mesh has multiple boundaries. The boundary vertices are useful for mesh analysis and processing. (work for rectangular-patch + cylinder-annulus)
See Also
get_i_boundary_vertices : Retrieves the boundary vertices from a specified edge.
Source code in src/geometry/quadrings.py
get_i_boundary_vertices(self, e, by_closed=False, by_corner2=False)
Retrieves the boundary vertices from a specified edge.
This function identifies and returns the boundary vertices starting from the specified edge, optionally considering closed boundaries or corner vertices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
e
|
int
|
The index of the starting edge. |
required |
by_closed
|
(bool, optional(default=False))
|
Whether to consider closed boundaries. |
False
|
by_corner2
|
(bool, optional(default=False))
|
Whether to consider corner vertices. |
False
|
Returns:
Name | Type | Description |
---|---|---|
boundary_vertices |
numpy array
|
The indices of boundary vertices. |
boundary_positions |
numpy array
|
The positions of boundary vertices. |
Note
This function assumes that the mesh has a boundary. The boundary vertices are useful for mesh analysis and processing.
See Also
get_i_boundary_vertex_indices : Retrieves the indices of boundary vertices.
Source code in src/geometry/quadrings.py
3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 |
|
get_index_in_polyline(self, vstartlist, patch_or_annulus=True)
Retrieves the indices of vertices in a polyline.
This function identifies and returns the indices of vertices in a polyline based on the specified start vertices and mesh type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vstartlist
|
list
|
The list of start vertices. |
required |
patch_or_annulus
|
(bool, optional(default=True))
|
Whether the mesh is a patch or an annulus. |
True
|
Returns:
Name | Type | Description |
---|---|---|
indices |
numpy array
|
The indices of vertices in the polyline. |
Note
This function assumes that the mesh is a regular mesh. The indices are useful for accessing specific vertices in the mesh.
reorder for a continuous but messy order vertex-list;
vstartlist in boundary_curves
See Also
get_polyline_from_an_edge : Retrieves a polyline from an edge.
Source code in src/geometry/quadrings.py
1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 |
|
get_isoline_vertex_list(self, interval, another_direction=True)
Retrieves the vertices forming isoline curves.
This function identifies and returns the vertices forming isoline curves based on the specified interval and direction.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
interval
|
int
|
The interval between selected vertices. |
required |
another_direction
|
(bool, optional(default=True))
|
Whether to consider another direction. |
True
|
Returns:
Name | Type | Description |
---|---|---|
all_v0 |
list
|
All vertices forming the isoline curves. |
all_vs_v0 |
list
|
All neighboring vertices forming the isoline curves. |
select_v0 |
list
|
Selected vertices forming the isoline curves. |
select_vs_v0 |
list
|
Selected neighboring vertices forming the isoline curves. |
Note
This function assumes that the mesh is a regular mesh. The isoline vertices are useful for mesh analysis and processing.
along one bdry for a patch-shape; two bdry for a star-shape
See Also
get_both_isopolyline : Retrieves two families of isopolyline curves.
Source code in src/geometry/quadrings.py
1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 |
|
get_midline_mesh(self)
Creates a midline mesh from the current mesh.
This function constructs a midline mesh by connecting the midpoints of the edges of the current mesh. The resulting mesh represents the midlines of the original mesh.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
midline_mesh |
Mesh object
|
The constructed midline mesh. |
Note
This function assumes that the mesh is a regular mesh. The midline mesh is useful for mesh analysis and processing.
(remesh of principal mesh by midline-ortho + planarity; the quadface should be planar)
See Also
get_diagonal_mesh : Creates a diagonal mesh from the current mesh.
Source code in src/geometry/quadrings.py
2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 |
|
get_net_crossing_angle(self, ut1, ut2)
Computes the crossing angles between two sets of tangent vectors.
This function calculates the crossing angles between two sets of tangent vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ut1
|
numpy array
|
The first set of unit tangent vectors. |
required |
ut2
|
numpy array
|
The second set of unit tangent vectors. |
required |
Returns:
Name | Type | Description |
---|---|---|
angle |
numpy array
|
The crossing angles between the tangent vectors. |
Note
This function assumes that the input tangent vectors are unit vectors. The crossing angles are useful for mesh analysis and processing.
(for orthogonal / isogonal case)
See Also
get_v4_unit_tangents : Computes the unit tangent vectors for vertices with valence 4.
Source code in src/geometry/quadrings.py
get_patch_and_rot_matrix_ind(self)
Retrieves the indices of vertices in the patch and rotational matrices.
This function identifies the vertices in the patch and rotational matrices and returns their indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
indices |
list
|
A list containing the indices of vertices in the patch and rotational matrices. |
Note
This function assumes that the mesh is a regular patch or rotational mesh. The indices are useful for accessing specific vertices in the mesh.
only work for patch/annulus srf from mesh rrvertex, return [v1-v-v3] in column direction of indM [v2-v-v4] in row direction of indM indM_inner = [[0,1,2,3,4,5], [6,7,8,9,10,11] [......] []][v,v1,v2,v3,v4] ~ indM_inn [v[indv],v1[indv],v2[indv],v3[indv],v4[indv]] ~ indM_inner indv: indices of M_inn in rrv4f4 [ivf1,ivf2,ivf3,ivf4]: quadfaces indices of M_inn_inn in rrv4f4
See Also
regular_rectangle_patch : Creates a patch matrix for a rectangular mesh. regular_rotational_patch : Creates a patch matrix for a rotational mesh.
Source code in src/geometry/quadrings.py
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 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|
get_polyline_from_an_edge(self, e, is_bdry=False, is_halfedge=True, is_poly=False)
Retrieves a polyline from a specified edge.
This function identifies and returns a polyline based on the specified edge.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
e
|
int
|
The index of the edge. |
required |
is_bdry
|
(bool, optional(default=False))
|
Whether the edge is on the boundary. |
False
|
is_halfedge
|
(bool, optional(default=True))
|
Whether to consider half-edges. |
True
|
is_poly
|
(bool, optional(default=False))
|
Whether to return the result as a polyline. |
False
|
Returns:
Name | Type | Description |
---|---|---|
iv |
numpy array
|
The indices of vertices forming the polyline. |
VV |
numpy array
|
The coordinates of vertices forming the polyline. |
poly |
Polyline object
|
The polyline object (if is_poly=True). |
Note
This function assumes that the mesh is a regular mesh. The polyline is useful for mesh analysis and processing.
See Also
get_polylines_from_edges : Retrieves polylines from a list of edges.
Source code in src/geometry/quadrings.py
2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 |
|
get_polylines_fair_index(self, es, vvv, vva, vvb)
Retrieves indices of fair polylines.
This function identifies and returns the indices of fair polylines based on the specified edges and vertex lists.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
es
|
list
|
The list of edge indices. |
required |
vvv
|
list
|
The list of vertex indices. |
required |
vva
|
list
|
The list of neighboring vertex indices. |
required |
vvb
|
list
|
The list of neighboring vertex indices. |
required |
Returns:
Name | Type | Description |
---|---|---|
indices |
numpy array
|
The indices of fair polylines. |
Note
This function assumes that the mesh is a regular mesh. The indices are useful for accessing specific polylines in the mesh.
vvv=[v,v],vva=[v1,v2],vvb=[v3,v4]
See Also
get_polyline_from_an_edge : Retrieves a polyline from an edge.
Source code in src/geometry/quadrings.py
get_polylines_from_edges(self, es, is_poly=True)
Retrieves polylines from a list of edges.
This function identifies and returns polylines based on the specified edges.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
es
|
list
|
The list of edge indices. |
required |
is_poly
|
(bool, optional(default=True))
|
Whether to return the result as polylines. |
True
|
Returns:
Name | Type | Description |
---|---|---|
ivs |
numpy array
|
The indices of vertices forming the polylines. |
V |
numpy array
|
The coordinates of vertices forming the polylines. |
polys |
list
|
The list of polylines (if is_poly=True). |
Note
This function assumes that the mesh is a regular mesh. The polylines are useful for mesh analysis and processing.
See Also
get_polyline_from_an_edge : Retrieves a polyline from an edge.
Source code in src/geometry/quadrings.py
get_quad_diagonal(self, V, plot=False)
Computes the diagonal vectors of quad faces for a given set of vertices.
This function calculates the diagonal vectors of quad faces and returns their lengths and unit vectors. Optionally, it can plot the diagonals.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
V
|
numpy array
|
The vertex positions. |
required |
plot
|
(bool, optional(default=False))
|
Whether to plot the diagonal vectors. |
False
|
Returns:
Name | Type | Description |
---|---|---|
ld1 |
numpy array
|
The lengths of the first diagonal. |
ld2 |
numpy array
|
The lengths of the second diagonal. |
ud1 |
numpy array
|
The unit vectors of the first diagonal. |
ud2 |
numpy array
|
The unit vectors of the second diagonal. |
anchor |
numpy array
|
The anchor points for the diagonals. |
Note
This function assumes that the mesh is a regular mesh with quad faces. The diagonal vectors are useful for mesh analysis and processing.
isogonal_ck_based: get diagonal edge_length / unit_vector
See Also
get_quadface_diagonal : Computes the diagonal vectors of quad faces.
Source code in src/geometry/quadrings.py
get_quadface_diagonal(self)
Computes the diagonal vectors of quad faces.
This function calculates the diagonal vectors of quad faces and returns their lengths and unit vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
ld1 |
numpy array
|
The lengths of the first diagonal. |
ld2 |
numpy array
|
The lengths of the second diagonal. |
ud1 |
numpy array
|
The unit vectors of the first diagonal. |
ud2 |
numpy array
|
The unit vectors of the second diagonal. |
Note
This function assumes that the mesh is a regular mesh with quad faces. The diagonal vectors are useful for mesh analysis and processing.
for isometry_checkerboard
See Also
get_quad_diagonal : Computes the diagonal vectors for a given set of vertices.
Source code in src/geometry/quadrings.py
get_quad_mesh_1family_isoline(self, diagnet=False, direction=True, edge=False)
Retrieves one family of isolines from the quad mesh.
This function identifies and returns one family of isolines from the quad mesh, optionally considering diagonal edges and edge data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
diagnet
|
(bool, optional(default=False))
|
Whether to consider diagonal edges. |
False
|
direction
|
(bool, optional(default=True))
|
The direction of the isolines. |
True
|
edge
|
(bool, optional(default=False))
|
Whether to return edge data. |
False
|
Returns:
Name | Type | Description |
---|---|---|
isolines |
Polyline object
|
The isolines in the specified direction. |
edge_data |
numpy array, optional
|
The edge data (if edge=True). |
Note
This function assumes that the mesh is a quad mesh. The isolines are useful for mesh analysis and visualization.
See Also
get_quad_mesh_2family_isolines : Retrieves two families of isolines.
Source code in src/geometry/quadrings.py
get_quad_midline(self)
Computes the midlines of quad faces in the mesh.
This function calculates the midlines of quad faces and returns the corresponding polylines.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
pl1 |
Polyline object
|
The first midline polyline. |
pl2 |
Polyline object
|
The second midline polyline. |
Note
This function assumes that the mesh is a regular mesh with quad faces. The midlines are useful for mesh analysis and processing.
See Also
get_quad_diagonal : Computes the diagonal vectors of quad faces.
Source code in src/geometry/quadrings.py
get_quad_midpoint_cross_vectors(self, plot=False, scale=1 / 3)
Computes the midpoint cross vectors of quad faces.
This function calculates the midpoint cross vectors of quad faces and returns their lengths and unit vectors. Optionally, it can plot the vectors.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plot
|
(bool, optional(default=False))
|
Whether to plot the midpoint cross vectors. |
False
|
scale
|
(float, optional(default=1 / 3))
|
The scaling factor for the vectors. |
1 / 3
|
Returns:
Name | Type | Description |
---|---|---|
lp |
numpy array
|
The lengths of the first cross vector. |
lq |
numpy array
|
The lengths of the second cross vector. |
m13 |
numpy array
|
The unit vectors of the first cross vector. |
m24 |
numpy array
|
The unit vectors of the second cross vector. |
anchor |
numpy array
|
The anchor points for the cross vectors. |
Note
This function assumes that the mesh is a regular mesh with quad faces. The midpoint cross vectors are useful for mesh analysis and processing.
isogonal_face_based: get quadface midpoint edge_length / unit_vector
See Also
get_quad_diagonal : Computes the diagonal vectors of quad faces.
Source code in src/geometry/quadrings.py
get_quad_parallelogram(self, is_theta_equal_theta0=False, is_plot=False)
Computes the properties of parallelogram faces in the mesh.
This function calculates the properties of parallelogram faces, including lengths, angles, and similarity metrics. Optionally, it can plot the results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
is_theta_equal_theta0
|
(bool, optional(default=False))
|
Whether to assume equal angles. |
False
|
is_plot
|
(bool, optional(default=False))
|
Whether to plot the results. |
False
|
Returns:
Name | Type | Description |
---|---|---|
properties |
numpy array
|
The computed properties of the parallelogram faces. |
Note
This function assumes that the mesh is a regular mesh with parallelogram faces. The properties are useful for mesh analysis and processing.
I-net with similar parallelograms
See Also
get_quad_parallelogram_similarity : Computes the similarity of parallelogram faces.
Source code in src/geometry/quadrings.py
get_quad_parallelogram_similarity(self)
Computes the similarity of parallelogram faces in the mesh.
This function calculates the similarity metrics of parallelogram faces, including lambda and mu values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
lambda |
numpy array
|
The lambda values for the parallelogram faces. |
mu |
numpy array
|
The mu values for the parallelogram faces. |
Note
This function assumes that the mesh is a regular mesh with parallelogram faces. The similarity metrics are useful for mesh analysis and processing.
See Also
get_quad_parallelogram : Computes the properties of parallelogram faces.
Source code in src/geometry/quadrings.py
get_quad_midline(self)
Computes the midlines of quad faces in the mesh.
This function calculates the midlines of quad faces and returns the corresponding polylines.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
pl1 |
Polyline object
|
The first midline polyline. |
pl2 |
Polyline object
|
The second midline polyline. |
Note
This function assumes that the mesh is a regular mesh with quad faces. The midlines are useful for mesh analysis and processing.
See Also
get_quad_diagonal : Computes the diagonal vectors of quad faces.
Source code in src/geometry/quadrings.py
get_rr_quadface_boundaryquad_index(self, vb_quad=True)
Retrieves the indices of boundary quad faces in the regular quad face list.
This function identifies the boundary quad faces and returns their indices in the regular quad face list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vb_quad
|
(bool, optional(default=True))
|
Whether to include quad faces that have vertices on the boundary. |
True
|
Returns:
Name | Type | Description |
---|---|---|
inner_indices |
numpy array
|
The indices of inner quad faces. |
boundary_indices |
numpy array
|
The indices of boundary quad faces. |
Note
This function assumes that the mesh is a regular mesh. The indices are useful for accessing specific quad faces in the mesh.
See Also
regular_vertex_regular_quad : Identifies regular vertices and quad faces.
Source code in src/geometry/quadrings.py
get_rr_vs_4face_centers(self)
Computes the centers of regular quad faces in the mesh.
This function calculates the geometric centers (barycenters) of regular quad faces in the mesh. The centers are computed as the average of the vertex positions of each quad face.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
face_centers |
numpy array
|
The coordinates of the centers of regular quad faces. |
Note
This function assumes that the mesh is a regular mesh with quad faces. The face centers are useful for mesh analysis, processing, and visualization.
Example
mesh = Mesh() # Assuming Mesh is a class that contains the mesh data face_centers = mesh.get_rr_vs_4face_centers() print(face_centers) Array of face center coordinates
See Also
get_rr_vs_bounary : Separates regular vertices into inner and boundary vertices. get_rr_quadface_boundaryquad_index : Retrieves indices of boundary quad faces.
Source code in src/geometry/quadrings.py
get_rr_vs_4face_corner(self)
Retrieves the corner vertices of regular quad faces.
This function identifies the corner vertices of regular quad faces and returns their indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
corner_vertices |
numpy array
|
The indices of corner vertices of regular quad faces. |
Note
This function assumes that the mesh is a regular mesh. The corner vertices are useful for mesh analysis and processing.
self.rr_star_corner (should be same with get_vs_diagonal_v) vertex star' 4faces' 4 corner vertex [a,b,c,d] a 1 d 2 v 4 b 3 c
See Also
regular_vertex_regular_quad : Identifies regular vertices and quad faces.
Source code in src/geometry/quadrings.py
get_rr_vs_bounary(self)
Separates regular vertices into inner and boundary vertices.
This function identifies which regular vertices are on the boundary and which are in the interior of the mesh.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
inner_indices |
numpy array
|
Indices of regular vertices that are in the interior. |
boundary_indices |
numpy array
|
Indices of regular vertices that are on the boundary. |
Note
This function assumes that the mesh is a regular mesh. The separation of vertices is useful for mesh analysis and processing.
See Also
boundary_vertices : Retrieves the indices of boundary vertices.
Source code in src/geometry/quadrings.py
get_v4_diag_unit_edge(self)
Computes the unit edge vectors for diagonal edges of vertices with valence 4.
This function calculates the unit edge vectors for diagonal edges of vertices with valence 4.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
v |
numpy array
|
The indices of vertices. |
l1, l2, l3, l4 : numpy array
|
The lengths of the diagonal edge vectors. |
|
e1, e2, e3, e4 : numpy array
|
The unit diagonal edge vectors. |
Note
This function assumes that the mesh is a regular mesh. The unit diagonal edge vectors are useful for mesh analysis and processing.
See Also
get_v4_unit_edge : Computes the unit edge vectors for vertices with valence 4.
Source code in src/geometry/quadrings.py
get_v4_diag_unit_tangents(self, plot=False)
Computes the unit tangent vectors for diagonal edges of vertices with valence 4.
This function calculates the unit tangent vectors for diagonal edges of vertices with valence 4, optionally plotting the results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plot
|
(bool, optional(default=False))
|
Whether to plot the tangent vectors. |
False
|
Returns:
Name | Type | Description |
---|---|---|
lt1, lt2 : numpy array
|
The lengths of the tangent vectors. |
|
ut1, ut2 : numpy array
|
The unit tangent vectors. |
|
anchor |
numpy array
|
The anchor points for the tangent vectors. |
angle |
numpy array
|
The angles between the tangent vectors. |
Note
This function assumes that the mesh is a regular mesh. The unit tangent vectors are useful for mesh analysis and processing.
(only for valence 4, not depends on X)
See Also
get_v4_unit_tangents : Computes the unit tangent vectors for vertices with valence 4.
Source code in src/geometry/quadrings.py
get_v4_orient_unit_normal(self, diag=False, rregular=True)
Computes the oriented unit normal vectors for vertices with valence 4.
This function calculates the oriented unit normal vectors for vertices with valence 4, optionally considering diagonal edges and regular vertices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
diag
|
(bool, optional(default=False))
|
Whether to consider diagonal edges. |
False
|
rregular
|
(bool, optional(default=True))
|
Whether to consider regular vertices. |
True
|
Returns:
Name | Type | Description |
---|---|---|
anchor |
numpy array
|
The anchor points for the normal vectors. |
unit_normal |
numpy array
|
The oriented unit normal vectors. |
angle |
numpy array
|
The angles between the normal vectors and the reference direction. |
Note
This function assumes that the mesh is a regular mesh. The oriented unit normal vectors are useful for mesh analysis and processing.
(updated for each time, orientn; defined at rrv4f4)
See Also
get_v4_unit_normal : Computes the unit normal vectors for vertices with valence 4.
Source code in src/geometry/quadrings.py
get_v4_unit_edge(self, rregular=True)
Computes the unit edge vectors for vertices with valence 4.
This function calculates the unit edge vectors for vertices with valence 4, optionally considering regular vertices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rregular
|
(bool, optional(default=True))
|
Whether to consider regular vertices. |
True
|
Returns:
Name | Type | Description |
---|---|---|
v |
numpy array
|
The indices of vertices. |
l1, l2, l3, l4 : numpy array
|
The lengths of the edge vectors. |
|
e1, e2, e3, e4 : numpy array
|
The unit edge vectors. |
Note
This function assumes that the mesh is a regular mesh. The unit edge vectors are useful for mesh analysis and processing.
See Also
get_v4_unit_tangents : Computes the unit tangent vectors for vertices with valence 4.
Source code in src/geometry/quadrings.py
get_v4_unit_normal(self, diag=False, rregular=True)
Computes the unit normal vectors for vertices with valence 4.
This function calculates the unit normal vectors for vertices with valence 4, optionally considering diagonal edges and regular vertices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
diag
|
(bool, optional(default=False))
|
Whether to consider diagonal edges. |
False
|
rregular
|
(bool, optional(default=True))
|
Whether to consider regular vertices. |
True
|
Returns:
Name | Type | Description |
---|---|---|
v |
numpy array
|
The indices of vertices. |
anchor |
numpy array
|
The anchor points for the normal vectors. |
unit_normal |
numpy array
|
The unit normal vectors. |
Note
This function assumes that the mesh is a regular mesh. The unit normal vectors are useful for mesh analysis and processing.
See Also
get_v4_unit_tangents : Computes the unit tangent vectors for vertices with valence 4.
Source code in src/geometry/quadrings.py
get_v4_unit_tangents(self, plot=False, rregular=True)
Computes the unit tangent vectors for vertices with valence 4.
This function calculates the unit tangent vectors for vertices with valence 4, optionally plotting the results and considering regular vertices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
plot
|
(bool, optional(default=False))
|
Whether to plot the tangent vectors. |
False
|
rregular
|
(bool, optional(default=True))
|
Whether to consider regular vertices. |
True
|
Returns:
Name | Type | Description |
---|---|---|
lt1, lt2 : numpy array
|
The lengths of the tangent vectors. |
|
ut1, ut2 : numpy array
|
The unit tangent vectors. |
|
anchor |
numpy array
|
The anchor points for the tangent vectors. |
angle |
numpy array
|
The angles between the tangent vectors. |
Note
This function assumes that the mesh is a regular mesh. The unit tangent vectors are useful for mesh analysis and processing.
(only for vertices of valence 4, not depends on X)
See Also
get_v4_unit_edge : Computes the unit edge vectors for vertices with valence 4.
Source code in src/geometry/quadrings.py
get_v4_unit_normal(self, diag=False, rregular=True)
Computes the unit normal vectors for vertices with valence 4.
This function calculates the unit normal vectors for vertices with valence 4, optionally considering diagonal edges and regular vertices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
diag
|
(bool, optional(default=False))
|
Whether to consider diagonal edges. |
False
|
rregular
|
(bool, optional(default=True))
|
Whether to consider regular vertices. |
True
|
Returns:
Name | Type | Description |
---|---|---|
v |
numpy array
|
The indices of vertices. |
anchor |
numpy array
|
The anchor points for the normal vectors. |
unit_normal |
numpy array
|
The unit normal vectors. |
Note
This function assumes that the mesh is a regular mesh. The unit normal vectors are useful for mesh analysis and processing.
See Also
get_v4_unit_tangents : Computes the unit tangent vectors for vertices with valence 4.
Source code in src/geometry/quadrings.py
Get_Diagonals_of_Multinets(self)
Retrieves the diagonals of multinets in the mesh.
This function identifies and returns the diagonals of multinets in the mesh. It computes the diagonals based on the inner twin half-edges.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
pl1 |
Polyline object
|
The first set of diagonal polylines. |
pl2 |
Polyline object
|
The second set of diagonal polylines. |
Note
This function assumes that the mesh is a regular mesh. The diagonals of multinets are useful for mesh analysis and processing.
See Also
Get_Inner_TwinsHalfedge_Index : Retrieves the indices of inner twin half-edges.
Source code in src/geometry/quadrings.py
Get_Inner_TwinsHalfedge_Index(self)
Retrieves the indices of inner twin half-edges.
This function identifies and returns the indices of inner twin half-edges in the mesh.
goal: find the inner twins halfedges indexes (unrepeatable)
method:
-
give the sequence number of all halfedges;
-
delete the boundary twin halfedges;
-
delete the inner repeated sequence number
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
indices |
numpy array
|
The indices of inner twin half-edges. |
Note
This function assumes that the mesh is a regular mesh. The inner twin half-edges are useful for mesh analysis and processing.
See Also
Get_Diagonals_of_Multinets : Retrieves the diagonals of multinets.
Source code in src/geometry/quadrings.py
3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 |
|
index_of_4quad_face_order_at_regular_vs(self)
Retrieves the indices of quad faces adjacent to regular vertices.
This function identifies the quad faces adjacent to each regular vertex and returns their indices in the quad face list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
indices |
numpy array
|
Indices of quad faces adjacent to each regular vertex. |
Note
This function assumes that the mesh is a regular mesh. The indices are useful for accessing specific quad faces in the mesh.
most strong regular case: regular vertex & regular quads; star = self.rr_star star = star[self.ind_rr_star_v4f4] if1,if2,if3,if4 = self.ind_rr_quadface_order.T
See Also
regular_vertex_regular_quad : Identifies regular vertices and quad faces.
Source code in src/geometry/quadrings.py
index_of_rrquad_face_vertex_with_rrv(self)
Retrieves the indices of vertices in regular quad faces that are also regular vertices.
This function identifies the vertices in regular quad faces that are also regular vertices and returns their indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
indices |
numpy array
|
The indices of vertices in regular quad faces that are also regular vertices. |
Note
This function assumes that the mesh is a regular mesh. The indices are useful for accessing specific vertices in the mesh. self.rr_quadface() may include vertices that are not in rr_star; this one works
See Also
regular_vertex_regular_quad : Identifies regular vertices and quad faces.
Source code in src/geometry/quadrings.py
make_quad_mesh_from_indices(self, V, v1, v2, v3, v4)
Creates a quad mesh from the given vertex indices.
This function constructs a quad mesh using the specified vertex indices and their corresponding positions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
V
|
numpy array
|
The vertex positions. |
required |
v1
|
numpy array
|
The indices of vertices forming the quad faces. |
required |
v2
|
numpy array
|
The indices of vertices forming the quad faces. |
required |
v3
|
numpy array
|
The indices of vertices forming the quad faces. |
required |
v4
|
numpy array
|
The indices of vertices forming the quad faces. |
required |
Returns:
Name | Type | Description |
---|---|---|
quad_mesh |
Mesh object
|
The constructed quad mesh. |
Note
This function assumes that the input indices form valid quad faces. The resulting quad mesh is useful for further analysis and processing.
See Also
get_diagonal_mesh : Creates a diagonal mesh from the current mesh.
Source code in src/geometry/quadrings.py
nonsingular(self)
Identifies non-singular vertices in the mesh.
This function detects vertices with valence 4 (non-singular) and stores their indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Type | Description |
---|---|
None
|
The non-singular vertices are stored within the class instance. |
Note
This function assumes that the mesh is a regular mesh. Non-singular vertices are useful for mesh analysis and processing. nonsingular(=regular) vertices v in increased order
See Also
nonsingular_star_matrix : Creates a star matrix for non-singular vertices.
Source code in src/geometry/quadrings.py
nonsingular_star_matrix(self)
Creates a star matrix for non-singular vertices.
This function constructs a matrix representing the connectivity of non-singular vertices, where each row corresponds to a vertex and its neighboring vertices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
star_matrix |
numpy array
|
The star matrix for non-singular vertices. |
Note
This function assumes that the mesh is a regular mesh. The star matrix is useful for organizing and accessing mesh vertices.
See Also
nonsingular : Identifies non-singular vertices in the mesh.
Source code in src/geometry/quadrings.py
new_vertex_normals(self, is_orient_to_spherecenter=True, is_rrv4f4=True)
Computes the vertex normals of the mesh.
This function calculates the vertex normals and optionally orients them towards the sphere center.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
is_orient_to_spherecenter
|
(bool, optional(default=True))
|
Whether to orient the normals towards the sphere center. |
True
|
is_rrv4f4
|
(bool, optional(default=True))
|
Whether to use the regular vertices and quad faces. |
True
|
Returns:
Name | Type | Description |
---|---|---|
normals |
numpy array
|
The vertex normals of the mesh. |
Note
This function assumes that the mesh is a regular mesh. The vertex normals are useful for mesh analysis and processing. It makes vertex_normals orient non-convex direction
See Also
vertex_normals : Computes the vertex normals of the mesh.
Source code in src/geometry/quadrings.py
1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 |
|
orient(self, S0, A, B, C, D, Nv4)
Orients the mesh based on the given parameters.
This function adjusts the orientation of the mesh by modifying the vertex normals and related parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
S0
|
numpy array
|
The center point of the mesh. |
required |
A
|
numpy array
|
The first parameter for orientation. |
required |
B
|
numpy array
|
The second parameter for orientation. |
required |
C
|
numpy array
|
The third parameter for orientation. |
required |
D
|
numpy array
|
The fourth parameter for orientation. |
required |
Nv4
|
numpy array
|
The normal vectors of the mesh. |
required |
Returns:
Name | Type | Description |
---|---|---|
B |
numpy array
|
The modified second parameter. |
C |
numpy array
|
The modified third parameter. |
D |
numpy array
|
The modified fourth parameter. |
Nv4 |
numpy array
|
The modified normal vectors. |
x_orient |
numpy array
|
The orientation factor. |
Note
This function assumes that the mesh is a regular mesh. The orientation is useful for mesh analysis and processing.
See Also
new_vertex_normals : Computes the vertex normals of the mesh.
Source code in src/geometry/quadrings.py
1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 |
|
quadfaces(self)
Identifies quad faces in the mesh.
This function detects quad faces and stores their indices and connectivity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Type | Description |
---|---|
None
|
The quad faces are stored within the class instance. |
Note
This function assumes that the mesh is a regular mesh. Quad faces are useful for mesh analysis and processing.
See Also
regular_vertex_regular_quad : Identifies regular vertices and quad faces.
Source code in src/geometry/quadrings.py
regular_rectangle_patch(self)
Creates a patch matrix for a regular rectangular mesh.
This function constructs a matrix representing the connectivity of a regular rectangular mesh, where each entry corresponds to a vertex index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Type | Description |
---|---|
None
|
The patch matrix is stored within the class instance. |
Note
This function assumes that the mesh is a regular rectangular patch. The patch matrix is useful for organizing and accessing mesh vertices.
See Also
regular_rotational_patch : Creates a patch matrix for a rotational mesh.
Source code in src/geometry/quadrings.py
regular_rotational_patch(self)
Creates a patch matrix for a regular rotational mesh.
This function constructs a matrix representing the connectivity of a regular rotational mesh, where each entry corresponds to a vertex index.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Type | Description |
---|---|
None
|
The patch matrix is stored within the class instance. |
Note
This function assumes that the mesh is a regular rotational patch. The patch matrix is useful for organizing and accessing mesh vertices.
See Also
regular_rectangle_patch : Creates a patch matrix for a rectangular mesh.
Source code in src/geometry/quadrings.py
regular_vertex_regular_quad(self, delete_multi=True)
This function processes half-edge data structures to identify and organize regular vertices and regular quadrilateral faces in a mesh. It returns structured information about the regular vertices, regular quads, and their connectivity.
The function's main logic involves:
-
Iterating over each vertex to identify oriented quad faces using the half-edge structure.
-
Handling boundary cases where quad faces may be incomplete or partially defined.
-
Optionally deleting multiple faces that overlap, ensuring a unique representation of quad faces.
-
Returning detailed information about regular vertices, regular quads, and their connectivity.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
halfedges
|
numpy int array
|
The half-edge data structure representing the mesh. Each row corresponds to a half-edge with columns representing: [origin vertex, twin half-edge, next half-edge, prev half-edge, face]. |
required |
ver_star_matrix
|
numpy int array
|
A matrix where each row corresponds to a vertex and contains the indices of its neighboring vertices. |
required |
delete_multi
|
bool, optional (default True)
|
whether to deletes multiple overlapping faces to ensure unique quad faces or not. |
True
|
Returns:
Name | Type | Description |
---|---|---|
num_rrf |
int
|
The number of regular quad faces. |
rr_quadface |
numpy int array
|
The regular quad faces, each defined by four vertices. |
rr_quadface_order |
numpy int array
|
The order of the quad faces. |
num_rrv |
int
|
The number of regular vertices. |
rr_star |
numpy int array
|
The star matrix for regular vertices. |
rr_4quad_vers |
list
|
A list of all oriented quad faces, including boundary faces. |
Note:
This function assumes the input mesh is manifold and orientable. It also assumes that the half-edge structure is correctly defined, with each half-edge pointing to its twin, next, and previous half-edges.
See Also:
quadfaces()
Examples:
from quadrings import regular_vertex_regular_quad
num_rrf, rr_quadface, rr_quadface_order, num_rrv, rr_star, rr_4quad_vers = regular_vertex_regular_quad(halfedges, ver_star_matrix)
Source code in src/geometry/quadrings.py
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 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 |
|
vertex_corner_neib(self)
Retrieves the neighbors of corner vertices.
This function identifies the neighbors of corner vertices and returns their indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
left_neighbors |
numpy array
|
Indices of the left neighbors. |
center_neighbors |
numpy array
|
Indices of the center neighbors. |
right_neighbors |
numpy array
|
Indices of the right neighbors. |
Note
This function assumes that the mesh is a regular mesh. The neighbors are useful for mesh analysis and processing.
See Also
vertex_valence3_neib : Retrieves neighbors of vertices with valence 3.
Source code in src/geometry/quadrings.py
vertex_corner_valence3_neib(self)
Retrieves the neighbors of corner vertices with valence 3.
This function identifies the neighbors of corner vertices that have valence 3 and returns their indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
vertices |
numpy array
|
Indices of corner vertices with valence 3. |
left_neighbors |
numpy array
|
Indices of the left neighbors. |
right_neighbors |
numpy array
|
Indices of the right neighbors. |
Note
This function assumes that the mesh is a regular mesh. The neighbors are useful for mesh analysis and processing.
See Also
vertex_valence3_neib : Retrieves neighbors of vertices with valence 3.
Source code in src/geometry/quadrings.py
vertex_valence3_neib(self, boundary_vertex=True, corner=False)
Retrieves the neighbors of vertices with valence 3.
This function identifies the neighbors of vertices that have valence 3 and returns their indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
boundary_vertex
|
(bool, optional(default=True))
|
Whether to consider boundary vertices. |
True
|
corner
|
(bool, optional(default=False))
|
Whether to consider corner vertices. |
False
|
Returns:
Name | Type | Description |
---|---|---|
vertices |
numpy array
|
Indices of vertices with valence 3. |
neighbors |
numpy array
|
Indices of the neighbors. |
Note
This function assumes that the mesh is a regular mesh. The neighbors are useful for mesh analysis and processing.
See Also
boundary_vertex_3neibs : Retrieves neighbors of boundary vertices with valence 3.
Source code in src/geometry/quadrings.py
vertex_valence4_neib(self, corner=True)
Retrieves the neighbors of vertices with valence 4.
This function identifies the neighbors of vertices that have valence 4 and returns their indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
corner
|
(bool, optional(default=True))
|
Whether to consider corner vertices. |
True
|
Returns:
Name | Type | Description |
---|---|---|
vertices |
numpy array
|
Indices of vertices with valence 4. |
neighbors |
numpy array
|
Indices of the neighbors. |
Note
This function assumes that the mesh is a regular mesh. The neighbors are useful for mesh analysis and processing.
v, neib=[v1,v2,v3,v4,va,vb,vc,vd]
See Also
vertex_valence3_neib : Retrieves neighbors of vertices with valence 3.
Source code in src/geometry/quadrings.py
vertex_valence5_neib(self)
Retrieves the neighbors of vertices with valence 5.
This function identifies the neighbors of vertices that have valence 5 and returns their indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
vertices |
numpy array
|
Indices of vertices with valence 5. |
neighbors |
numpy array
|
Indices of the neighbors. |
Note
This function assumes that the mesh is a regular mesh. The neighbors are useful for mesh analysis and processing.
See Also
vertex_valence3_neib : Retrieves neighbors of vertices with valence 3.
Source code in src/geometry/quadrings.py
vertex_valence6_neib(self)
Retrieves the neighbors of vertices with valence 6.
This function identifies the neighbors of vertices that have valence 6 and returns their indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
None
|
The function operates on the mesh data within the class instance. |
required |
Returns:
Name | Type | Description |
---|---|---|
vertices |
numpy array
|
Indices of vertices with valence 6. |
neighbors |
numpy array
|
Indices of the neighbors. |
Note
This function assumes that the mesh is a regular mesh. The neighbors are useful for mesh analysis and processing.
See Also
vertex_valence3_neib : Retrieves neighbors of vertices with valence 3.