summaryrefslogtreecommitdiff
path: root/CSXCAD/matlab/AddSphericalShell.m
diff options
context:
space:
mode:
Diffstat (limited to 'CSXCAD/matlab/AddSphericalShell.m')
-rw-r--r--CSXCAD/matlab/AddSphericalShell.m36
1 files changed, 36 insertions, 0 deletions
diff --git a/CSXCAD/matlab/AddSphericalShell.m b/CSXCAD/matlab/AddSphericalShell.m
new file mode 100644
index 0000000..3e76cef
--- /dev/null
+++ b/CSXCAD/matlab/AddSphericalShell.m
@@ -0,0 +1,36 @@
+function CSX = AddSphericalShell(CSX, propName, prio, center, rad, shell_width, varargin)
+% function CSX = AddSphericalShell(CSX, propName, prio, center, rad, shell_width, varargin)
+%
+% Add a sphere shell to CSX and assign to a property with name <propName>.
+%
+% center: sphere center coordinates
+% rad : sphere radius
+% shell_width: sphere shell width
+% prio : primitive priority
+%
+% Note:
+% the inner radius of this shell is rad-shell_width/2
+% the outer radius of this shell is rad+shell_width/2
+%
+% example:
+% CSX = AddMetal(CSX,'metal'); %create PEC with propName 'metal'
+% CSX = AddSphericalShell(CSX,'metal',10,[0 0 0],50,10);
+%
+% See also AddBox, AddCylindricalShell, AddCylinder, AddSphere,
+% AddCurve, AddWire, AddMetal
+%
+% CSXCAD matlab interface
+% -----------------------
+% author: Thorsten Liebig
+
+sphere.ATTRIBUTE.Priority = prio;
+sphere.ATTRIBUTE.Radius = rad;
+sphere.ATTRIBUTE.ShellWidth = shell_width;
+
+sphere.Center.ATTRIBUTE.X=center(1);
+sphere.Center.ATTRIBUTE.Y=center(2);
+sphere.Center.ATTRIBUTE.Z=center(3);
+
+sphere = AddPrimitiveArgs(sphere,varargin{:});
+
+CSX = Add2Property(CSX,propName, sphere, 'SphericalShell'); \ No newline at end of file