level 1
炎帝萧炎2号
楼主
如题,本人一直用的5.0,到6.0的时候发现5.0的cluster划分方法已经不适合了,根本划分不出来,这是为什么呢??求教如何修改程序来修改划分。下面是5.0版本的,有兄弟知道怎么修改后适用于6.0嘛???
define mak_clusters_sc
;;;;
loop foreach local bp ball.list
xx=math.random.uniform
if xx < 0.3 then
ball.group(bp)='feldspar' ;;;
area_feldspar=area_feldspar+math.pi*ball.radius(bp)*ball.radius(bp)
num_feldspar=num_feldspar+1
endif
if xx > 0.97 then ;;;
ball.group(bp)='mica'
area_mica=area_mica+math.pi*ball.radius(bp)*ball.radius(bp)
num_mica=num_mica+1
endif
endloop
loop foreach bp ball.list
sssname=ball.group(bp)
if sssname == 'quartz' then
;i=io.out('quartz')
continue
endif
loop foreach local cp ball.contactmap(bp,contact.typeid('ball-ball')) ;ball
if contact.end1(cp) = bp then ;;;
bp_other = contact.end2(cp)
else
bp_other = contact.end1(cp) ;;;
endif
if ball.group(bp_other) # 'quartz' then ;;
continue
endif
if rat111 < 0.5932 then ;;;0.5932
if sssname=='feldspar' then
ball.group(bp_other)='feldspar'
area_feldspar=area_feldspar+math.pi*ball.radius(bp_other)*ball.radius(bp_other)
num_feldspar=num_feldspar+1
rat111=area_feldspar/area_total
endif
endif
if rat222 < 0.0481 then ;;;0.0481
if sssname =='mica' then
ball.group(bp_other)='mica'
area_mica=area_mica+math.pi*ball.radius(bp_other)*ball.radius(bp_other)
num_mica=num_mica+1
rat222=area_mica/area_total
endif
endif
endloop
endloop
end
@mak_clusters_sc
2024年09月27日 09点09分
1
define mak_clusters_sc
;;;;
loop foreach local bp ball.list
xx=math.random.uniform
if xx < 0.3 then
ball.group(bp)='feldspar' ;;;
area_feldspar=area_feldspar+math.pi*ball.radius(bp)*ball.radius(bp)
num_feldspar=num_feldspar+1
endif
if xx > 0.97 then ;;;
ball.group(bp)='mica'
area_mica=area_mica+math.pi*ball.radius(bp)*ball.radius(bp)
num_mica=num_mica+1
endif
endloop
loop foreach bp ball.list
sssname=ball.group(bp)
if sssname == 'quartz' then
;i=io.out('quartz')
continue
endif
loop foreach local cp ball.contactmap(bp,contact.typeid('ball-ball')) ;ball
if contact.end1(cp) = bp then ;;;
bp_other = contact.end2(cp)
else
bp_other = contact.end1(cp) ;;;
endif
if ball.group(bp_other) # 'quartz' then ;;
continue
endif
if rat111 < 0.5932 then ;;;0.5932
if sssname=='feldspar' then
ball.group(bp_other)='feldspar'
area_feldspar=area_feldspar+math.pi*ball.radius(bp_other)*ball.radius(bp_other)
num_feldspar=num_feldspar+1
rat111=area_feldspar/area_total
endif
endif
if rat222 < 0.0481 then ;;;0.0481
if sssname =='mica' then
ball.group(bp_other)='mica'
area_mica=area_mica+math.pi*ball.radius(bp_other)*ball.radius(bp_other)
num_mica=num_mica+1
rat222=area_mica/area_total
endif
endif
endloop
endloop
end
@mak_clusters_sc