Py5Shape.get_depth()#

Get the Py5Shape object’s depth.

Examples#

example picture for get_depth()
1def setup():
2    py5.size(100, 100, py5.P3D)
3    py5.sphere_detail(8)
4    s1 = py5.create_shape(py5.SPHERE, 40)
5    z_values = [s1.get_vertex_z(i) for i in range(s1.get_vertex_count())]
6    py5.shape(s1, 50, 50)
7    py5.println(s1.get_depth(), min(z_values), max(z_values))  # 80, -40, 40

Description#

Get the Py5Shape object’s depth. This method only makes sense when using the P3D renderer. It will return 0 when using default renderer.

Underlying Processing method: PShape.getDepth

Syntax#

get_depth() -> float

Updated on November 12, 2021 11:30:58am UTC