Function Repository Resource:

MakeChainmail

Source Notebook

Construct a 3D graphic of a chainmail design

Contributed by: Rakhi Jain & Joseph Brennan

ResourceFunction["MakeChainmail"][]

constructs a 3D graphical image of chainmail.

ResourceFunction["MakeChainmail"][type]

constructs an image of a specific type of chainmail.

ResourceFunction["MakeChainmail"][type,pos,rows,columns,spacing]

constructs an image starting at pos with spacing between the given number of rows and columns.

ResourceFunction["MakeChainmail"][type,pos,rows,columns,spacing,θ]

constructs an image rotated by θ about the x-axis.

Details

Examples of chainmail type include: "European4In1", "Square4In1", "Japanese6In1", "Octahedral".
The default link spacings are 1.6 for the octahedral chainmail, and 2.5 for all others.
ResourceFunction["MakeChainmail"] has the same options as Graphics3D.
Both 4-in-1 and 6-in-1 chainmail designs are quite well-known, the octahedral design was inspired by this paper.

Examples

Basic Examples (4) 

The default chainmail type is the European 4-in-1 with three rows and columns:

In[1]:=
ResourceFunction[
 "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][]
Out[1]=
In[2]:=
ResourceFunction[
 "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"]["European4In1"]
Out[2]=

The function takes the same options as Graphics3D:

In[3]:=
ResourceFunction[
 "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"]["European4In1", Boxed -> False]
Out[3]=

In[4]:=
ResourceFunction[
 "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"]["European4In1", Lighting -> "ThreePoint", ViewPoint -> Above]
Out[4]=

Other chainmail types are also supported:

In[5]:=
ResourceFunction[
 "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"] /@ {"Square4In1", "Japanese6In1", "Octahedral"}
Out[5]=

Scope (4) 

Specify a custom number of rows and columns:

In[6]:=
ResourceFunction[
 "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][2, 5]
Out[6]=

Define a custom separation of links:

In[7]:=
ResourceFunction[
 "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][2, 2, 2.8]
Out[7]=

Define a custom starting position:

In[8]:=
ResourceFunction[
 "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"]["Japanese6In1", {10, 0, 0}, 4, 4, Axes -> True, AxesLabel -> {"X", "Y", "Z"}, ViewPoint -> Top]
Out[8]=

Rotate individual links about the x-axis by different angles:

In[9]:=
ResourceFunction[
   "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"]["Square4In1", 2, 2, 2.5, #, ViewPoint -> {-2, 0, 0}, Axes -> True, AxesLabel -> {"X", "Y", "Z"}] & /@ {\[Pi]/4, \[Pi]/6, \[Pi]/
  8, \[Pi]/10}
Out[9]=

Properties and Relations (1) 

Create an octahedral chainmail mesh region:

In[10]:=
DiscretizeGraphics[
 ResourceFunction[
  "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"]["Octahedral", 5, 5]]
Out[10]=

Neat Examples (2) 

Generate graphics of the Japanese 6-in-1 chainmail with randomized viewing parameters:

In[11]:=
Grid[Partition[Table[
   Rasterize[
    ResourceFunction[
     "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"]["Japanese6In1", RandomInteger[{1, 10}], RandomInteger[{1, 10}], Boxed -> False, ViewPoint -> RandomReal[{-3, 3}, 3], ViewAngle -> RandomReal[{\[Pi]/16, \[Pi]/8}], Lighting -> RandomChoice[{"Standard", "Neutral", "Accent", "ThreePoint"}]]],
   9], 3]]
Out[11]=

Dynamically adjust the spacing for each chainmail type:

In[12]:=
DynamicModule[
     {type = "European4In1", rows, cols, spacing},
     Column[{ PopupMenu[
    Dynamic[type], {"European4In1", "Square4In1", "Japanese6In1", "Octahedral"}],
           Grid[{
     {"Rows: ", Slider[Dynamic[rows], {1, 10, 1}], Dynamic[rows]},
     {"Columns: ", Slider[Dynamic[cols], {1, 10, 1}], Dynamic[cols]},
     {"Spacing: ", Slider[Dynamic[spacing], {0.5, 8, 0.1}], Dynamic[spacing]}
     }],
   Magnify[
    Dynamic[
     ResourceFunction[
      "MakeChainmail", ResourceSystemBase -> "https://www.wolframcloud.com/obj/resourcesystem/api/1.0"][type, {0, 0, 0}, rows, cols, spacing, \[Pi]/
      8, Boxed -> False]
     ],
    2
    ]
    }]
 ]
Out[12]=

Publisher

Joseph Brennan

Version History

  • 1.0.0 – 06 August 2025

Source Metadata

Related Resources

License Information