globals
private real x0
private real y0
private real f0
private real w0
private real r0
endglobals
private function Sector takes nothing returns boolean
local unit u=GetFilterUnit()
local real x= GetUnitX(u)
local real y= GetUnitY(u)
local real f
local real d=r0*TanBJ(w0)
set u=null
set f=bjf(x0, y0, x, y)
if RAbsBJ(AngleBetweenAngles(f0,f))<=90 then
set f=bjf(x0+d*CosBJ(f+180), y0+d*SinBJ(f+180), x, y)
if AngleBetweenAngles(f0,f)<w0 then
return true
endif
endif
return false
endfunction
//扇形范围单位
function SectorArea takes real x,real y,real f,real r,real halfanger returns boolexpr
set x0=x
set y0=y
set f0=f
set w0=halfanger
set r0=r/2
set FilterBxp= Filter(function Sector)
return FilterBxp
endfunction
其中xy为起点,f为方向角度,halfanger=0时为直线>0为扇形,r为直线宽度 用于扇形时是扩展宽度
private real x0
private real y0
private real f0
private real w0
private real r0
endglobals
private function Sector takes nothing returns boolean
local unit u=GetFilterUnit()
local real x= GetUnitX(u)
local real y= GetUnitY(u)
local real f
local real d=r0*TanBJ(w0)
set u=null
set f=bjf(x0, y0, x, y)
if RAbsBJ(AngleBetweenAngles(f0,f))<=90 then
set f=bjf(x0+d*CosBJ(f+180), y0+d*SinBJ(f+180), x, y)
if AngleBetweenAngles(f0,f)<w0 then
return true
endif
endif
return false
endfunction
//扇形范围单位
function SectorArea takes real x,real y,real f,real r,real halfanger returns boolexpr
set x0=x
set y0=y
set f0=f
set w0=halfanger
set r0=r/2
set FilterBxp= Filter(function Sector)
return FilterBxp
endfunction
其中xy为起点,f为方向角度,halfanger=0时为直线>0为扇形,r为直线宽度 用于扇形时是扩展宽度