<< Click to Display Table of Contents >> off_axis_disks_3 |
{ OFF_AXIS_DISKS_3.PDE
This example demonstrates how to declare REGIONS properly in a 3D
extrusion model when the desired device has overlapping components.
}
Coordinates cartesian3
Definitions
! material data
rho
! Circle data, C1 and C2
r1 = 5
r2 = 4.5
r3 = 5.1
x1 = 0 y1 = 0
x2 = 1 y2 = 1
x3 = -1 y3 = 1
{ INTERSECTION OF TWO CIRCLES, A and B :
d = sqrt((xB-xA)^2+(yB-yA)^2)
K = (1/4)sqrt(((rA+rB)^2-d^2)(d^2-(rA-rB)^2))
x = (1/2)(xB+xA) + (1/2)(xB-xA)(rA^2-rB^2)/d^2 ± 2(yB-yA)K/d^2
y = (1/2)(yB+yA) + (1/2)(yB-yA)(rA^2-rB^2)/d^2 ± -2(xB-xA)K/d^2
}
! intersection between C1 and C2
d12 = sqrt((x2-x1)^2 + (y2-y1)^2)
k12 = sqrt(((r1+r2)^2-d12^2)*(d12^2-(r1-r2)^2))/4
x12a = (x2+x1)/2 + (x2-x1)*(r1^2-r2^2)/2/d12^2 + 2*(y2-y1)*K12/d12^2
x12b = (x2+x1)/2 + (x2-x1)*(r1^2-r2^2)/2/d12^2 - 2*(y2-y1)*K12/d12^2
y12a = (y2+y1)/2 + (y2-y1)*(r1^2-r2^2)/2/d12^2 - 2*(x2-x1)*K12/d12^2
y12b = (y2+y1)/2 + (y2-y1)*(r1^2-r2^2)/2/d12^2 + 2*(x2-x1)*K12/d12^2
! intersection between C2 and C3
d23 = sqrt((x3-x2)^2 + (y3-y2)^2)
k23 = sqrt(((r2+r3)^2-d23^2)*(d23^2-(r2-r3)^2))/4
x23a = (x3+x2)/2 + (x3-x2)*(r2^2-r3^2)/2/d23^2 + 2*(y3-y2)*K23/d23^2
x23b = (x3+x2)/2 + (x3-x2)*(r2^2-r3^2)/2/d23^2 - 2*(y3-y2)*K23/d23^2
y23a = (y3+y2)/2 + (y3-y2)*(r2^2-r3^2)/2/d23^2 - 2*(x3-x2)*K23/d23^2
y23b = (y3+y2)/2 + (y3-y2)*(r2^2-r3^2)/2/d23^2 + 2*(x3-x2)*K23/d23^2
! intersection between C1 and C3
d13 = sqrt((x3-x1)^2 + (y3-y1)^2)
k13 = sqrt(((r1+r3)^2-d13^2)*(d13^2-(r1-r3)^2))/4
x13a = (x3+x1)/2 + (x3-x1)*(r1^2-r3^2)/2/d13^2 + 2*(y3-y1)*K13/d13^2
x13b = (x3+x1)/2 + (x3-x1)*(r1^2-r3^2)/2/d13^2 - 2*(y3-y1)*K13/d13^2
y13a = (y3+y1)/2 + (y3-y1)*(r1^2-r3^2)/2/d13^2 - 2*(x3-x1)*K13/d13^2
y13b = (y3+y1)/2 + (y3-y1)*(r1^2-r3^2)/2/d13^2 + 2*(x3-x1)*K13/d13^2
Extrusion z = 0,1,2,3
Boundaries
{ definine the regions based on XY projection }
limited region 'C1 only'
layer 1 rho = 1
start(x12a,y12a)
arc(center=x1,y1) to (x13b,y13b)
arc(center=x3,y3) to (x23b,y23b)
arc(center=x2,y2) to close
limited region 'C2 only'
layer 2 rho = 2
start(x12a,y12a)
arc(center=x1,y1) to (x13a,y13a)
arc(center=x3,y3) to (x23a,y23a)
arc(center=x2,y2) to close
limited region 'C3 only'
layer 3 rho = 3
start(x13b,y13b)
arc(center=x1,y1) to (x12b,y12b)
arc(center=x2,y2) to (x23a,y23a)
arc(center=x3,y3) to close
limited region 'C1+C2 overlap'
layer 1 rho = 1
layer 2 rho = 2
start(x12a,y12a)
arc(center=x2,y2) to (x23b,y23b)
arc(center=x3,y3) to (x13a,y13a)
arc(center=x1,y1) to close
limited region 'C1+C3 overlap'
layer 1 rho = 1
layer 3 rho = 3
start(x13b,y13b)
arc(center=x1,y1) to (x12b,y12b)
arc(center=x2,y2) to (x23b,y23b)
arc(center=x3,y3) to close
limited region 'C2+C3 overlap'
layer 2 rho = 2
layer 3 rho = 3
start(x12b,y12b)
arc(center=x1,y1) to (x13a,y13a)
arc(center=x3,y3) to (x23a,y23a)
arc(center=x2,y2) to close
region 'C1+C2+C3 overlap'
layer 1 rho = 1
layer 2 rho = 2
layer 3 rho = 3
start(x23b,y23b)
arc(center=x2,y2) to (x12b,y12b)
arc(center=x1,y1) to (x13a,y13a)
arc(center=x3,y3) to close
Plots
grid(x,y,z) as "Full device by material" paintmaterials viewpoint(20,-20,10)
grid(x,y,z) as "Full device by region" paintregions viewpoint(20,-20,10)
grid(x,y,z) on layer 1 as "Solenoid 1 by material" paintmaterials
grid(x,y,z) on layer 1 as "Solenoid 1 by region" paintregions
grid(x,y,z) on layer 2 as "Solenoid 2 by material" paintmaterials
grid(x,y,z) on layer 2 as "Solenoid 2 by region" paintregions
grid(x,y,z) on layer 3 as "Solenoid 3 by material" paintmaterials
grid(x,y,z) on layer 3 as "Solenoid 3 by region" paintregions
End