  We observed the L1506 filament, which is located in the Taurus molecular
complex, with the Herschel PACS and SPIRE instruments. Our aim is to prove the
variation in grain properties along the entire length of the filament. In
particular, we want to determine above which gas density this variation arises
and what changes in the grain optical properties/size distribution are
required. We use the 3D radiative transfer code CRT, coupled to the dust
emission and extinction code DustEM, to model the emission and extinction of
the dense filament. We test a range of optical properties and size
distributions for the grains: dust of the diffuse interstellar medium
(interstellar PAHs and amorphous carbons and silicates) and both compact and
fluffy aggregates. We find that the grain opacity has to increase across the
filament to fit simultaneously the near-IR extinction and Herschel emission
profiles of L1506. We interpret this change to be a consequence of the
coagulation of dust grains to form fluffy aggregates. Grains similar to those
in the diffuse medium have to be present in the outer layers of the cloud,
whereas aggregates must prevail above gas densities of a few 1000 H/cm3. This
corresponds to line-of-sights with visual extinction in the V band of the order
of 2 to 3. The dust opacity at 250 microns is raised by a factor of 1.8 to 2.2,
while the grain average size is increased by a factor of 5. These exact numbers
depend naturally on the dust model chosen to fit the data. Our findings agree
with the constraints given by the study of the gas molecular lines. Using a
simple approach, we show that the aggregates may have time to form inside the
filament within the cloud lifetime. Our model also characterises the density
structure of the filament, showing that the filament width is not constant
along L1506 but instead varies by a factor of the order of 4.
