Skip to content
Snippets Groups Projects
Commit 05855f51 authored by Dave Whipp's avatar Dave Whipp
Browse files

Added option 12 for embossed rectangle with set slope

parent e2b5a9bb
No related branches found
No related tags found
No related merge requests found
......@@ -161,6 +161,7 @@ else
! type 9 : cosinus sinus
! type 10 : slope
! type 11 : 2D hill
! type 12 : rectangular emboss with specified slope
select case(surface_type)
......@@ -483,12 +484,11 @@ double precision sp01,sp02,sp03,sp04,sp05,sp06,sp07,sp08,sp09,sp10
!------------------------------------------------------------------------------|
integer i
double precision delta,dist,ran
double precision delta,dist,ran,m,pi,x1a,x1b,x2a,x2b,y1a,y1b,y2a,y2b,zx
!------------------------------------------------------------------------------|
!------------------------------------------------------------------------------|
select case(surface_type)
case (1)
! a flat surface,
......@@ -610,7 +610,47 @@ select case(surface_type)
z(i)=sp01
end if
end do
case (12)
! rectangular emboss with specified slope,
! sp01 is the z level
! sp02 and 03 are x1,x2
! sp04 and 05 are y1,y2
! sp06 is the thickness
! sp07 is the slope
pi=atan(1.d0)*4.d0
m=tan(sp07*pi/180.d0)
x1a=sp02+(sp06/(2.d0*m))
x1b=sp02-(sp06/(2.d0*m))
x2a=sp03+(sp06/(2.d0*m))
x2b=sp03-(sp06/(2.d0*m))
y1a=sp04+(sp06/(2.d0*m))
y1b=sp04-(sp06/(2.d0*m))
y2a=sp05+(sp06/(2.d0*m))
y2b=sp05-(sp06/(2.d0*m))
do i=1,ns
if (x(i).le.x1a) then
zx=sp01
elseif (x(i).le.x1b) then
zx=sp01-((x(i)-x1a)/(sp06/m)*sp06)
elseif (x(i).le.x2a) then
zx=sp01-sp06
elseif (x(i).le.x2b) then
zx=sp01-((1.d0-((x(i)-x2a)/(sp06/m)))*sp06)
else
zx=sp01
endif
if (y(i).le.y1a) then
z(i)=sp01
elseif (y(i).le.y1b) then
z(i)=min(sp01-((y(i)-y1a)/(sp06/m)*sp06),zx)
elseif (y(i).le.y2a) then
z(i)=min(sp01-sp06,zx)
elseif (y(i).le.y2b) then
z(i)=min(sp01-((1.d0-((y(i)-y2a)/(sp06/m)))*sp06),zx)
else
z(i)=sp01
endif
end do
case default
call stop_run ('surface type not defined$')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment