A triangle.
Allocates a new <GrapheneTriangle>.
The contents of the returned structure are undefined.
Returned: a <GrapheneTriangle>.
the newly allocated <GrapheneTriangle> structure.
Use triangle:free to free the resources
allocated by this function
Checks whether the given triangle self contains the point p.
Passed: a <GrapheneTriangle>.
Passed: a <GraphenePoint3D>.
Returned: a boolean.
true if the point is inside the triangle
Checks whether the two given <GrapheneTriangle>
are equal.
Passed: a <GrapheneTriangle>.
Passed: a <GrapheneTriangle>.
Returned: a boolean.
true if the triangles are equal
Frees the resources allocated by triangle:alloc.
Passed: a <GrapheneTriangle>.
Computes the area of the given
<GrapheneTriangle>.
Passed: a <GrapheneTriangle>.
Returned: a real number.
the area of the triangle
Computes the barycentric coordinates of the given point p.
The point p must lie on the same plane as the triangle self; 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; and
v which is on the AB vector:

The returned <GrapheneVec2> contains the following
values, in order:
res.x = u
res.y = v
Passed: a <GrapheneTriangle>.
Passed: a <GraphenePoint3D>, or #f.
Passed, filled in, and returned: a <GrapheneVec2>.
return location for the vector with the barycentric coordinates
Returned: a boolean.
true if the barycentric coordinates are valid
Computes the bounding box of the given
<GrapheneTriangle>.
Passed: a <GrapheneTriangle>.
Passed, filled in, and returned: a <GrapheneBox>.
return location for the box
Computes the coordinates of the midpoint of the given
<GrapheneTriangle>.
The midpoint G is the centroid of the triangle, i.e. the intersection of its medians.
Passed: a <GrapheneTriangle>.
Passed, filled in, and returned: a
<GraphenePoint3D>.
return location for the coordinates of the midpoint
Computes the normal vector of the given
<GrapheneTriangle>.
Passed: a <GrapheneTriangle>.
Passed, filled in, and returned: a <GrapheneVec3>.
return location for the normal vector
Computes the plane based on the vertices of the given
<GrapheneTriangle>.
Passed: a <GrapheneTriangle>.
Passed, filled in, and returned: a <GraphenePlane>.
return location for the plane
Retrieves the three vertices of the given
<GrapheneTriangle> and returns their coordinates
as <GraphenePoint3D>.
Passed: a <GrapheneTriangle>.
Passed, filled in, and returned: a
<GraphenePoint3D>.
return location for the coordinates of the first vertex
Passed, filled in, and returned: a
<GraphenePoint3D>.
return location for the coordinates of the second vertex
Passed, filled in, and returned: a
<GraphenePoint3D>.
return location for the coordinates of the third vertex
Computes the UV coordinates of the given point p.
The point p must lie on the same plane as the triangle self;
if the point is not coplanar, the result of this function is undefined.
If p is #f, the point will be set in (0, 0, 0).
The UV coordinates will be placed in the res vector:
res.x = u
res.y = v
See also: triangle:get-barycoords!
Passed: a <GrapheneTriangle>.
Passed: a <GraphenePoint3D>, or #f.
Passed: a <GrapheneVec2>.
the UV coordinates of the first point
Passed: a <GrapheneVec2>.
the UV coordinates of the second point
Passed: a <GrapheneVec2>.
the UV coordinates of the third point
Passed, filled in, and returned: a <GrapheneVec2>.
a vector containing the UV coordinates of the given point p
Returned: a boolean.
true if the coordinates are valid
Retrieves the three vertices of the given
<GrapheneTriangle>.
Passed: a <GrapheneTriangle>.
Passed, filled in, and returned: a <GrapheneVec3>.
return location for the first vertex
Passed, filled in, and returned: a <GrapheneVec3>.
return location for the second vertex
Passed, filled in, and returned: a <GrapheneVec3>.
return location for the third vertex
Initializes a <GrapheneTriangle> using the three
given arrays of floating point values, each representing the coordinates
of a point in 3D space.
Passed: a <GrapheneTriangle>.
the <GrapheneTriangle> to initialize
Passed: a f32vector, or a list or vector, each a real number.
an array of 3 floating point values
Passed: a f32vector, or a list or vector, each a real number.
an array of 3 floating point values
Passed: a f32vector, or a list or vector, each a real number.
an array of 3 floating point values
Returned: a <GrapheneTriangle>.
the initialized <GrapheneTriangle>
Initializes a <GrapheneTriangle> using the three
given 3D points.
Passed: a <GrapheneTriangle>.
the <GrapheneTriangle> to initialize
Passed, or left out: a <GraphenePoint3D>, or
#f.
Passed, or left out: a <GraphenePoint3D>, or
#f.
Passed, or left out: a <GraphenePoint3D>, or
#f.
Returned: a <GrapheneTriangle>.
the initialized <GrapheneTriangle>
Initializes a <GrapheneTriangle> using the three
given vectors.
Passed: a <GrapheneTriangle>.
the <GrapheneTriangle> to initialize
Passed, or left out: a <GrapheneVec3>, or #f.
Passed, or left out: a <GrapheneVec3>, or #f.
Passed, or left out: a <GrapheneVec3>, or #f.
Returned: a <GrapheneTriangle>.
the initialized <GrapheneTriangle>