Apparatus for 3D shaping of a workpiece by material ablation with a pulsed laser beam, the apparatus comprising: a laser source for generating the laser beam, a machining unit configured to provide a pressurized fluid jet onto the workpiece and to couple the laser beam into the fluid jet towards the workpiece, a motion controller configured to set an x-y-z-position of the workpiece relative to the machining unit, wherein the z-direction is parallel to a propagation direction of the fluid jet and the x-y-plane is perpendicular to the z-direction, a measuring unit configured to measure a z-position of the point of incidence of the pressurized fluid jet on the workpiece in the z-direction, and a laser controller; wherein the apparatus is characterized in that: the measuring unit is configured to scan the surface of the workpiece in the x-y-plane and to determine a profile of the surface by measuring z-positions of a plurality of points of incidence of the fluid jet on the workpiece, and the laser controller is configured to adapt the laser beam energy for different x-y-positions or adapt individually the energy of each laser pulse based on the determined profile of the surface and/or wherein the motion controller is configured to set the trajectory of moving the workpiece by changing the x-y-z-position after each laser pulse, based on the determined profile of the surface. a laser source for generating the laser beam, a machining unit configured to provide a pressurized fluid jet onto the workpiece and to couple the laser beam into the fluid jet towards the workpiece, a motion controller configured to set an x-y-z-position of the workpiece relative to the machining unit, wherein the z-direction is parallel to a propagation direction of the fluid jet and the x-y-plane is perpendicular to the z-direction, a measuring unit configured to measure a z-position of the point of incidence of the pressurized fluid jet on the workpiece in the z-direction, and a laser controller; wherein the apparatus is characterized in that: the measuring unit is configured to scan the surface of the workpiece in the x-y-plane and to determine a profile of the surface by measuring z-positions of a plurality of points of incidence of the fluid jet on the workpiece, and the laser controller is configured to adapt the laser beam energy for different x-y-positions or adapt individually the energy of each laser pulse based on the determined profile of the surface and/or wherein the motion controller is configured to set the trajectory of moving the workpiece by changing the x-y-z-position after each laser pulse, based on the determined profile of the surface. the measuring unit is configured to scan the surface of the workpiece in the x-y-plane and to determine a profile of the surface by measuring z-positions of a plurality of points of incidence of the fluid jet on the workpiece, and the laser controller is configured to adapt the laser beam energy for different x-y-positions or adapt individually the energy of each laser pulse based on the determined profile of the surface and/or wherein the motion controller is configured to set the trajectory of moving the workpiece by changing the x-y-z-position after each laser pulse, based on the determined profile of the surface.