Polyhedron¶
- class photonforge.Polyhedron(medium, vertices, triangles)¶
Triangulated volumetric object.
- Parameters:
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.
Methods
copy
()Create a copy of this 3D structure.
Create a Tidy3D structure from this polyhedron.
write_ply
(filename)Output this plyhedron's mesh to a PLY file.
Attributes
Polyhedron medium.
Object properties.
Indices of vertices for each triangle in the polyhedron surface.
Vertices of the polyhedron.
- copy()¶
Create a copy of this 3D structure.
- Returns:
New copy.
- Return type:
- medium¶
Polyhedron medium.
- Type:
MediumType
- properties¶
Object properties.
- Type:
- to_tidy3d()¶
Create a Tidy3D structure from this polyhedron.
- Returns:
Tidy3D structure.
- Return type:
tidy3d.Structure
- triangles¶
Indices of vertices for each triangle in the polyhedron surface.
- Type:
ndarray
- vertices¶
Vertices of the polyhedron.
- Type:
ndarray
- write_ply(filename)¶
Output this plyhedron’s mesh to a PLY file.
- Parameters:
filename (str) – Name of the output file.
- Returns:
This polyhedron.
- Return type: