dimine-python-sdk 0.1.8__py3-none-any.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.
- dimine_python_sdk/__init__.py +13 -0
- dimine_python_sdk/conn/__init__.py +5 -0
- dimine_python_sdk/conn/base_conn_client.py +167 -0
- dimine_python_sdk/conn/conn_client.py +382 -0
- dimine_python_sdk/docs/guides/data_edit.md +306 -0
- dimine_python_sdk/docs/guides/data_get.md +266 -0
- dimine_python_sdk/docs/guides/data_types.md +152 -0
- dimine_python_sdk/docs/guides/features.md +271 -0
- dimine_python_sdk/docs/guides/io.md +157 -0
- dimine_python_sdk/docs/index.md +41 -0
- dimine_python_sdk/docs/quickstart.md +45 -0
- dimine_python_sdk/docs/reference/SUMMARY.md +19 -0
- dimine_python_sdk/docs/reference/conn/base_conn_client.md +3 -0
- dimine_python_sdk/docs/reference/conn/conn_client.md +3 -0
- dimine_python_sdk/docs/reference/lib/algorithm/model_func.md +3 -0
- dimine_python_sdk/docs/reference/lib/io/file_conversion.md +3 -0
- dimine_python_sdk/docs/reference/lib/io/models.md +3 -0
- dimine_python_sdk/docs/reference/lib/io/project_plotting.md +3 -0
- dimine_python_sdk/docs/reference/lib/prospecting/block_data.md +3 -0
- dimine_python_sdk/docs/reference/lib/prospecting/drill_db.md +3 -0
- dimine_python_sdk/docs/reference/lib/prospecting/models.md +3 -0
- dimine_python_sdk/docs/reference/lib/prospecting/valuation.md +3 -0
- dimine_python_sdk/docs/reference/lib/types/entity.md +3 -0
- dimine_python_sdk/docs/reference/lib/types/line.md +3 -0
- dimine_python_sdk/docs/reference/lib/types/point.md +3 -0
- dimine_python_sdk/docs/reference/logger.md +3 -0
- dimine_python_sdk/docs/reference/models/conn.md +3 -0
- dimine_python_sdk/docs/reference/models/errors.md +3 -0
- dimine_python_sdk/docs/reference/models/types.md +3 -0
- dimine_python_sdk/docs/summary.md +6 -0
- dimine_python_sdk/lib/__init__.py +20 -0
- dimine_python_sdk/lib/algorithm/__init__.py +1 -0
- dimine_python_sdk/lib/algorithm/model_func.py +219 -0
- dimine_python_sdk/lib/exploitation/__init__.py +0 -0
- dimine_python_sdk/lib/io/__init__.py +2 -0
- dimine_python_sdk/lib/io/file_conversion.py +143 -0
- dimine_python_sdk/lib/io/models.py +180 -0
- dimine_python_sdk/lib/io/project_plotting.py +40 -0
- dimine_python_sdk/lib/prospecting/__init__.py +3 -0
- dimine_python_sdk/lib/prospecting/block_data.py +289 -0
- dimine_python_sdk/lib/prospecting/drill_db.py +333 -0
- dimine_python_sdk/lib/prospecting/models.py +276 -0
- dimine_python_sdk/lib/prospecting/valuation.py +113 -0
- dimine_python_sdk/lib/types/__init__.py +4 -0
- dimine_python_sdk/lib/types/entity.py +957 -0
- dimine_python_sdk/lib/types/line.py +188 -0
- dimine_python_sdk/lib/types/point.py +695 -0
- dimine_python_sdk/logger.py +7 -0
- dimine_python_sdk/models/__init__.py +3 -0
- dimine_python_sdk/models/conn.py +53 -0
- dimine_python_sdk/models/errors.py +4 -0
- dimine_python_sdk/models/types.py +131 -0
- dimine_python_sdk/site/404.html +671 -0
- dimine_python_sdk/site/assets/_mkdocstrings.css +237 -0
- dimine_python_sdk/site/assets/images/favicon.png +0 -0
- dimine_python_sdk/site/assets/javascripts/bundle.79ae519e.min.js +16 -0
- dimine_python_sdk/site/assets/javascripts/bundle.79ae519e.min.js.map +7 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.ar.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.da.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.de.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.du.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.el.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.es.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.fi.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.fr.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.he.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.hi.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.hu.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.hy.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.it.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.ja.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.jp.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.kn.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.ko.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.multi.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.nl.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.no.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.pt.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.ro.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.ru.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.sa.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.stemmer.support.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.sv.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.ta.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.te.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.th.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.tr.min.js +18 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.vi.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/min/lunr.zh.min.js +1 -0
- dimine_python_sdk/site/assets/javascripts/lunr/tinyseg.js +206 -0
- dimine_python_sdk/site/assets/javascripts/lunr/wordcut.js +6708 -0
- dimine_python_sdk/site/assets/javascripts/workers/search.2c215733.min.js +42 -0
- dimine_python_sdk/site/assets/javascripts/workers/search.2c215733.min.js.map +7 -0
- dimine_python_sdk/site/assets/stylesheets/main.484c7ddc.min.css +1 -0
- dimine_python_sdk/site/assets/stylesheets/main.484c7ddc.min.css.map +1 -0
- dimine_python_sdk/site/assets/stylesheets/palette.ab4e12ef.min.css +1 -0
- dimine_python_sdk/site/assets/stylesheets/palette.ab4e12ef.min.css.map +1 -0
- dimine_python_sdk/site/guides/data_edit.html +1251 -0
- dimine_python_sdk/site/guides/data_get.html +1206 -0
- dimine_python_sdk/site/guides/data_types.html +1529 -0
- dimine_python_sdk/site/guides/features.html +1217 -0
- dimine_python_sdk/site/guides/io.html +1025 -0
- dimine_python_sdk/site/index.html +849 -0
- dimine_python_sdk/site/objects.inv +0 -0
- dimine_python_sdk/site/quickstart.html +859 -0
- dimine_python_sdk/site/reference/SUMMARY.html +729 -0
- dimine_python_sdk/site/reference/conn/base_conn_client.html +1295 -0
- dimine_python_sdk/site/reference/conn/conn_client.html +3551 -0
- dimine_python_sdk/site/reference/lib/algorithm/model_func.html +2162 -0
- dimine_python_sdk/site/reference/lib/io/file_conversion.html +1725 -0
- dimine_python_sdk/site/reference/lib/io/models.html +1625 -0
- dimine_python_sdk/site/reference/lib/io/project_plotting.html +984 -0
- dimine_python_sdk/site/reference/lib/prospecting/block_data.html +2455 -0
- dimine_python_sdk/site/reference/lib/prospecting/drill_db.html +2836 -0
- dimine_python_sdk/site/reference/lib/prospecting/models.html +2309 -0
- dimine_python_sdk/site/reference/lib/prospecting/valuation.html +1373 -0
- dimine_python_sdk/site/reference/lib/types/entity.html +6728 -0
- dimine_python_sdk/site/reference/lib/types/line.html +1985 -0
- dimine_python_sdk/site/reference/lib/types/point.html +3672 -0
- dimine_python_sdk/site/reference/logger.html +751 -0
- dimine_python_sdk/site/reference/models/conn.html +751 -0
- dimine_python_sdk/site/reference/models/errors.html +802 -0
- dimine_python_sdk/site/reference/models/types.html +1679 -0
- dimine_python_sdk/site/search/search_index.json +1 -0
- dimine_python_sdk/site/sitemap.xml +107 -0
- dimine_python_sdk/site/sitemap.xml.gz +0 -0
- dimine_python_sdk/site/summary.html +697 -0
- dimine_python_sdk-0.1.8.dist-info/METADATA +15 -0
- dimine_python_sdk-0.1.8.dist-info/RECORD +135 -0
- dimine_python_sdk-0.1.8.dist-info/WHEEL +5 -0
- dimine_python_sdk-0.1.8.dist-info/top_level.txt +2 -0
- tests/conn_test.py +250 -0
- tests/test_base_type.py +143 -0
- tests/ws_client.py +60 -0
- tests/ws_server.py +271 -0
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import DmPyBindInterface as Dm
|
|
2
|
+
from dimine_python_sdk.lib.types.point import DmDPoint
|
|
3
|
+
|
|
4
|
+
#线实体
|
|
5
|
+
class DmDbLine:
|
|
6
|
+
"""线类型"""
|
|
7
|
+
def __init__(self):
|
|
8
|
+
"""构造函数,初始化数据库线对象"""
|
|
9
|
+
self._obj = Dm.dmDbLine()
|
|
10
|
+
|
|
11
|
+
def get_graph_data(self) -> list[DmDPoint]:
|
|
12
|
+
"""
|
|
13
|
+
获取该线的图形数据(起点和终点)
|
|
14
|
+
:return: 包含起点和终点的列表,每个元素为DmDPoint实例
|
|
15
|
+
|
|
16
|
+
example:
|
|
17
|
+
```python
|
|
18
|
+
line = DmDbLine()
|
|
19
|
+
graph_data = line.get_graph_data()
|
|
20
|
+
print("线的起点:", graph_data[0])
|
|
21
|
+
print("线的终点:", graph_data[1])
|
|
22
|
+
```
|
|
23
|
+
"""
|
|
24
|
+
cpp_list = self._obj.GetGraphData()
|
|
25
|
+
return [DmDPoint._from_obj(item) for item in cpp_list]
|
|
26
|
+
|
|
27
|
+
@classmethod
|
|
28
|
+
def _from_obj(cls, obj):
|
|
29
|
+
"""
|
|
30
|
+
:param obj: 原生dmDbLine对象
|
|
31
|
+
:return: DmDbLine实例
|
|
32
|
+
"""
|
|
33
|
+
instance = cls.__new__(cls)
|
|
34
|
+
instance._obj = obj
|
|
35
|
+
return instance
|
|
36
|
+
|
|
37
|
+
#三维多段线实体
|
|
38
|
+
class DmDbPolyline:
|
|
39
|
+
"""三维多段线类型"""
|
|
40
|
+
|
|
41
|
+
def __init__(self):
|
|
42
|
+
"""
|
|
43
|
+
构造函数
|
|
44
|
+
:return: None
|
|
45
|
+
"""
|
|
46
|
+
self._obj = Dm.dmDbPolyline()
|
|
47
|
+
|
|
48
|
+
def get_graph_data(self) -> list[DmDPoint]:
|
|
49
|
+
"""
|
|
50
|
+
获取多段线的所有顶点坐标
|
|
51
|
+
:return: 顶点列表,每个元素为DmDPoint实例
|
|
52
|
+
|
|
53
|
+
example:
|
|
54
|
+
```python
|
|
55
|
+
polyline = DmDbPolyline()
|
|
56
|
+
graph_data = polyline.get_graph_data()
|
|
57
|
+
for point in graph_data:
|
|
58
|
+
print(point)
|
|
59
|
+
```
|
|
60
|
+
"""
|
|
61
|
+
cpp_list = self._obj.GetGraphData()
|
|
62
|
+
return [DmDPoint._from_obj(item) for item in cpp_list]
|
|
63
|
+
|
|
64
|
+
def __repr__(self) -> str:
|
|
65
|
+
"""
|
|
66
|
+
字符串表示
|
|
67
|
+
:return: 多段线的标准字符串表示
|
|
68
|
+
"""
|
|
69
|
+
return self._obj.__repr__()
|
|
70
|
+
|
|
71
|
+
def set_color(self, red: int, green: int, blue: int) -> None:
|
|
72
|
+
"""
|
|
73
|
+
设置多段线的颜色
|
|
74
|
+
:param red: 红色分量(0-255)
|
|
75
|
+
:param green: 绿色分量(0-255)
|
|
76
|
+
:param blue: 蓝色分量(0-255)
|
|
77
|
+
:return: None
|
|
78
|
+
|
|
79
|
+
example:
|
|
80
|
+
```python
|
|
81
|
+
polyline = DmDbPolyline()
|
|
82
|
+
polyline.set_color(255, 0, 0) # 设置为红色
|
|
83
|
+
```
|
|
84
|
+
"""
|
|
85
|
+
self._obj.SetColor(red, green, blue)
|
|
86
|
+
|
|
87
|
+
def is_closed(self, tolerance: float = 1e-10) -> bool:
|
|
88
|
+
"""
|
|
89
|
+
判断多段线是否闭合(起点与终点在容差范围内重合)
|
|
90
|
+
:param tolerance: 浮点容差阈值,默认1e-10
|
|
91
|
+
:return: 闭合返回True,否则返回False
|
|
92
|
+
|
|
93
|
+
example:
|
|
94
|
+
```python
|
|
95
|
+
polyline = DmDbPolyline()
|
|
96
|
+
is_closed = polyline.is_closed()
|
|
97
|
+
if is_closed:
|
|
98
|
+
print("多段线闭合")
|
|
99
|
+
else:
|
|
100
|
+
print("多段线不闭合")
|
|
101
|
+
```
|
|
102
|
+
"""
|
|
103
|
+
return self._obj.IsClosed(tolerance)
|
|
104
|
+
|
|
105
|
+
@classmethod
|
|
106
|
+
def _from_obj(cls, obj):
|
|
107
|
+
"""
|
|
108
|
+
:param obj: 原生dmDbPolyline对象
|
|
109
|
+
:return: DmDbPolyline实例
|
|
110
|
+
"""
|
|
111
|
+
instance = cls.__new__(cls)
|
|
112
|
+
instance._obj = obj
|
|
113
|
+
return instance
|
|
114
|
+
|
|
115
|
+
#矩阵变换
|
|
116
|
+
class DmMatrix4x4:
|
|
117
|
+
"""二次封装dmMatrix4x4New类"""
|
|
118
|
+
def __init__(self):
|
|
119
|
+
"""构造函数,初始化4x4矩阵"""
|
|
120
|
+
self._obj = Dm.dmMatrix4x4()
|
|
121
|
+
|
|
122
|
+
def align_coord_sys(
|
|
123
|
+
self,
|
|
124
|
+
from_origin: DmDPoint,
|
|
125
|
+
from_x_axis: DmDPoint,
|
|
126
|
+
from_y_axis: DmDPoint,
|
|
127
|
+
from_z_axis: DmDPoint,
|
|
128
|
+
to_origin: DmDPoint,
|
|
129
|
+
to_x_axis: DmDPoint,
|
|
130
|
+
to_y_axis: DmDPoint,
|
|
131
|
+
to_z_axis: DmDPoint
|
|
132
|
+
) -> None:
|
|
133
|
+
"""
|
|
134
|
+
对齐坐标系,将一个坐标系映射到另一个坐标系
|
|
135
|
+
:param from_origin: 源坐标系原点(DmDPoint实例)
|
|
136
|
+
:param from_x_axis: 源坐标系X轴方向(DmDPoint实例)
|
|
137
|
+
:param from_y_axis: 源坐标系Y轴方向(DmDPoint实例)
|
|
138
|
+
:param from_z_axis: 源坐标系Z轴方向(DmDPoint实例)
|
|
139
|
+
:param to_origin: 目标坐标系原点(DmDPoint实例)
|
|
140
|
+
:param to_x_axis: 目标坐标系X轴方向(DmDPoint实例)
|
|
141
|
+
:param to_y_axis: 目标坐标系Y轴方向(DmDPoint实例)
|
|
142
|
+
:param to_z_axis: 目标坐标系Z轴方向(DmDPoint实例)
|
|
143
|
+
:return: None
|
|
144
|
+
|
|
145
|
+
example:
|
|
146
|
+
```python
|
|
147
|
+
matrix = DmMatrix4x4()
|
|
148
|
+
matrix.align_coord_sys(
|
|
149
|
+
from_origin=DmDPoint(0, 0, 0),
|
|
150
|
+
from_x_axis=DmDPoint(1, 0, 0),
|
|
151
|
+
from_y_axis=DmDPoint(0, 1, 0),
|
|
152
|
+
from_z_axis=DmDPoint(0, 0, 1),
|
|
153
|
+
to_origin=DmDPoint(100, 100, 100),
|
|
154
|
+
to_x_axis=DmDPoint(0, 0, 1),
|
|
155
|
+
to_y_axis=DmDPoint(0, 1, 0),
|
|
156
|
+
to_z_axis=DmDPoint(1, 0, 0)
|
|
157
|
+
)
|
|
158
|
+
```
|
|
159
|
+
"""
|
|
160
|
+
self._obj.AlignCoordSys(
|
|
161
|
+
from_origin._obj,
|
|
162
|
+
from_x_axis._obj,
|
|
163
|
+
from_y_axis._obj,
|
|
164
|
+
from_z_axis._obj,
|
|
165
|
+
to_origin._obj,
|
|
166
|
+
to_x_axis._obj,
|
|
167
|
+
to_y_axis._obj,
|
|
168
|
+
to_z_axis._obj
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
def transform_point(self, pt_source: DmDPoint) -> DmDPoint:
|
|
172
|
+
"""
|
|
173
|
+
对三维点应用矩阵变换
|
|
174
|
+
:param pt_source: 待变换的源点(DmDPoint实例)
|
|
175
|
+
:return: 变换后的点(DmDPoint实例)
|
|
176
|
+
|
|
177
|
+
example:
|
|
178
|
+
```python
|
|
179
|
+
matrix = DmMatrix4x4()
|
|
180
|
+
pt = DmDPoint(1, 2, 3)
|
|
181
|
+
transformed_pt = matrix.transform_point(pt)
|
|
182
|
+
print("变换后的点:", transformed_pt)
|
|
183
|
+
```
|
|
184
|
+
"""
|
|
185
|
+
cpp_result = self._obj.TransformPoint(pt_source._obj)
|
|
186
|
+
result = DmDPoint()
|
|
187
|
+
result._obj = cpp_result
|
|
188
|
+
return result
|