Skip to content

Polyhedron

Polyhedron(medium, vertices, triangles)

Triangulated volumetric object.

Args

  • medium (MediumType): Tidy3D medium used in this structure.
  • vertices (Sequence[Sequence[float]]): Vertices of the polyhedron. Each element must be a sequence of 3 coordinates.
  • triangles (Sequence[Sequence[int]]): Sequence of triangles that make up the boundary mesh of the polyhedron. Each element is a sequence of 3 indices into the vertices sequence.

Note

The order of the indices in each triangle determine the outwards normal of the polyhedron at that triangle in the counter-clockwise direction. All normals must be set correctly.

MethodDescription
copyCreate a copy of this 3D structure.
to_tidy3dCreate a Tidy3D structure from this polyhedron.
write_plyOutput this plyhedron’s mesh to a PLY file.

copy(self)

Create a copy of this 3D structure.

Returns

Polyhedron: New copy.

to_tidy3d(self)

Create a Tidy3D structure from this polyhedron.

Returns

tidy3d.Structure: Tidy3D structure.

write_ply(self, filename)

Output this plyhedron’s mesh to a PLY file.

Args

  • filename (str): Name of the output file.

Returns

Polyhedron: This polyhedron.

AttributeDescription
mediumMediumType: Polyhedron medium.
propertiesProperties: Object properties.
trianglesndarray: Indices of vertices for each triangle in the polyhedron surface.
verticesndarray: Vertices of the polyhedron.

MediumType: Polyhedron medium.

Properties: Object properties.

ndarray: Indices of vertices for each triangle in the polyhedron surface.

ndarray: Vertices of the polyhedron.