How to make topology file for periodically polymers?

GROMACS version: 2019.5
GROMACS modification: No
I have learned to use x2top to build topology file of simple periodic two-dimensional materials (such as graphene). But for complex cross-linked polymers, such as cross-linked polyamides synthesized from p-phenylenediamine and trimesoyl chloride, I find it difficult to get started. Is there any good way to construct this topology file? Thank you!