A printer for printing a 3D object based on a computer model, the printer comprising: - a tool configured to shift between an activated and a deactivated state based on a tool command, the tool being configured to add material to an adding-position in a layer of the object in the activated state, where the adding-position is determined by a tool-position of a shape defining structure; - a stage arranged to support the layer of the object; - a motion structure configured to receive motion commands and based thereon to define the shape of the layer by movement of the shape defining structure; and - a controller configured to communicate with the tool and with the motion structure and being programmed to receive shape data defining the shape of a layer of the object, to provide a path based on the shape data, to provide motion commands for the motion structure such that the adding-position follows the path, and to provide tool commands based on the path, wherein the controller is configured to define the path by: - defining, based on the shape data, a plurality of line segments; - defining start points and end points for each line segment - defining an order of the line segments to thereby define a list of contiguous line segments; - defining between at least one pair of two adjacent line segments in the list of contiguous line segments, a transition segment, each transition segment being defined based on a desired minimum speed and maximum acceleration at the subsequent line segment, such that the path is defined by the contiguous line segments including at least one pair of line segments which are separated by a transition segment, and wherein the controller is programmed to provide the tool commands such that the tool is activated when the adding-position is within a line segment and deactivated when the adding-position is outside the line segment, characterised in that the controller is configured to compare a first direction of one line segment in the list of contiguous line segments with a second direction of a subsequent line segment in the list of contiguous line segments and to provide an angle between the first direction and second direction, and to define a transition segment between the line segments if the angle exceeds a predefined angle value. - a tool configured to shift between an activated and a deactivated state based on a tool command, the tool being configured to add material to an adding-position in a layer of the object in the activated state, where the adding-position is determined by a tool-position of a shape defining structure; - a stage arranged to support the layer of the object; - a motion structure configured to receive motion commands and based thereon to define the shape of the layer by movement of the shape defining structure; and - a controller configured to communicate with the tool and with the motion structure and being programmed to receive shape data defining the shape of a layer of the object, to provide a path based on the shape data, to provide motion commands for the motion structure such that the adding-position follows the path, and to provide tool commands based on the path, wherein the controller is configured to define the path by: - defining, based on the shape data, a plurality of line segments; - defining start points and end points for each line segment - defining an order of the line segments to thereby define a list of contiguous line segments; - defining between at least one pair of two adjacent line segments in the list of contiguous line segments, a transition segment, each transition segment being defined based on a desired minimum speed and maximum acceleration at the subsequent line segment, such that the path is defined by the contiguous line segments including at least one pair of line segments which are separated by a transition segment, - defining, based on the shape data, a plurality of line segments; - defining start points and end points for each line segment - defining an order of the line segments to thereby define a list of contiguous line segments; - defining between at least one pair of two adjacent line segments in the list of contiguous line segments, a transition segment, each transition segment being defined based on a desired minimum speed and maximum acceleration at the subsequent line segment, such that the path is defined by the contiguous line segments including at least one pair of line segments which are separated by a transition segment, and wherein the controller is programmed to provide the tool commands such that the tool is activated when the adding-position is within a line segment and deactivated when the adding-position is outside the line segment, characterised in that the controller is configured to compare a first direction of one line segment in the list of contiguous line segments with a second direction of a subsequent line segment in the list of contiguous line segments and to provide an angle between the first direction and second direction, and to define a transition segment between the line segments if the angle exceeds a predefined angle value.