From 4bbf8a58706c9a4bbc1f4d161b911de3dbcaba3a Mon Sep 17 00:00:00 2001 From: Seth Fischer Date: Wed, 1 Jun 2022 21:40:18 +1200 Subject: [PATCH] Format cboreHole(), cskHole(), and hole() example code * Format with Black. * Complete truncated comment. --- cadquery/cq.py | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/cadquery/cq.py b/cadquery/cq.py index 68743d9ac..cd787dc39 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -2784,6 +2784,7 @@ def cutEach( return self.newObject([s]) + # TODO: almost all code duplicated! # but parameter list is different so a simple function pointer won't work def cboreHole( self: T, @@ -2811,9 +2812,15 @@ def cboreHole( One hole is created for each item on the stack. A very common use case is to use a construction rectangle to define the centers of a set of holes, like so:: - s = Workplane(Plane.XY()).box(2,4,0.5).faces(">Z").workplane()\ - .rect(1.5,3.5,forConstruction=True)\ - .vertices().cboreHole(0.125, 0.25,0.125,depth=None) + s = ( + Workplane() + .box(2, 4, 0.5) + .faces(">Z") + .workplane() + .rect(1.5, 3.5, forConstruction=True) + .vertices() + .cboreHole(0.125, 0.25, 0.125, depth=None) + ) This sample creates a plate with a set of holes at the corners. @@ -2866,9 +2873,15 @@ def cskHole( One hole is created for each item on the stack. A very common use case is to use a construction rectangle to define the centers of a set of holes, like so:: - s = Workplane(Plane.XY()).box(2,4,0.5).faces(">Z").workplane()\ - .rect(1.5,3.5,forConstruction=True)\ - .vertices().cskHole(0.125, 0.25,82,depth=None) + s = ( + Workplane() + .box(2, 4, 0.5) + .faces(">Z") + .workplane() + .rect(1.5, 3.5, forConstruction=True) + .vertices() + .cskHole(0.125, 0.25, 82, depth=None) + ) This sample creates a plate with a set of holes at the corners. @@ -2914,9 +2927,15 @@ def hole( One hole is created for each item on the stack. A very common use case is to use a construction rectangle to define the centers of a set of holes, like so:: - s = Workplane(Plane.XY()).box(2,4,0.5).faces(">Z").workplane()\ - .rect(1.5,3.5,forConstruction=True)\ - .vertices().hole(0.125, 0.25,82,depth=None) + s = ( + Workplane() + .box(2, 4, 0.5) + .faces(">Z") + .workplane() + .rect(1.5, 3.5, forConstruction=True) + .vertices() + .hole(0.125, 0.25, 82, depth=None) + ) This sample creates a plate with a set of holes at the corners.