Skip to content

models

ContourAlgorithm

Bases: IntEnum

轮廓线建模算法类型

Source code in dimine_python_sdk\lib\exploitation\models.py
113
114
115
116
117
118
119
class ContourAlgorithm(IntEnum):
    """轮廓线建模算法类型"""

    MIN_PERIMETER = 0  # 最小周长法
    MIN_SURFACE_AREA = 1  # 最小表面积法
    SYNC_ADVANCE = 2  # 同步前进法
    MIN_DISTANCE = 3  # 最小距离法

ExtrapolateDirection

Bases: IntEnum

轮廓线外推方向

Source code in dimine_python_sdk\lib\exploitation\models.py
130
131
132
133
134
135
class ExtrapolateDirection(IntEnum):
    """轮廓线外推方向"""

    BOTH = 0  # 两端
    FRONT = 1  # 正侧
    BACK = 2  # 反侧

ExtrapolateMode

Bases: IntEnum

轮廓线外推建模模式

Source code in dimine_python_sdk\lib\exploitation\models.py
122
123
124
125
126
127
class ExtrapolateMode(IntEnum):
    """轮廓线外推建模模式"""

    TIP = 0  # 尖推
    WEDGE = 1  # 楔推
    FLAT = 2  # 平推

ImplicitEstimationParam

Bases: ParamModel

隐式建模估值参数

Source code in dimine_python_sdk\lib\exploitation\models.py
189
190
191
192
193
194
195
196
197
198
199
200
201
class ImplicitEstimationParam(ParamModel):
    """隐式建模估值参数"""

    method: int = Field(default=0, ge=0, description="估值方法")
    kernel_function: int = Field(default=0, ge=0, description="核函数类型")
    reach_point_num: int = Field(default=10, gt=0, description="邻域搜索点数")
    reach: float = Field(default=100.0, gt=0, description="搜索半径")
    function_type: int = Field(default=0, ge=0, description="变差函数类型")
    nugget: float = Field(default=0.0, ge=0, description="块金值")
    sill: float = Field(default=2.0, ge=0, description="基台值")
    range: float = Field(default=10.0, gt=0, description="变程")
    ellipse_rate: float = Field(default=1.0, gt=0, description="椭球各向异性比")
    main_angle: float = Field(default=0.0, description="主方向角(度)")

ImplicitGridParam

Bases: ParamModel

隐式建模网格参数

Source code in dimine_python_sdk\lib\exploitation\models.py
178
179
180
181
182
183
184
185
186
class ImplicitGridParam(ParamModel):
    """隐式建模网格参数"""

    type: int = Field(default=1, ge=0, description="网格类型")
    adaptive: bool = Field(default=True, description="是否自适应网格")
    x_node_num: int = Field(default=81, gt=1, description="X 方向节点数")
    y_node_num: int = Field(default=81, gt=1, description="Y 方向节点数")
    z_node_num: int = Field(default=20, gt=1, description="Z 方向节点数")
    offset: float = Field(default=10.0, ge=0, description="网格外扩距离")

ImplicitStratumDataParam

Bases: ParamModel

隐式地层建模数据参数

示例

ImplicitStratumDataParam( ... drill_file=r"F:\测试数据\建模测试数据\钻孔数据库.dmd", ... layer_table="分层表", ... layer_table_field="地层", ... layer_sequence=["泥盆纪地层", "志留纪地层", "寒武纪地层"], ... )

Source code in dimine_python_sdk\lib\exploitation\models.py
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
173
174
175
class ImplicitStratumDataParam(ParamModel):
    """
    隐式地层建模数据参数

    示例
    ------
    >>> ImplicitStratumDataParam(
    ...     drill_file=r"F:\\测试数据\\建模测试数据\\钻孔数据库.dmd",
    ...     layer_table="分层表",
    ...     layer_table_field="地层",
    ...     layer_sequence=["泥盆纪地层", "志留纪地层", "寒武纪地层"],
    ... )
    """

    drill_file: str = Field(
        ...,
        alias="drill_file",
        description="钻孔数据库文件路径(.dmd)",
    )
    layer_table: str = Field(..., description="分层表名称")
    layer_table_field: str = Field(..., description="分层表中地层字段名称")
    layer_sequence: List[str] = Field(
        ...,
        min_length=1,
        description="地层序列(按建模顺序排列的地层名称,序列化时以逗号连接)",
    )

    @field_validator("layer_sequence", mode="before")
    @classmethod
    def _split_sequence_str(cls, v):
        """兼容直接传入逗号分隔字符串"""
        if isinstance(v, str):
            return [item.strip() for item in v.split(",") if item.strip()]
        return v

    @field_serializer("layer_sequence")
    def _join_sequence(self, v: List[str]) -> str:
        return ",".join(v)

ImplicitStratumModelingParam

Bases: ParamModel

隐式地层建模参数:数据 + 网格 + 估值 + 尖灭厚度

示例

ImplicitStratumModelingParam( ... data=ImplicitStratumDataParam( ... drill_file=r"F:\测试数据\建模测试数据\钻孔数据库.dmd", ... layer_table="分层表", ... layer_table_field="地层", ... layer_sequence=["泥盆纪地层", "志留纪地层", "寒武纪地层"], ... ), ... grid=ImplicitGridParam(x_node_num=81, y_node_num=81, z_node_num=20), ... pinch_thickness=0.1, ... )

Source code in dimine_python_sdk\lib\exploitation\models.py
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
class ImplicitStratumModelingParam(ParamModel):
    """
    隐式地层建模参数:数据 + 网格 + 估值 + 尖灭厚度

    示例
    ------
    >>> ImplicitStratumModelingParam(
    ...     data=ImplicitStratumDataParam(
    ...         drill_file=r"F:\\测试数据\\建模测试数据\\钻孔数据库.dmd",
    ...         layer_table="分层表",
    ...         layer_table_field="地层",
    ...         layer_sequence=["泥盆纪地层", "志留纪地层", "寒武纪地层"],
    ...     ),
    ...     grid=ImplicitGridParam(x_node_num=81, y_node_num=81, z_node_num=20),
    ...     pinch_thickness=0.1,
    ... )
    """

    data: ImplicitStratumDataParam = Field(..., description="数据参数")
    grid: ImplicitGridParam = Field(
        default_factory=ImplicitGridParam, description="网格参数"
    )
    estimation: ImplicitEstimationParam = Field(
        default_factory=ImplicitEstimationParam, description="估值参数"
    )
    pinch_thickness: float = Field(default=0.1, ge=0, description="尖灭厚度")

LanewayParam

Bases: ParamModel

巷道/竖井建模参数:断面 + 中心线 + 生成选项

示例

LanewayParam( ... section=SectionParam(type=0, width=2.0, wall_height=1.0), ... polylines_set=[ ... [["1", "2", "0"], ["2", "4", "0"], ["3", "6", "0"]], ... [["2", "1", "3"], ["4", "2", "3"], ["6", "3", "3"]], ... ], ... close=False, ... connectivity=False, ... method=0, ... bottom_contour=False, ... )

竖井建模示例

LanewayParam( ... section=SectionParam(type=0, width=2.0, wall_height=1.0), ... polylines_set=[[["0", "0", "0"], ["0", "0", "10"]]], ... shaft=True, ... angle=45.0, ... )

Source code in dimine_python_sdk\lib\exploitation\models.py
 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
class LanewayParam(ParamModel):
    """
    巷道/竖井建模参数:断面 + 中心线 + 生成选项

    示例
    ------
    >>> LanewayParam(
    ...     section=SectionParam(type=0, width=2.0, wall_height=1.0),
    ...     polylines_set=[
    ...         [["1", "2", "0"], ["2", "4", "0"], ["3", "6", "0"]],
    ...         [["2", "1", "3"], ["4", "2", "3"], ["6", "3", "3"]],
    ...     ],
    ...     close=False,
    ...     connectivity=False,
    ...     method=0,
    ...     bottom_contour=False,
    ... )

    竖井建模示例
    ------------
    >>> LanewayParam(
    ...     section=SectionParam(type=0, width=2.0, wall_height=1.0),
    ...     polylines_set=[[["0", "0", "0"], ["0", "0", "10"]]],
    ...     shaft=True,
    ...     angle=45.0,
    ... )
    """

    section: SectionParam = Field(..., description="断面信息")
    polylines_set: List[List[List[float]] | Line] = Field(
        default_factory=list,
        description="中心线集合,三维折线顶点列表的列表",
    )

    @field_validator("polylines_set", mode="before")
    @classmethod
    def _convert_line_to_list(cls, v):
        if not isinstance(v, list):
            return v
        result = []
        for item in v:
            if isinstance(item, Line):
                result.append(item.geometry.tolist())
            else:
                result.append(item)
        return result
    close: bool = Field(default=False, description="是否封口,即巷道的尽头是否封口")
    connectivity: bool = Field(default=False, description="是否联通建模,即巷道交叉口是否自动联通起来")
    method: int = Field(
        default=0,
        ge=0,
        le=2,
        description="生成模式:0整体连接 1拐点分离 2顶墙分离(非联通时用)",
    )
    bottom_contour: bool = Field(default=False, description="是否为底部轮廓线(联通时用)")
    shaft: bool = Field(
        default=False,
        description="是否为竖井,true=竖井,false=巷道",
    )
    angle: float = Field(
        default=0.0,
        ge=0,
        lt=360,
        description="竖井水平旋转角度(度),范围 0~360",
    )

SectionParam

Bases: ParamModel

巷道断面参数

示例

SectionParam( ... type=0, ... width=2.0, ... width_up=2.0, ... wall_height=1.0, ... wide_arch_ratio=3, ... offset_x=0, ... offset_y=0, ... point_count=20, ... )

Source code in dimine_python_sdk\lib\exploitation\models.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
class SectionParam(ParamModel):
    """
    巷道断面参数

    示例
    ------
    >>> SectionParam(
    ...     type=0,
    ...     width=2.0,
    ...     width_up=2.0,
    ...     wall_height=1.0,
    ...     wide_arch_ratio=3,
    ...     offset_x=0,
    ...     offset_y=0,
    ...     point_count=20,
    ... )
    """

    type: int = Field(
        ...,
        ge=0,
        le=6,
        description="断面类型:0矩形拱 1梯形拱 2圆形拱 3圆弧拱 4三心拱 5六边形拱 6自定义断面",
    )
    width: float = Field(..., gt=0, description="下宽度")
    width_up: float = Field(default=0.0, description="上宽度")
    wall_height: float = Field(..., gt=0, description="墙高。竖井也有墙高")
    wide_arch_ratio: int = Field(
        default=2,
        ge=1,
        description="宽度/拱高比",
    )
    offset_x: float = Field(default=0.0, description="X轴偏移")
    offset_y: float = Field(default=0.0, description="Y轴偏移")
    point_count: int = Field(default=20, gt=0, description="轮廓采集点数")