在3DEC5.2的内置FISH函数中,提供了一些实用性函数,包括FFT变换函数、积分求导函数、计算反应谱函数等等,这些我原来在3DEC 中的常用内置实用FISH函数的介绍和使用方法里介绍过。
这些FISH函数文件存放路径如下图所示
这里面其实还包含一个切割块体生成圆柱形区域的示例(shaft.3ddat
和shaft.3dfis
)
1. shaft.3dfis
FISH函数代码如下:
def _shaft
;-----------------------------------------------------------------------
; function which generates geometry of the shaft. shaft can be vertical
; only;
;
; function variables:
; north_ coordinates of the upper point on the shaft axis
; east_
; elevation_
; azimuth_ direction from which generation of sides starts
; radius_ shaft radius
; sides_ number of the segments used to generate geometry
; depth_ shaft length
; region_ region number assigned to shaft
; region0_ region number assigned to surrounding
;-----------------------------------------------------------------------
;----------------------------------------------------------------------
;如果想知道生成过程的,可以将代码中的pause key取消注释或自行添加新的断点
;这样可以更方便地理解上面参数的含义
;----------------------------------------------------------------------
region_ = region_
region0_ = region0_
x_ = east_+radius_
command
;;;pause key
jset dip 90. dd 90. ori @x_ 0. 0.
hide range plane dip 90. dd 90. ori @x_ 0. 0. above
end_command
x_ = east_-radius_
command
;;;pause key
jset dip 90. dd 90. ori @x_ 0. 0.
hide range plane dip 90. dd 90. ori @x_ 0. 0. below
end_command
;
y_ = north_+radius_
command
;;;pause key
jset dip 90. dd 0. ori 0. @y_ 0.
hide range plane dip 90. dd 0. ori 0. @y_ 0. above
end_command
y_ = north_-radius_
command
;;;pause key
jset dip 90. dd 0. ori 0. @y_ 0.
hide range plane dip 90. dd 0. ori 0. @y_ 0. below
end_command
;
z_ = elevation_
command
;;;pause key
jset dip 0. dd 0. ori 0. 0. @z_
hide range plane dip 0. dd 0. ori 0. 0. @z_ above
end_command
z_ = elevation_-depth_
command
;;;pause key
jset dip 0. dd 0. ori 0. 0. @z_
hide range plane dip 0. dd 0. ori 0. 0. @z_ below
mark region @region0_
end_command
;
dangle_ = 360./sides_
start_ = azimuth_-0.5*dangle_+90.
dip_ = 90.
dd_ = start_
x_ = east_
y_ = north_
z_ = elevation_
loop i (1,sides_/2)
command
jset dip @dip_ dd @dd_ ori @x_ @y_ @z_
end_command
dd_ = dd_+dangle_
end_loop
dd1_ = start_
dd2_ = start_+dangle_
dd_ = azimuth_
loop i (1,sides_)
command
hide
seek range region @region0_
hide range plane dip 90. dd @dd1_ ori @x_ @y_ @z_ below
hide range plane dip 90. dd @dd2_ ori @x_ @y_ @z_ above
end_command
n1_ = cos(dd_*degrad)
n2_ = sin(dd_*degrad)
length_ = radius_*cos(0.5*dangle_*degrad)
xc_ = east_ +length_*n2_
yc_ = north_+length_*n1_
zc_ = elevation_
command
jset dd @dd_ dip 90 ori @xc_ @yc_ @zc_
hide range plane dd @dd_ dip 90 ori @xc_ @yc_ @zc_ above
mark region @region_
end_command
dd1_ = dd2_
dd2_ = dd2_+dangle_
dd_ = dd_+dangle_
end_loop
command
seek
end_command
end
带语法高亮的源代码请点击👇链接
代码中加了pause key
的可以暂停运行,在命令栏中点击键盘上的回车键或其他键可以接着运行,这种方法也经常用在代码调试中。实现的效果如下:
2. shaft.3ddat
主代码如下,调用shaft.3dfis函数在块体中心生成圆柱形区域
new
ca shaft.3dfis suppress
poly brick -100,100 -100,100 -150,50
plot create plot Shaft
plot block
pl reset
plot set dip 60 dd 168
SET @north_ 0. @east_ 0. @elevation_ 50.
SET @azimuth_ 0. @radius_ 5. @sides_ 20 @depth_ 100.
SET @region_ 2 @region0_ 1
@_shaft
hide
seek range reg @region_
plot set dip 120 dd 12 mag 3 center 0 2.4 2.0
ret
带语法高亮的源代码请点击👇链接
运行代码,可生成如下的圆柱形区域:
实际上,这是在一个大块体中心切割生成的圆柱形区域,三维图如下:
剖面图如下:
Comments | 3 条评论
好久不见了,大佬
我特别想知道大家都是怎么学3DEC呢?学了快3个月了根本没什么进展
@3 看帮助文档或者手册的例子和命令