Method for producing a micromechanical device with inclined optical windows, which comprises the steps of: S1) providing a first substrate having a first front side and a first rear side and a second substrate having a second front side and a second rear side; S2) creating a plurality of through-holes (F1, F2) in the first substrate and in the second substrate in such a way that a congruent through-hole is created in the second substrate in relation to each through-hole in the first substrate, said through-holes covering over one another when the first substrate is arranged over the second substrate, with the first rear side facing the second front side; S3) creating a slanted edge region (RB1, RB2) around a respective through-hole (F1, F2) in the first substrate and in the second substrate, wherein the edge region (RB1, RB2) in each case runs laterally around a through-hole (F1, F2) and is inclined by a window angle with respect to a planar extent of the first substrate and the second substrate, wherein two slanted edge regions (RB1, RB2) that are arranged one over the other are in each case congruent in plan view and are inclined by the same window angle; S4) providing a window film having a structured window region, which in a plan view of the window film in each case covers the through-hole (F1, F2) and at least partially the associated edge region (RB1, RB2); and S5) positioning the window film between the first rear side of the first substrate and the second front side of the second substrate, wherein the structured window region in each case covers the slanted edge regions (RB1, RB2) and the associated through-holes (F1, F2), and connecting the first rear side to the second front side and the window film arranged in between in a nonpositive manner by a joining process, wherein the window film forms over the respective through-hole (F1, F2) an optical window slanted by the window angle. S1) providing a first substrate having a first front side and a first rear side and a second substrate having a second front side and a second rear side; S2) creating a plurality of through-holes (F1, F2) in the first substrate and in the second substrate in such a way that a congruent through-hole is created in the second substrate in relation to each through-hole in the first substrate, said through-holes covering over one another when the first substrate is arranged over the second substrate, with the first rear side facing the second front side; S3) creating a slanted edge region (RB1, RB2) around a respective through-hole (F1, F2) in the first substrate and in the second substrate, wherein the edge region (RB1, RB2) in each case runs laterally around a through-hole (F1, F2) and is inclined by a window angle with respect to a planar extent of the first substrate and the second substrate, wherein two slanted edge regions (RB1, RB2) that are arranged one over the other are in each case congruent in plan view and are inclined by the same window angle; S4) providing a window film having a structured window region, which in a plan view of the window film in each case covers the through-hole (F1, F2) and at least partially the associated edge region (RB1, RB2); and S5) positioning the window film between the first rear side of the first substrate and the second front side of the second substrate, wherein the structured window region in each case covers the slanted edge regions (RB1, RB2) and the associated through-holes (F1, F2), and connecting the first rear side to the second front side and the window film arranged in between in a nonpositive manner by a joining process, wherein the window film forms over the respective through-hole (F1, F2) an optical window slanted by the window angle.