Designing a Capsule shaped structure

fdtd

#1

Hello everyone,
It is nice to be a part of this community from all around the world.
I want to design a geometry in the shape of a “capsule”, but their is no option for such structure. I have tried in the tab “Custom” but I don’t know how it works. May some equations will be needed, I don’t know. I need your help. The problem is open to all, all the answers are welcomed.
Thanks in Advance
Regards
Ravi


#2

Hi,

It seems that the best way to create capsule shape would be to use structure group and build the shape by using basic objects like circle(cylinder) to create the body and two spheres to create the round ends.

You can read about structure groups here and you can also use the items in object library(type:structure) as an inspiration how to create well defined structure group.

I have created an example to show how to build simple capsule as described abovesimple capsule.fsp (226.7 KB)
:

These are the variables/parameters:

and simple script to build the capsule:

selectall;
delete;

d=%Diameter%;
l=%Length%;
material=%Material%;
index=%Index%;

addcircle;
set("radius",d/2);
set("z span",l-d);
set("first axis",3);
set("rotation 1",90);

addsphere;
set("x",(l-d)/2);
set("radius",d/2);

addsphere;
set("x",(l-d)/-2);
set("radius",d/2);

selectall;
set("material",material);
if(material=="<Object defined dielectric>") {
  set("index",index);
}