A method of forming a grating, comprising: etching a hardmask layer to form a plurality of openings (1001, 1002), the hardmask layer being disposed over a grating material layer that is disposed on a substrate; forming a first grating in the grating material layer through the plurality of openings (1001, 1002) of the hardmask layer, wherein the first grating has a first shape vector, the first shape vector being a direction in which a depth gradient of the first grating changes, and a first grating vector not being aligned with the first shape vector, wherein forming the first grating comprises: determining a first ion beam angle θ 1 relative to a first slant angle θ 1 ' and an angle φ 1 which is between the first shape vector and the first grating vector; positioning a first portion of the grating material layer in a path of an ion beam at the first ion beam angle θ 1 relative to the substrate, the substrate being retained on a platen; and modulating a process parameter when the ion beam is at the first ion beam angle θ 1 to form a first plurality of fins of the first grating having the first shape vector, the first grating vector, and the first slant angle θ 1 ' relative to a surface normal of the substrate such that the first plurality of fins are formed at the first slant angle θ 1 '. etching a hardmask layer to form a plurality of openings (1001, 1002), the hardmask layer being disposed over a grating material layer that is disposed on a substrate; forming a first grating in the grating material layer through the plurality of openings (1001, 1002) of the hardmask layer, wherein the first grating has a first shape vector, the first shape vector being a direction in which a depth gradient of the first grating changes, and a first grating vector not being aligned with the first shape vector, wherein forming the first grating comprises: determining a first ion beam angle θ 1 relative to a first slant angle θ 1 ' and an angle φ 1 which is between the first shape vector and the first grating vector; positioning a first portion of the grating material layer in a path of an ion beam at the first ion beam angle θ 1 relative to the substrate, the substrate being retained on a platen; and modulating a process parameter when the ion beam is at the first ion beam angle θ 1 to form a first plurality of fins of the first grating having the first shape vector, the first grating vector, and the first slant angle θ 1 ' relative to a surface normal of the substrate such that the first plurality of fins are formed at the first slant angle θ 1 '. determining a first ion beam angle θ 1 relative to a first slant angle θ 1 ' and an angle φ 1 which is between the first shape vector and the first grating vector; positioning a first portion of the grating material layer in a path of an ion beam at the first ion beam angle θ 1 relative to the substrate, the substrate being retained on a platen; and modulating a process parameter when the ion beam is at the first ion beam angle θ 1 to form a first plurality of fins of the first grating having the first shape vector, the first grating vector, and the first slant angle θ 1 ' relative to a surface normal of the substrate such that the first plurality of fins are formed at the first slant angle θ 1 '.