The vLine()
method of the Workplane
class in the cadquery
module is used to add a vertical line to the current workplane.
The syntax for using the vLine()
method is as follows:
Workplane.vLine(length)
Parameters:
length
: It is the length of the line to be created.The vLine()
method returns a Workplane
object, which represents the current workplane with the vertical line added.
The vLine()
method creates a vertical line on the current workplane. The starting point of the line is at the current position of the workplane, and the end point is at a specified distance (length
) above the starting point.
The length of the line should be specified as a positive float value. If a negative value is used, a horizontal line is created instead of a vertical line.
import cadquery as cq
# Create a box with a vertical line
result = cq.Workplane().box(10, 10, 10).vLine(5)
# Display the result
show_object(result)
The above code creates a box with a vertical line and displays the result. The output will be a solid box with a vertical line extending from one of its top edges.
The vLine()
method of the Workplane
class in the cadquery
module is a useful tool for creating vertical lines on a workplane. It is easy to use and can be incorporated into various CAD designs.