The palindromic and anti-palindromic closures are used in combinatorics on words in order to generate Sturmian, Thue-Morse or Rote words. Usually, these words are generated either by substitutions or by discrete dynamical systems given by rotations on the torus with a well chosen partition. Thus in the first part of the talk, we will see how to use directive words in order to generate these specific words and an interesting class of words. We will focus also on Justin's formula in order to compute the palindromic closure and we extend this tool to the anti-palindromic case. In a second part, we will investigate geometric palindromic closure to construct finite steps of the famous Rauzy fractal linked to a generalization of the Fibonacci sequence (namely the Tribonacci case). The construction leads to construct Rauzy fractals in all dimensions using geometrical transformations.