From 04059e4e76d324fa6d6da763429ef403c0c82b32 Mon Sep 17 00:00:00 2001 From: mmporong Date: Wed, 28 Oct 2026 11:03:45 +0900 Subject: [PATCH] Fix parameter names in docstrings Workplane (inPlane), Workplane.translate (vec), Workplane.each (callback), Workplane.twistExtrude (angleDegrees), Workplane.sweep (multisection), Mixin1D.curvatures (ds) and DxfDocument.add_shape (shape) documented their parameters under old names, and Mixin1D.paramsLength also documented a pts parameter it does not take. --- cadquery/cq.py | 16 ++++++++-------- cadquery/occ_impl/exporters/dxf.py | 2 +- cadquery/occ_impl/shapes.py | 3 +-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cadquery/cq.py b/cadquery/cq.py index 8d5a4cd25..95fe13c58 100644 --- a/cadquery/cq.py +++ b/cadquery/cq.py @@ -125,8 +125,8 @@ class Workplane(object): """ Defines a coordinate system in space, in which 2D coordinates can be used. - :param plane: the plane in which the workplane will be done - :type plane: a Plane object, or a string in (XY|YZ|XZ|front|back|top|bottom|left|right) + :param inPlane: the plane in which the workplane will be done + :type inPlane: a Plane object, or a string in (XY|YZ|XZ|front|back|top|bottom|left|right) :param origin: the desired origin of the new workplane :type origin: a 3-tuple in global coordinates, or None to default to the origin :param obj: an object to use initially for the stack @@ -1169,8 +1169,8 @@ def translate(self: T, vec: VectorLike) -> T: """ Returns a copy of all of the items on the stack moved by the specified translation vector. - :param tupleDistance: distance to move, in global coordinates - :type tupleDistance: a 3-tuple of float + :param vec: distance to move, in global coordinates + :type vec: a 3-tuple of float :returns: a CQ object """ return self.newObject( @@ -2389,7 +2389,7 @@ def each( Special note: a newly created workplane always has its center point as its only stack item - :param callBackFunction: the function to call for each item on the current stack. + :param callback: the function to call for each item on the current stack. :param useLocalCoordinates: should values be converted from local coordinates first? :param combine: True or "a" to combine the resulting solid with parent solids if found, "cut" or "s" to remove the resulting solid from the parent solids if found. @@ -2399,7 +2399,7 @@ def each( The callback function must accept one argument, which is the item on the stack, and return one object, which is collected. If the function returns None, nothing is added to the stack. - The object passed into the callBackFunction is potentially transformed to local coordinates, + The object passed into the callback is potentially transformed to local coordinates, if useLocalCoordinates is true useLocalCoordinates is very useful for plugin developers. @@ -2997,7 +2997,7 @@ def twistExtrude( complex geometries :param distance: the distance to extrude normal to the workplane - :param angle: angle (in degrees) to rotate through the extrusion + :param angleDegrees: angle (in degrees) to rotate through the extrusion :param combine: True or "a" to combine the resulting solid with parent solids if found, "cut" or "s" to remove the resulting solid from the parent solids if found. False to keep the resulting solid separated from the parent solids. @@ -3172,7 +3172,7 @@ def sweep( Use all un-extruded wires in the parent chain to create a swept solid. :param path: A wire along which the pending wires will be swept - :param multiSection: False to create multiple swept from wires on the chain along path. + :param multisection: False to create multiple swept from wires on the chain along path. True to create only one solid swept along path with shape following the list of wires on the chain :param combine: True or "a" to combine the resulting solid with parent solids if found, "cut" or "s" to remove the resulting solid from the parent solids if found. diff --git a/cadquery/occ_impl/exporters/dxf.py b/cadquery/occ_impl/exporters/dxf.py index 1106fef01..1511bcca6 100644 --- a/cadquery/occ_impl/exporters/dxf.py +++ b/cadquery/occ_impl/exporters/dxf.py @@ -150,7 +150,7 @@ def add_layer( def add_shape(self, shape: Union[WorkplaneLike, Shape], layer: str = "") -> Self: """Add CadQuery shape to a DXF layer. - :param s: CadQuery Workplane or Shape + :param shape: CadQuery Workplane or Shape :param layer: layer definition name """ diff --git a/cadquery/occ_impl/shapes.py b/cadquery/occ_impl/shapes.py index 40dd9dccf..ecf837d01 100644 --- a/cadquery/occ_impl/shapes.py +++ b/cadquery/occ_impl/shapes.py @@ -2265,7 +2265,6 @@ def paramsLength(self: Mixin1DProtocol, locations: Iterable[float]) -> list[floa :param locations: list of distances. :returns: list of u values. - :param pts: the points to compute the parameters at. """ us = [] @@ -2601,7 +2600,7 @@ def curvatures( """ Calculate mean curvatures along the underlying curve. - :param d: distance or parameter values + :param ds: distance or parameter values :param mode: position calculation mode (default: length) :param resolution: resolution of the calculation (default: 1e-6) :return: mean curvature value at the specified d value.