WolframLang: Translate Copy Graphics

By Xah Lee. Date: .

Translate (Efficient for Tiling the Plane or Space)

Translate[graPrims, vector]

move graPrims by vector

Translate

(* return itself *)
Translate[Circle[], {1, 0}]

(* only show effect when inside Graphics *)
Graphics[Translate[Circle[], {1, 0}], Axes -> True]
Translate[graPrims, vectorList]

make many copies of graPrims by vectorList

this is a very efficient way to represent multiple, identical copies of an arbitrarily complex shape.

use Translate to tile a plane:

WolframLang Translate 2024-02-26
WolframLang Translate 2024-02-26
(* octogon *)
graPrims = Line@Table[{Cos[x], Sin[x]}, {x, 0, 2 Pi, 2 Pi/8.}];

grids = CoordinateBoundsArray[{{0, 10}, {0, 10}}];

(* use Translate to copy to grid, much more efficient than using Map *)
xpattern = Translate[graPrims, Flatten[grids, 1]];

Graphics[ xpattern , Frame -> True ]

arg to Translate should not be a Graphics object:

(* arg to Translate should not be a Graphics object *)

graObj = Circle[];

(* does not translate *)
Translate[ Graphics[ graObj, Axes -> True], {1, 0} ]

(* error *)
Graphics @
Translate[ Graphics[ graObj, Axes -> True], {1, 0} ]

WolframLang, Graphics Programing