coordinate-system 2.4.2__cp313-cp313-win_amd64.whl → 2.5.1__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- coordinate_system/__init__.py +48 -24
- coordinate_system/coordinate_system.cp313-win_amd64.pyd +0 -0
- coordinate_system/curvature.py +38 -14
- coordinate_system/differential_geometry.py +302 -591
- coordinate_system/intrinsic_gradient_curvature.py +533 -0
- {coordinate_system-2.4.2.dist-info → coordinate_system-2.5.1.dist-info}/METADATA +3 -3
- coordinate_system-2.5.1.dist-info/RECORD +11 -0
- coordinate_system-2.4.2.dist-info/RECORD +0 -10
- {coordinate_system-2.4.2.dist-info → coordinate_system-2.5.1.dist-info}/LICENSE +0 -0
- {coordinate_system-2.4.2.dist-info → coordinate_system-2.5.1.dist-info}/WHEEL +0 -0
- {coordinate_system-2.4.2.dist-info → coordinate_system-2.5.1.dist-info}/top_level.txt +0 -0
coordinate_system/__init__.py
CHANGED
|
@@ -4,65 +4,89 @@ from .coordinate_system import vec3, vec2
|
|
|
4
4
|
from .coordinate_system import quat
|
|
5
5
|
from .coordinate_system import coord3
|
|
6
6
|
|
|
7
|
-
# Differential geometry module (
|
|
7
|
+
# Differential geometry module (v3.0.0+)
|
|
8
8
|
from .differential_geometry import (
|
|
9
9
|
# Classes
|
|
10
10
|
Surface,
|
|
11
11
|
Sphere,
|
|
12
12
|
Torus,
|
|
13
13
|
MetricTensor,
|
|
14
|
-
|
|
14
|
+
IntrinsicGradientOperator,
|
|
15
|
+
IntrinsicGradientCurvatureCalculator,
|
|
15
16
|
|
|
16
17
|
# Main functions
|
|
17
|
-
compute_metric,
|
|
18
|
-
compute_connection,
|
|
19
|
-
compute_curvature_tensor,
|
|
20
|
-
compute_gaussian_curvature,
|
|
21
|
-
|
|
22
|
-
# Aliases
|
|
23
|
-
compute_frame_derivative,
|
|
24
18
|
compute_intrinsic_gradient,
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
compute_gaussian_curvature,
|
|
20
|
+
compute_curvature_tensor,
|
|
21
|
+
compute_all_curvatures,
|
|
27
22
|
)
|
|
28
23
|
|
|
29
24
|
# High-precision curvature computation module (v2.3.0+)
|
|
30
25
|
from .curvature import (
|
|
31
|
-
#
|
|
26
|
+
# Classical method
|
|
32
27
|
CurvatureCalculator,
|
|
33
|
-
|
|
34
|
-
# Simplified functions
|
|
35
28
|
gaussian_curvature,
|
|
36
29
|
mean_curvature,
|
|
37
30
|
principal_curvatures,
|
|
38
31
|
all_curvatures,
|
|
39
32
|
|
|
33
|
+
# Lie group method
|
|
34
|
+
LieGroupCurvatureCalculator,
|
|
35
|
+
gaussian_curvature_lie,
|
|
36
|
+
compare_methods,
|
|
37
|
+
|
|
40
38
|
# Utility functions
|
|
41
39
|
derivative_5pt,
|
|
42
40
|
derivative_2nd_5pt,
|
|
43
41
|
richardson_extrapolation,
|
|
44
42
|
)
|
|
45
43
|
|
|
44
|
+
# Intrinsic Gradient Operator method (v2.4.0+)
|
|
45
|
+
from .intrinsic_gradient_curvature import (
|
|
46
|
+
IntrinsicGradientOperator,
|
|
47
|
+
IntrinsicGradientCurvatureCalculator,
|
|
48
|
+
intrinsic_gradient_gaussian_curvature,
|
|
49
|
+
intrinsic_gradient_mean_curvature,
|
|
50
|
+
intrinsic_gradient_principal_curvatures,
|
|
51
|
+
intrinsic_gradient_all_curvatures,
|
|
52
|
+
)
|
|
53
|
+
|
|
46
54
|
__all__ = [
|
|
55
|
+
# Constants
|
|
56
|
+
'ZERO3','UNITX','UNITY','UNITZ','ONE3','ONE4','ONEC',
|
|
57
|
+
|
|
47
58
|
# Core types
|
|
48
59
|
'vec3', 'vec2', 'quat', 'coord3', 'lerp',
|
|
49
60
|
|
|
50
|
-
# Differential geometry classes (
|
|
61
|
+
# Differential geometry classes (v3.0.0+)
|
|
51
62
|
'Surface', 'Sphere', 'Torus',
|
|
52
|
-
'MetricTensor', '
|
|
63
|
+
'MetricTensor', 'IntrinsicGradientOperator', 'IntrinsicGradientCurvatureCalculator',
|
|
53
64
|
|
|
54
|
-
# Differential geometry functions (
|
|
55
|
-
'
|
|
56
|
-
'
|
|
65
|
+
# Differential geometry functions (v3.0.0+)
|
|
66
|
+
'compute_intrinsic_gradient',
|
|
67
|
+
'compute_gaussian_curvature',
|
|
68
|
+
'compute_curvature_tensor',
|
|
69
|
+
'compute_all_curvatures',
|
|
57
70
|
|
|
58
|
-
#
|
|
59
|
-
'compute_frame_derivative', 'compute_intrinsic_gradient',
|
|
60
|
-
'compute_geometric_gradient', 'compute_metric_tensor',
|
|
61
|
-
|
|
62
|
-
# High-precision curvature module (v2.3.0+)
|
|
71
|
+
# High-precision curvature module - Classical method (v2.3.0+)
|
|
63
72
|
'CurvatureCalculator',
|
|
64
73
|
'gaussian_curvature', 'mean_curvature',
|
|
65
74
|
'principal_curvatures', 'all_curvatures',
|
|
75
|
+
|
|
76
|
+
# Lie group method (v2.3.0+)
|
|
77
|
+
'LieGroupCurvatureCalculator',
|
|
78
|
+
'gaussian_curvature_lie',
|
|
79
|
+
'compare_methods',
|
|
80
|
+
|
|
81
|
+
# Intrinsic Gradient Operator method (v2.4.0+)
|
|
82
|
+
'IntrinsicGradientOperator',
|
|
83
|
+
'IntrinsicGradientCurvatureCalculator',
|
|
84
|
+
'intrinsic_gradient_gaussian_curvature',
|
|
85
|
+
'intrinsic_gradient_mean_curvature',
|
|
86
|
+
'intrinsic_gradient_principal_curvatures',
|
|
87
|
+
'intrinsic_gradient_all_curvatures',
|
|
88
|
+
|
|
89
|
+
# Utility functions
|
|
66
90
|
'derivative_5pt', 'derivative_2nd_5pt', 'richardson_extrapolation',
|
|
67
91
|
]
|
|
68
92
|
|
|
Binary file
|
coordinate_system/curvature.py
CHANGED
|
@@ -12,13 +12,19 @@ Features:
|
|
|
12
12
|
- Principal directions
|
|
13
13
|
- Convergence analysis
|
|
14
14
|
- Richardson extrapolation
|
|
15
|
+
- Intrinsic Gradient Operator method (NEW)
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
Methods Available:
|
|
18
|
+
1. Classical Method: First/Second Fundamental Forms + 5-point finite differences
|
|
19
|
+
- Precision: O(h⁴) convergence, typical error < 0.001%
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
2. Intrinsic Gradient Operator Method: G_μ = (c(u+h) - c(u))/h
|
|
22
|
+
- Based on coordinate system changes analysis
|
|
23
|
+
- Numerically stable and geometrically intuitive
|
|
24
|
+
|
|
25
|
+
Author: PanGuoJun
|
|
26
|
+
Version: 2.4.0
|
|
27
|
+
Date: 2025-10-30
|
|
22
28
|
"""
|
|
23
29
|
|
|
24
30
|
import numpy as np
|
|
@@ -27,9 +33,10 @@ from .differential_geometry import Surface
|
|
|
27
33
|
from .coordinate_system import coord3, vec3
|
|
28
34
|
from .differential_geometry import (
|
|
29
35
|
MetricTensor,
|
|
30
|
-
|
|
36
|
+
IntrinsicGradientOperator,
|
|
37
|
+
IntrinsicGradientCurvatureCalculator,
|
|
31
38
|
compute_curvature_tensor as compute_curvature_tensor_lie,
|
|
32
|
-
|
|
39
|
+
compute_all_curvatures as compute_all_curvatures_intrinsic
|
|
33
40
|
)
|
|
34
41
|
|
|
35
42
|
|
|
@@ -588,7 +595,7 @@ class LieGroupCurvatureCalculator:
|
|
|
588
595
|
)
|
|
589
596
|
|
|
590
597
|
# Compute metric tensor
|
|
591
|
-
g =
|
|
598
|
+
g = MetricTensor.from_surface(self.surface, u, v)
|
|
592
599
|
|
|
593
600
|
# Extract Gaussian curvature using antisymmetric part
|
|
594
601
|
# K = R_{12}^{antisym} / det(g) = (R_01 - R_10)/2 / det(g)
|
|
@@ -644,14 +651,12 @@ class LieGroupCurvatureCalculator:
|
|
|
644
651
|
self.surface.h = self.h
|
|
645
652
|
|
|
646
653
|
try:
|
|
647
|
-
# Compute
|
|
648
|
-
|
|
654
|
+
# Compute intrinsic gradient operators
|
|
655
|
+
intrinsic_op = IntrinsicGradientOperator(
|
|
649
656
|
self.surface,
|
|
650
|
-
self.scale_factor,
|
|
651
|
-
self.use_metric_correction,
|
|
652
657
|
self.h
|
|
653
658
|
)
|
|
654
|
-
G_u, G_v =
|
|
659
|
+
G_u, G_v = intrinsic_op.compute_both(u, v)
|
|
655
660
|
|
|
656
661
|
# Compute curvature tensor
|
|
657
662
|
R_uv = compute_curvature_tensor_lie(
|
|
@@ -662,7 +667,7 @@ class LieGroupCurvatureCalculator:
|
|
|
662
667
|
)
|
|
663
668
|
|
|
664
669
|
# Compute metric
|
|
665
|
-
g =
|
|
670
|
+
g = MetricTensor.from_surface(self.surface, u, v)
|
|
666
671
|
|
|
667
672
|
# Extract Gaussian curvature using antisymmetric part
|
|
668
673
|
# K = (R_01 - R_10)/2 / det(g)
|
|
@@ -778,6 +783,17 @@ def gaussian_curvature_lie(
|
|
|
778
783
|
return calc.compute_gaussian_curvature(u, v)
|
|
779
784
|
|
|
780
785
|
|
|
786
|
+
# ========== Intrinsic Gradient Operator Method ==========
|
|
787
|
+
# Import from the new module
|
|
788
|
+
from .intrinsic_gradient_curvature import (
|
|
789
|
+
IntrinsicGradientOperator,
|
|
790
|
+
IntrinsicGradientCurvatureCalculator,
|
|
791
|
+
intrinsic_gradient_gaussian_curvature,
|
|
792
|
+
intrinsic_gradient_mean_curvature,
|
|
793
|
+
intrinsic_gradient_principal_curvatures,
|
|
794
|
+
intrinsic_gradient_all_curvatures,
|
|
795
|
+
)
|
|
796
|
+
|
|
781
797
|
# ========== Export ==========
|
|
782
798
|
|
|
783
799
|
__all__ = [
|
|
@@ -793,6 +809,14 @@ __all__ = [
|
|
|
793
809
|
'gaussian_curvature_lie',
|
|
794
810
|
'compare_methods',
|
|
795
811
|
|
|
812
|
+
# Intrinsic Gradient Operator method
|
|
813
|
+
'IntrinsicGradientOperator',
|
|
814
|
+
'IntrinsicGradientCurvatureCalculator',
|
|
815
|
+
'intrinsic_gradient_gaussian_curvature',
|
|
816
|
+
'intrinsic_gradient_mean_curvature',
|
|
817
|
+
'intrinsic_gradient_principal_curvatures',
|
|
818
|
+
'intrinsic_gradient_all_curvatures',
|
|
819
|
+
|
|
796
820
|
# Utility functions
|
|
797
821
|
'derivative_5pt',
|
|
798
822
|
'derivative_2nd_5pt',
|