@@ -2651,8 +2651,7 @@ def polyline(
2651
2651
"""
2652
2652
Create a polyline from a list of points
2653
2653
2654
- :param listOfXYTuple: a list of points in Workplane coordinates
2655
- :type listOfXYTuple: list of 2-tuples
2654
+ :param listOfXYTuple: a list of points in Workplane coordinates (2D or 3D)
2656
2655
:param forConstruction: whether or not the edges are used for reference
2657
2656
:type forConstruction: true if the edges are for reference, false if they are for creating geometry
2658
2657
part geometry
@@ -2688,15 +2687,15 @@ def polyline(
2688
2687
2689
2688
def close (self : T ) -> T :
2690
2689
"""
2691
- End 2D construction, and attempt to build a closed wire.
2690
+ End construction, and attempt to build a closed wire.
2692
2691
2693
2692
:return: a CQ object with a completed wire on the stack, if possible.
2694
2693
2695
- After 2D drafting with methods such as lineTo, threePointArc,
2694
+ After 2D (or 3D) drafting with methods such as lineTo, threePointArc,
2696
2695
tangentArcPoint and polyline, it is necessary to convert the edges
2697
2696
produced by these into one or more wires.
2698
2697
2699
- When a set of edges is closed, cadQuery assumes it is safe to build
2698
+ When a set of edges is closed, CadQuery assumes it is safe to build
2700
2699
the group of edges into a wire. This example builds a simple triangular
2701
2700
prism::
2702
2701
@@ -2713,7 +2712,7 @@ def close(self: T) -> T:
2713
2712
# that is larger than what is considered a numerical error.
2714
2713
# If so; add a line segment between endPoint and startPoint
2715
2714
if endPoint .sub (startPoint ).Length > 1e-6 :
2716
- self .lineTo ( self . ctx . firstPoint . x , self . ctx . firstPoint . y )
2715
+ self .polyline ([ endPoint , startPoint ] )
2717
2716
2718
2717
# Need to reset the first point after closing a wire
2719
2718
self .ctx .firstPoint = None
0 commit comments