Skip to content

Commit ab1427d

Browse files
authored
Merge pull request #695 from fedorkotov/master
Docstring and error message fixes
2 parents d5ce132 + 6544e66 commit ab1427d

File tree

5 files changed

+51
-51
lines changed

5 files changed

+51
-51
lines changed

cadquery/cq.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ def workplane(
477477
The result will be a 2-d working plane
478478
with a new coordinate system set up as follows:
479479
480-
* The centerOption paramter sets how the center is defined.
480+
* The centerOption parameter sets how the center is defined.
481481
Options are 'CenterOfMass', 'CenterOfBoundBox', or 'ProjectedOrigin'.
482482
'CenterOfMass' and 'CenterOfBoundBox' are in relation to the selected
483483
face(s) or vertex (vertices). 'ProjectedOrigin' uses by default the current origin
@@ -1443,7 +1443,7 @@ def polarArray(
14431443
false, angle is the angle between elements.
14441444
:param count: Number of elements in array. ( > 0 )
14451445
:param fill: Interpret the angle as total if True (default: True).
1446-
:param rotate: Rorate every item (default: True).
1446+
:param rotate: Rotate every item (default: True).
14471447
"""
14481448

14491449
if count <= 0:
@@ -2778,7 +2778,7 @@ def twistExtrude(
27782778
complex geometries
27792779
27802780
:param distance: the distance to extrude normal to the workplane
2781-
:param angle: angline ( in degrees) to rotate through the extrusion
2781+
:param angle: angle (in degrees) to rotate through the extrusion
27822782
:param boolean combine: True to combine the resulting solid with parent solids if found.
27832783
:param boolean clean: call :py:meth:`clean` afterwards to have a clean shape
27842784
:return: a CQ object with the resulting solid selected.
@@ -2791,7 +2791,7 @@ def twistExtrude(
27912791
eDir = self.plane.zDir.multiply(distance)
27922792

27932793
# one would think that fusing faces into a compound and then extruding would work,
2794-
# but it doesnt-- the resulting compound appears to look right, ( right number of faces, etc)
2794+
# but it doesn't-- the resulting compound appears to look right, ( right number of faces, etc)
27952795
# but then cutting it from the main solid fails with BRep_NotDone.
27962796
# the work around is to extrude each and then join the resulting solids, which seems to work
27972797

@@ -2955,7 +2955,7 @@ def sweep(
29552955
from warnings import warn
29562956

29572957
warn(
2958-
"sweepAlongWires keyword argument is is depracated and will "
2958+
"sweepAlongWires keyword argument is is deprecated and will "
29592959
"be removed in the next version; use multisection instead",
29602960
DeprecationWarning,
29612961
)

cadquery/occ_impl/geom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def named(cls: Type["Plane"], stdName: str, origin=(0, 0, 0)) -> "Plane":
384384
:param stdName: one of (XY|YZ|ZX|XZ|YX|ZY|front|back|left|right|top|bottom)
385385
:type stdName: string
386386
:param origin: the desired origin, specified in global coordinates
387-
:type origin: 3-tuple of the origin of the new plane, in global coorindates.
387+
:type origin: 3-tuple of the origin of the new plane, in global coordinates.
388388
389389
Available named planes are as follows. Direction references refer to
390390
the global directions.
@@ -879,7 +879,7 @@ def __init__(self) -> None:
879879

880880
@overload
881881
def __init__(self, t: Vector) -> None:
882-
"""Location with translation t with respect to the orignal location."""
882+
"""Location with translation t with respect to the original location."""
883883
...
884884

885885
@overload

cadquery/occ_impl/shapes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ def transformGeometry(self, tMatrix: Matrix) -> "Shape":
869869
transformations.
870870
871871
If your transformation is only translation and rotation, it is safer to
872-
use :py:meth:`transformShape`, which doesnt change the underlying type
872+
use :py:meth:`transformShape`, which doesn't change the underlying type
873873
of the geometry, but cannot handle skew transformations.
874874
875875
:param tMatrix: The transformation matrix
@@ -1607,7 +1607,7 @@ def combine(
16071607
cls: Type["Wire"], listOfWires: Iterable[Union["Wire", Edge]], tol: float = 1e-9
16081608
) -> List["Wire"]:
16091609
"""
1610-
Attempt to combine a list of wires and egdes into a new wire.
1610+
Attempt to combine a list of wires and edges into a new wire.
16111611
:param cls:
16121612
:param listOfWires:
16131613
:param tol: default 1e-9
@@ -2248,7 +2248,7 @@ def interpPlate(
22482248
:param surf_pts = [] (uses only edges if [])
22492249
:type surf_pts: list of [x,y,z] float coordinates
22502250
:param thickness = 0 (returns 2D surface if 0)
2251-
:type thickness: float (may be negative or positive depending on thicknening direction)
2251+
:type thickness: float (may be negative or positive depending on thickening direction)
22522252
:param Degree = 3 (OCCT default)
22532253
:type Degree: Integer >= 2
22542254
:param NbPtsOnCur = 15 (OCCT default)
@@ -2423,7 +2423,7 @@ def makeTorus(
24232423
) -> "Solid":
24242424
"""
24252425
makeTorus(radius1,radius2,[pnt,dir,angle1,angle2,angle]) --
2426-
Make a torus with agiven radii and angles
2426+
Make a torus with a given radii and angles
24272427
By default pnt=Vector(0,0,0),dir=Vector(0,0,1),angle1=0
24282428
,angle1=360 and angle=360'
24292429
"""

cadquery/selectors.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ class DirectionMinMaxSelector(CenterNthSelector):
425425
CQ(aCube).faces(DirectionMinMaxSelector((0, 0, 1), True)
426426
427427
Means to select the face having the center of mass farthest in the positive
428-
z direction, and is the same as:
428+
z direction, and is the same as::
429429
430430
CQ(aCube).faces(">Z")
431431
@@ -487,49 +487,49 @@ class AreaNthSelector(_NthSelector):
487487
Selects the object(s) with Nth area
488488
489489
Applicability:
490-
Faces, Shells, Solids - Shape.Area() is used to compute area
491-
closed planar Wires - a temporary face is created to compute area
490+
- Faces, Shells, Solids - Shape.Area() is used to compute area
491+
- closed planar Wires - a temporary face is created to compute area
492492
493493
Will ignore non-planar or non-closed wires.
494494
495495
Among other things can be used to select one of
496496
the nested coplanar wires or faces.
497497
498-
For example to create a fillet on a shank:
499-
500-
result = (
501-
cq.Workplane("XY")
502-
.circle(5)
503-
.extrude(2)
504-
.circle(2)
505-
.extrude(10)
506-
.faces(">Z[-2]")
507-
.wires(AreaNthSelector(0))
508-
.fillet(2)
509-
)
510-
511-
Or to create a lip on a case seam:
512-
513-
result = (
514-
cq.Workplane("XY")
515-
.rect(20, 20)
516-
.extrude(10)
517-
.edges("|Z or <Z")
518-
.fillet(2)
519-
.faces(">Z")
520-
.shell(2)
521-
.faces(">Z")
522-
.wires(AreaNthSelector(-1))
523-
.toPending()
524-
.workplane()
525-
.offset2D(-1)
526-
.extrude(1)
527-
.faces(">Z[-2]")
528-
.wires(AreaNthSelector(0))
529-
.toPending()
530-
.workplane()
531-
.cutBlind(2)
532-
)
498+
For example to create a fillet on a shank::
499+
500+
result = (
501+
cq.Workplane("XY")
502+
.circle(5)
503+
.extrude(2)
504+
.circle(2)
505+
.extrude(10)
506+
.faces(">Z[-2]")
507+
.wires(AreaNthSelector(0))
508+
.fillet(2)
509+
)
510+
511+
Or to create a lip on a case seam::
512+
513+
result = (
514+
cq.Workplane("XY")
515+
.rect(20, 20)
516+
.extrude(10)
517+
.edges("|Z or <Z")
518+
.fillet(2)
519+
.faces(">Z")
520+
.shell(2)
521+
.faces(">Z")
522+
.wires(AreaNthSelector(-1))
523+
.toPending()
524+
.workplane()
525+
.offset2D(-1)
526+
.extrude(1)
527+
.faces(">Z[-2]")
528+
.wires(AreaNthSelector(0))
529+
.toPending()
530+
.workplane()
531+
.cutBlind(2)
532+
)
533533
"""
534534

535535
def key(self, obj: Shape) -> float:

cadquery/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def wrapped(*args, **kwargs):
1717

1818
if self.name not in f_sig_bound.kwargs:
1919
warn(
20-
f"Default walue of {self.name} will change in the next relase to {self.new_value}",
20+
f"Default value of {self.name} will change in the next release to {self.new_value}",
2121
FutureWarning,
2222
)
2323

@@ -31,7 +31,7 @@ def __call__(self, f):
3131
@wraps(f)
3232
def wrapped(*args, **kwargs):
3333

34-
warn(f"{f.__name__} will be removed in the next relase.", FutureWarning)
34+
warn(f"{f.__name__} will be removed in the next release.", FutureWarning)
3535

3636
return f(*args, **kwargs)
3737

0 commit comments

Comments
 (0)