Function Repository Resource:

Incircle3D

Source Notebook

Generate the incircle of a 3D triangle

Contributed by: Jan Mangaldan

ResourceFunction["Incircle3D"][{p1,p2,p3}]

returns a BSplineCurve representing the incircle of the triangle with corner points p1,p2, and p3.

ResourceFunction["Incircle3D"][{p1,p2,p3},property]

gives the value of the specified property.

Details

The following properties are supported:
"Association"association containing the incircle, incenter and inradius
"Center"incenter
"Circle"BSplineCurve representing the incircle
"Radius"inradius
ResourceFunction["Incircle3D"][poly] where poly is a Triangle or Polygon is equivalent to ResourceFunction["Incircle3D"][PolygonCoordinates[poly]].

Examples

Basic Examples (1) 

Incircle of a 3D triangle:

In[1]:=
Graphics3D[
 ResourceFunction["Incircle3D"][{{0, 0, 0}, {1, 0, 0}, {0, 1, 1}}]]
Out[1]=

Scope (3) 

Show a triangle and its incircle together:

In[2]:=
tri = Triangle[{{0, 0, 0}, {1, 0, 0}, {0, 1, 1}}];
Graphics3D[{{Directive[FaceForm[], EdgeForm[Red]], tri}, {Blue, ResourceFunction["Incircle3D"][tri]}}]
Out[2]=

Use Tube to render an incircle:

In[3]:=
Graphics3D[{Blue, Tube[ResourceFunction[
    "Incircle3D"][{{1, -1, 1}, {-2, 3, 0}, {1, -1, 2}}]]}]
Out[3]=

Return the incenter and inradius:

In[4]:=
ResourceFunction[
 "Incircle3D"][{{1, -1, 1}, {-2, 3, 0}, {1, -1, 2}}, "Center"]
Out[4]=
In[5]:=
ResourceFunction[
 "Incircle3D"][{{1, -1, 1}, {-2, 3, 0}, {1, -1, 2}}, "Radius"]
Out[5]=

Neat Examples (1) 

Incircles of the faces of an icosahedron:

In[6]:=
Graphics3D[{Pink, Composition[Tube, ResourceFunction["Incircle3D"]] /@ N[PolyhedronData["Icosahedron", "Polygons"]]}]
Out[6]=

Version History

  • 1.0.0 – 14 June 2021

Source Metadata

Related Resources

License Information