Skip to content

Commit 306c1e5

Browse files
authored
Merge pull request #542 from hx2A/is3d
add is3d() method to Py5Graphics
2 parents 1f67f8e + 73ff886 commit 306c1e5

3 files changed

Lines changed: 32 additions & 3 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
@@ meta
2+
name = is3d()
3+
type = method
4+
pclass = PGraphics
5+
processing_name = is3D
6+
7+
@@ signatures
8+
is3d() -> bool
9+
10+
@@ description
11+
Boolean value reflecting if the Py5Graphics object is or is not a 3D renderer.
12+
13+
This will be `True` if the renderer is a 3D renderer such as `P3D`.
14+
15+
@@ example
16+
def setup():
17+
py5.size(200, 200)
18+
g = py5.get_graphics()
19+
20+
# prints False
21+
print(g.is3d())
22+
23+
@@ example
24+
def setup():
25+
py5.size(200, 200, py5.P3D)
26+
g = py5.get_graphics()
27+
28+
# prints True
29+
print(g.is3d())

py5_docs/Reference/api_en/Py5Shape_is3d.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ is3d() -> bool
1212
@@ description
1313
Boolean value reflecting if the shape is or is not a 3D shape.
1414

15-
If the shape is created in a Sketch using the `P3D` renderer, this will be `True`, even if it only uses 2D coordinates.
15+
This will be `True` if the shape is created in a Sketch using a 3D renderer such as `P3D`, even if it only uses 2D coordinates.
1616

1717
@@ example
1818
image = Py5Shape_is3d_0.png

py5_resources/data/pgraphics.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,8 @@ is_gl,isGL,,method,SKIP,
412412
g_l,gL,,unknown,SKIP,
413413
is2_x,is2X,,method,SKIP,
414414
style,style,,method,SKIP,public methods that shouldn't be available to users
415-
is3_d,is3D,,method,SKIP,
416-
is2_d,is2D,,method,SKIP,
415+
is3d,is3D,,method,JAVA,
416+
is2d,is2D,,method,SKIP,
417417
texture,texture,,method,JAVA,
418418
no_texture,noTexture,,method,SKIP,
419419
begin_contour,beginContour,@_context_wrapper('end_contour'),method,JAVA,

0 commit comments

Comments
 (0)