Basics
Guides
API Reference
Basics
Guides
API Reference
[12:14] static extends: object
Generated struct layout helper for GIR record Triangle.
layout ()
Returns the Panama struct layout for
Triangle.
[29:7] extends: object
A triangle.
GrapheneTriangle (Handle = null)
Allocates a new #graphene_triangle_t. The contents of the returned structure are undefined.
Handle is an optional native handle or wrapper whose handle to adopt; when the native constructor is called.toNativeHandle (Source)
Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from
fn.call(...), another generated wrapper exposinghandle(), or null. Returns null when the argument carries no pointer.
Source is the raw handle, raw buffer, wrapper, or null.A raw pointer carrier or null when no pointer is present.getLib ()
Returns the opened native library for this generated wrapper.
The opened native library.handle ()
Returns the wrapped NativeHandle.
The wrapped NativeHandle.isNull ()
Returns true when the wrapped handle is null.
A bool.describe ()
Returns a small string for debugging generated wrappers.
A string.contains_point (object p)
Checks whether the given triangle @t contains the point @p.
p is a #graphene_point3d_t.true if the point is inside the triangle.equal (object b)
Checks whether the two given #graphene_triangle_t are equal.
b is a #graphene_triangle_t.true if the triangles are equal.free ()
Frees the resources allocated by graphene_triangle_alloc().
None.get_area ()
Computes the area of the given #graphene_triangle_t.
the area of the triangle.get_barycoords (object p)
Computes the barycentric coordinates of the given point @p. The point @p must lie on the same plane as the triangle @t; if the point is not coplanar, the result of this function is undefined. If we place the origin in the coordinates of the triangle's A point, the barycentric coordinates are
u, which is on the AC vector; andvwhich is on the AB vector:The returned #graphene_vec2_t contains the following values, in order: -
res.x = u-res.y = v
p is a #graphene_point3d_t.res is return location for the vector with the barycentric coordinates.true if the barycentric coordinates are valid.get_bounding_box ()
Computes the bounding box of the given #graphene_triangle_t.
res is return location for the box.None.get_midpoint ()
Computes the coordinates of the midpoint of the given #graphene_triangle_t. The midpoint G is the centroid of the triangle, i.e. the intersection of its medians.
res is return location for the coordinates of the midpoint.None.get_normal ()
Computes the normal vector of the given #graphene_triangle_t.
res is return location for the normal vector.None.get_plane ()
Computes the plane based on the vertices of the given #graphene_triangle_t.
res is return location for the plane.None.get_points ()
Retrieves the three vertices of the given #graphene_triangle_t and returns their coordinates as #graphene_point3d_t.
a is return location for the coordinates of the first vertex.b is return location for the coordinates of the second vertex.c is return location for the coordinates of the third vertex.None.get_uv (object p, object uv_a, object uv_b, object uv_c)
Computes the UV coordinates of the given point @p. The point @p must lie on the same plane as the triangle @t; if the point is not coplanar, the result of this function is undefined. If @p is %NULL, the point will be set in (0, 0, 0). The UV coordinates will be placed in the @res vector: -
res.x = u-res.y = vSee also: graphene_triangle_get_barycoords()
p is a #graphene_point3d_t.uv_a is the UV coordinates of the first point.uv_b is the UV coordinates of the second point.uv_c is the UV coordinates of the third point.res is a vector containing the UV coordinates of the given point @p.true if the coordinates are valid.get_vertices ()
Retrieves the three vertices of the given #graphene_triangle_t.
a is return location for the first vertex.b is return location for the second vertex.c is return location for the third vertex.None.init_from_float (list a, list b, list c)
Initializes a #graphene_triangle_t using the three given arrays of floating point values, each representing the coordinates of a point in 3D space.
a is an array of 3 floating point values.b is an array of 3 floating point values.c is an array of 3 floating point values.the initialized #graphene_triangle_t.init_from_point3d (object a, object b, object c)
Initializes a #graphene_triangle_t using the three given 3D points.
a is a #graphene_point3d_t.b is a #graphene_point3d_t.c is a #graphene_point3d_t.the initialized #graphene_triangle_t.init_from_vec3 (object a, object b, object c)
Initializes a #graphene_triangle_t using the three given vectors.
a is a #graphene_vec3_t.b is a #graphene_vec3_t.c is a #graphene_vec3_t.the initialized #graphene_triangle_t.
Aussom
Write once. Embed everywhere.
Copyright 2026 Austin Lehman. All rights reserved.
The returned #graphene_vec2_t contains the following values, in order: -