Polyhedron

class photonforge.Polyhedron(medium, vertices, triangles)

Triangulated volumetric object.

Parameters:
  • medium – Tidy3D medium used in this structure.

  • vertices – Vertices of the polyhedron. Each element must be a sequence of 3 coordinates.

  • triangles – 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.

Methods

copy()

Create a copy of this 3D structure.

to_tidy3d()

Create a Tidy3D structure from this polyhedron.

write_ply(filename)

Output this plyhedron's mesh to a PLY file.

Attributes

medium

Polyhedron medium.

triangles

Indices of vertices for each triangle in the polyhedron surface.

vertices

Vertices of the polyhedron.

copy()

Create a copy of this 3D structure.

Returns:

New copy.

medium

Polyhedron medium.

to_tidy3d()

Create a Tidy3D structure from this polyhedron.

Returns:

Tidy3D structure.

triangles

Indices of vertices for each triangle in the polyhedron surface.

vertices

Vertices of the polyhedron.

write_ply(filename)

Output this plyhedron’s mesh to a PLY file.

Parameters:

filename – Name of the output file.

Returns:

This polyhedron.