For accurate measurement of semiconductor linewidth, the application of the model-based library (MBL) method in the measurement of critical dimensions (CD) of semiconductor linewidth was investigated in depth based on the electron-solid interaction theory and the transport mechanism of electrons in solids using a Monte Carlo simulation method combined with a neural network algorithm. The effect of various geometrical parameters (such as top width, edge wall angle and height) and different electron beam incidence conditions on the signal profile of the secondary electron line-scan is investigated by constructing a trapezoidal-like sample structure using the finite element mesh method according to ISO 21466[1] with Si as the sample. To further extend the calculations for insulator materials, the emission characteristics of secondary electrons were investigated for the insulator material SiO$_2$. The intrinsic secondary electron yield of SiO$_2$, as well as the emission energy, excitation depth and emission angle of secondary electrons are investigated using Monte Carlo method calculations. A new dielectric function model (LL model) [2]is introduced to describe the inelastic scattering of electrons using the dielectric function approach in the calculations, and the phonon scattering mechanism is considered. The calculation results show that the calculated results of the secondary electron yield are in excellent agreement with the experimental values and also enrich the database, thus further extending the generality of the numerical method.