@@ -3804,18 +3804,23 @@ def cylinder(
3804
3804
self : T ,
3805
3805
radius : float ,
3806
3806
height : float ,
3807
+ direct : Vector = Vector (0 , 0 , 1 ),
3808
+ angle : float = 360 ,
3807
3809
centered : Union [bool , Tuple [bool , bool , bool ]] = True ,
3808
3810
combine : bool = True ,
3809
3811
clean : bool = True ,
3810
3812
) -> T :
3811
-
3812
3813
"""
3813
3814
Returns a cylinder with the specified radius and height for each point on the stack
3814
3815
3815
3816
:param radius: The radius of the cylinder
3816
3817
:type radius: float > 0
3817
3818
:param height: The height of the cylinder
3818
3819
:type height: float > 0
3820
+ :param direct: The direction axis for the creation of the cylinder
3821
+ :type direct: A three-tuple
3822
+ :param angle: The angle to sweep the cylinder arc through
3823
+ :type angle: float > 0
3819
3824
:param centered: If True, the cylinder will be centered around the reference point. If False,
3820
3825
the corner of a bounding box around the cylinder will be on the reference point and it
3821
3826
will extend in the positive x, y and z directions. Can also use a 3-tuple to specify
@@ -3845,12 +3850,12 @@ def cylinder(
3845
3850
if not centered [1 ]:
3846
3851
offset += Vector (0 , radius , 0 )
3847
3852
if centered [2 ]:
3848
- offset += Vector (0 , 0 , - height / 2 )
3853
+ offset += Vector (0 , 0 , - height / 2 )
3849
3854
3850
- c = self . circle (radius ). _extrude ( height ). move ( Location ( offset ) )
3855
+ s = Solid . makeCylinder (radius , height , offset , direct , angle )
3851
3856
3852
3857
# We want a cylinder for each point on the workplane
3853
- cylinders = self .eachpoint (lambda loc : c .moved (loc ), True )
3858
+ cylinders = self .eachpoint (lambda loc : s .moved (loc ), True )
3854
3859
3855
3860
# If we don't need to combine everything, just return the created cylinders
3856
3861
if not combine :
0 commit comments