Next: Alternative File Formats
Up: The Module esys.pycad
Previous: Holes
Contents
Index
In this section we discuss the definition of 3D geometries. The example is the unit cube, see Figure 5.3. First we generate the vertices of the cube:
We connect the points to form the bottom and top surfaces of the cube:
and
To form the front face we introduce the two additional lines connecting the left and right front
points of the the top and bottom face:
To form the front face we encounter the problem as the line l45 used to define the
top face is pointing the wrong direction. In esys.pycad you can reversing direction of an
object by changing its sign. So we write -l45 to indicate that the direction is to be reversed. With this notation we can write
Keep in mind that if you use Line(p4,p5) instead -l45 both objects are treated as different although the connecting the same points with a straight line in the same direction. The resulting geometry would include an opening along the p4-p5 connection. This will lead to an inconsistent mesh and may result in a failure of the volumetric mesh generator. Similarly we can define the other sides of the cube:
We can now put the six surfaces together to form a SurfaceLoop defining the
boundary of the volume of the cube:
Similar to the definition of a CurvedLoop the orientation of the surfaces SurfaceLoop is relevant. In fact the surface normal direction defined by the the right hand rule needs to point outwards as indicated by the surface normals in
Figure 5.3. As the bottom face is directed upwards it is inserted with the minus sign
into the SurfaceLoop in order to adjust the orientation of the surface.
As in the 2D case, the Design class is used to define the geometry:
Note that the esys.finley mesh file brick.fly will contain the
triangles used to define the surfaces as they are added to the Design.
The example script of the cube is included with the software in
brick.py in the example directory.
Next: Alternative File Formats
Up: The Module esys.pycad
Previous: Holes
Contents
Index
esys@esscc.uq.edu.au