Py5Shape.is3d()

Boolean value reflecting if the shape is or is not a 3D shape.

Examples

example picture for is3d()
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
def setup():
    s = py5.create_shape()
    s.begin_shape()
    s.vertex(30, 20)
    s.vertex(85, 20)
    s.vertex(85, 75)
    s.vertex(30, 75)
    s.end_shape(py5.CLOSE)

    py5.println(s.is2d(), s.is3d())
    py5.shape(s)
example picture for is3d()
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
def setup():
    py5.size(100, 100, py5.P3D)
    s = py5.create_shape()
    s.begin_shape()
    s.vertex(30, 20)
    s.vertex(85, 20)
    s.vertex(85, 75)
    s.vertex(30, 75)
    s.end_shape(py5.CLOSE)

    py5.println(s.is2d(), s.is3d())
    py5.shape(s)

Description

Boolean value reflecting if the shape is or is not a 3D shape.

If the shape is created in a Sketch using the P3D renderer, this will be True, even if it only uses 2D coordinates.

Underlying Java method: PShape.is3D

Syntax

is3d() -> bool

Updated on September 11, 2021 16:51:34pm UTC