Ruby, 277 bytes
Try it online!
First golfed version. Runs indefinitely
Ruby, 316 bytes
Try it online!
This is a first working version, drawing heavily on my answer to Sticky polyhexes
It's a function, taking the max size as input. Letting the code run indefinitely would probably be shorter.
The code is a function taking one required and 2 optional inputs as follows:
n max size of polyiamond
p an array of polyiamonds
s the size of the polyiamonds in the array.
s are not given it is assumed that
s=1 and p contains the polyiamond
 as a seed.
The board is
w characters wide in the
x direction and for calculation purposes is infinite in the
y direction. Polyiamonds are represented as arrays of integers, one per triangle, of the form
d=x+wy. It's important that
w be odd, since this means that the oddness or evenness of
d will determine whether upward pointing
A or downward pointing
V will be displayed. Therefore
w is chosen as
The first task is to display the polyiamonds fed to the function as arguments. It is assumed that up to
s lines may be needed to display these. This version uses
. as a background, so the number of lines can be conveniently used to count the number of triangles in the polyiamond if this is not obvious.
s<n we have not finished so we need to generate the list of polyiamonds of one size greater. To do this we start an empty array and run through all polyiamonds
a in the input
p. We take each triangle
a and generate new triangles at
e+/-w. To determine the correct sign for the last of these, -1 (represented as
~0 due to Ruby priority rules) is raised to the power
e. If the new triangle is already in
a it is an overlap and can be rejected. If it is not in
a we have increased the size of the polyiamond, so we form a new polyiamond
We apply 12 symmetry operations to
c (see below) forming an array
r and add the lexically lowest one to
q. Once the process is finished for all polyiamonds in
p we find the intersection
q with itself to eliminate duplicates and then call
f again with the new list of polyiamonds of size
The most challenging part was working out the symmetry operations. These are actually done at 45 degrees to my answer to the sticky polyhexes question above. The triangle grid can be considered as two interpenetrating hex grids, one of all upward pointing triangles and the other of all downward pointing triangles, so it's similar but different.
All 12 symmetries can be generated by alternating two reflections. The first (parallel to a triangle edge) is a negation of the
y axis. But rather than a change of sign, a bitflip of the y coordinate is employed. This changes the oddness/evennness of all triangles, causing the symbol to flip at the same time.
The second (perpendicular to a triangle edge)is a transposition of the x and y axes. However a skew correction term is required, since opposite corners of a diamond
VA are 2 units across in the
x direction and 1 unit down in the
y direction. Therefore the half the manhattan distance from the origin
x+y/2 is calculated and coordinates are adjusted by
-w-1 times this, causing a skew in a northeasterly direction.
Overall this looks like this:
start pattern flip vertical flip diagonal skew correction
012 AVA 543 AVA 50 AV 501 AVA
543 VAV -----> 012 VAV --> 41 VA --> 432 VAV