[bindings] fix signatures in pyi files

This commit is contained in:
Frank Martinez
2025-09-25 20:43:33 -05:00
parent 8c7f381416
commit 748004b4e4
247 changed files with 2001 additions and 897 deletions

View File

@@ -1,3 +1,7 @@
# SPDX-License: LGPL-2.1-or-later
from __future__ import annotations
from Base.Metadata import export
from Base.Persistence import Persistence
from typing import Final

View File

@@ -1,3 +1,7 @@
# SPDX-License: LGPL-2.1-or-later
from __future__ import annotations
from Base.Metadata import export, constmethod
from Part.App.GeometryExtension import GeometryExtension
from typing import Final, overload

View File

@@ -1,3 +1,7 @@
# SPDX-License: LGPL-2.1-or-later
from __future__ import annotations
from Base.Metadata import export, constmethod
from Base.BaseClass import BaseClass
from typing import Final, List

View File

@@ -1,3 +1,7 @@
# SPDX-License: LGPL-2.1-or-later
from __future__ import annotations
from Base.Metadata import export, constmethod
from Base.BaseClass import BaseClass
from Base.Axis import Axis
@@ -61,71 +65,71 @@ class GeometryFacade(BaseClass):
"""
...
def rotate(self, Ang: float, axis: Axis) -> None:
def rotate(self, Ang: float, axis: Axis, /) -> None:
"""
Rotates this geometric object at angle Ang (in radians) about axis
"""
...
def scale(self, center: CoordinateSystem, factor: float) -> None:
def scale(self, center: CoordinateSystem, factor: float, /) -> None:
"""
Applies a scaling transformation on this geometric object with a center and scaling factor
"""
...
def transform(self, transformation: Placement) -> None:
def transform(self, transformation: Placement, /) -> None:
"""
Applies a transformation to this geometric object
"""
...
def translate(self, offset: Vector) -> None:
def translate(self, offset: Vector, /) -> None:
"""
Translates this geometric object
"""
...
@constmethod
def hasExtensionOfType(self, type_str: str) -> bool:
def hasExtensionOfType(self, type_str: str, /) -> bool:
"""
Returns a boolean indicating whether a geometry extension of the type indicated as a string exists.
"""
...
@constmethod
def hasExtensionOfName(self, name: str) -> bool:
def hasExtensionOfName(self, name: str, /) -> bool:
"""
Returns a boolean indicating whether a geometry extension with the name indicated as a string exists.
"""
...
@constmethod
def getExtensionOfType(self, type_str: str) -> DocumentObjectExtension:
def getExtensionOfType(self, type_str: str, /) -> DocumentObjectExtension:
"""
Gets the first geometry extension of the type indicated by the string.
"""
...
@constmethod
def getExtensionOfName(self, name: str) -> DocumentObjectExtension:
def getExtensionOfName(self, name: str, /) -> DocumentObjectExtension:
"""
Gets the first geometry extension of the name indicated by the string.
"""
...
def setExtension(self, extension: DocumentObjectExtension) -> None:
def setExtension(self, extension: DocumentObjectExtension, /) -> None:
"""
Sets a geometry extension of the indicated type.
"""
...
def deleteExtensionOfType(self, type_str: str) -> None:
def deleteExtensionOfType(self, type_str: str, /) -> None:
"""
Deletes all extensions of the indicated type.
"""
...
def deleteExtensionOfName(self, name: str) -> None:
def deleteExtensionOfName(self, name: str, /) -> None:
"""
Deletes all extensions of the indicated name.
"""

View File

@@ -1,3 +1,7 @@
# SPDX-License: LGPL-2.1-or-later
from __future__ import annotations
from Base.Metadata import export, constmethod
from Base.Persistence import Persistence
from Base.Vector import Vector
@@ -56,8 +60,7 @@ class Sketch(Persistence):
...
def moveGeometry(
self, GeoIndex: int, PointPos: Vector, Vector: Vector, relative: bool = False
) -> None:
self, GeoIndex: int, PointPos: Vector, Vector: Vector, relative: bool = False, /) -> None:
"""
moveGeometry(GeoIndex,PointPos,Vector,[relative]) - move a given point (or curve)
to another location.

View File

@@ -1,3 +1,7 @@
# SPDX-License: LGPL-2.1-or-later
from __future__ import annotations
from Base.Metadata import export, constmethod
from Part.App.GeometryExtension import GeometryExtension

View File

@@ -1,3 +1,7 @@
# SPDX-License: LGPL-2.1-or-later
from __future__ import annotations
from Base.Metadata import export, constmethod, no_args
from Base.Quantity import Quantity
from Base.Vector import Vector
@@ -79,12 +83,11 @@ class SketchObject(Part2DObject):
...
@overload
def addGeometry(self, geo: Geometry, isConstruction: bool = False) -> int: ...
def addGeometry(self, geo: Geometry, isConstruction: bool = False, /) -> int: ...
@overload
def addGeometry(self, geo: List[Geometry], isConstruction: bool = False) -> Tuple[int, ...]: ...
def addGeometry(self, geo: List[Geometry], isConstruction: bool = False, /) -> Tuple[int, ...]: ...
def addGeometry(
self, geo: Union[Geometry, List[Geometry]], isConstruction: bool = False
) -> Union[int, Tuple[int, ...]]:
self, geo: Union[Geometry, List[Geometry]], isConstruction: bool = False, /) -> Union[int, Tuple[int, ...]]:
"""
Add geometric objects to the sketch.
@@ -111,7 +114,7 @@ class SketchObject(Part2DObject):
"""
...
def delGeometry(self, geoId: int, noSolve: bool) -> None:
def delGeometry(self, geoId: int, noSolve: bool, /) -> None:
"""
Delete a geometric object from the sketch.
@@ -123,7 +126,7 @@ class SketchObject(Part2DObject):
"""
...
def delGeometries(self, geoIds: List[int], noSolve: bool) -> None:
def delGeometries(self, geoIds: List[int], noSolve: bool, /) -> None:
"""
Delete a list of geometric objects from the sketch.
@@ -135,7 +138,7 @@ class SketchObject(Part2DObject):
"""
...
def deleteAllGeometry(self, noSolve: bool) -> None:
def deleteAllGeometry(self, noSolve: bool, /) -> None:
"""
Delete all the geometry objects from the sketch, except external geometry.
@@ -143,7 +146,7 @@ class SketchObject(Part2DObject):
"""
...
def detectDegeneratedGeometries(self, tolerance: float) -> int:
def detectDegeneratedGeometries(self, tolerance: float, /) -> int:
"""
Detect degenerated geometries. A curve geometry is considered degenerated
if the parameter range is less than the tolerance.
@@ -158,7 +161,7 @@ class SketchObject(Part2DObject):
"""
...
def removeDegeneratedGeometries(self, tolerance: float) -> int:
def removeDegeneratedGeometries(self, tolerance: float, /) -> int:
"""
Remove degenerated geometries. A curve geometry is considered degenerated
if the parameter range is less than the tolerance.
@@ -181,7 +184,7 @@ class SketchObject(Part2DObject):
"""
...
def toggleConstruction(self, geoId: int) -> None:
def toggleConstruction(self, geoId: int, /) -> None:
"""
Toggles a geometry between regular and construction.
@@ -192,7 +195,7 @@ class SketchObject(Part2DObject):
"""
...
def setConstruction(self, geoId: int, state: bool) -> None:
def setConstruction(self, geoId: int, state: bool, /) -> None:
"""
Set construction mode of a geometry.
@@ -205,7 +208,7 @@ class SketchObject(Part2DObject):
"""
...
def getConstruction(self, geoId: int) -> bool:
def getConstruction(self, geoId: int, /) -> bool:
"""
Determine whether the given geometry is a "construction geometry".
@@ -221,12 +224,11 @@ class SketchObject(Part2DObject):
...
@overload
def addConstraint(self, constraint: Constraint) -> int: ...
def addConstraint(self, constraint: Constraint, /) -> int: ...
@overload
def addConstraint(self, constraints: List[Constraint]) -> Tuple[int, ...]: ...
def addConstraint(self, constraints: List[Constraint], /) -> Tuple[int, ...]: ...
def addConstraint(
self, constraint: Union[Constraint, List[Constraint]]
) -> Union[int, Tuple[int, ...]]:
self, constraint: Union[Constraint, List[Constraint]], /) -> Union[int, Tuple[int, ...]]:
"""
Add constraints to the sketch.
@@ -244,7 +246,7 @@ class SketchObject(Part2DObject):
"""
...
def delConstraint(self, constraintIndex: int, noSolve: bool) -> None:
def delConstraint(self, constraintIndex: int, noSolve: bool, /) -> None:
"""
Delete a constraint from the sketch.
@@ -256,8 +258,7 @@ class SketchObject(Part2DObject):
...
def delConstraints(
self, constraintIndices: List[int], updateGeometry: bool, noSolve: bool
) -> None:
self, constraintIndices: List[int], updateGeometry: bool, noSolve: bool, /) -> None:
"""
Delete multiple constraints from a sketch
@@ -269,7 +270,7 @@ class SketchObject(Part2DObject):
"""
...
def renameConstraint(self, constraintIndex: int, name: str) -> None:
def renameConstraint(self, constraintIndex: int, name: str, /) -> None:
"""
Rename a constraint in the sketch.
@@ -283,7 +284,7 @@ class SketchObject(Part2DObject):
...
@constmethod
def getIndexByName(self, name: str) -> int:
def getIndexByName(self, name: str, /) -> int:
"""
Get the index of a constraint by name.
@@ -295,7 +296,7 @@ class SketchObject(Part2DObject):
"""
...
def carbonCopy(self, objName: str, asConstruction: bool = True) -> None:
def carbonCopy(self, objName: str, asConstruction: bool = True, /) -> None:
"""
Copy another sketch's geometry and constraints into this sketch.
@@ -308,8 +309,7 @@ class SketchObject(Part2DObject):
...
def addExternal(
self, objName: str, subName: str, defining: bool = False, intersection: bool = False
) -> None:
self, objName: str, subName: str, defining: bool = False, intersection: bool = False, /) -> None:
"""
Add a link to an external geometry.
@@ -324,7 +324,7 @@ class SketchObject(Part2DObject):
"""
...
def delExternal(self, extGeoId: int) -> None:
def delExternal(self, extGeoId: int, /) -> None:
"""
Delete an external geometry link from the sketch.
@@ -336,9 +336,9 @@ class SketchObject(Part2DObject):
...
@overload
def delConstraintOnPoint(self, vertexId: int) -> None: ...
def delConstraintOnPoint(self, vertexId: int, /) -> None: ...
@overload
def delConstraintOnPoint(self, geoId: int, pointPos: int) -> None: ...
def delConstraintOnPoint(self, geoId: int, pointPos: int, /) -> None: ...
def delConstraintOnPoint(self, *args: int) -> None:
"""
Delete coincident constraints associated with a sketch point.
@@ -366,7 +366,7 @@ class SketchObject(Part2DObject):
"""
...
def setDatum(self, constraint: Union[int, str], value: Union[float, Quantity]) -> None:
def setDatum(self, constraint: Union[int, str], value: Union[float, Quantity], /) -> None:
"""
Set the value of a datum constraint (e.g. Distance or Angle)
@@ -381,7 +381,7 @@ class SketchObject(Part2DObject):
...
@constmethod
def getDatum(self, constraint: Union[int, str]) -> Quantity:
def getDatum(self, constraint: Union[int, str], /) -> Quantity:
"""
Get the value of a datum constraint (e.g. Distance or Angle)
@@ -395,7 +395,7 @@ class SketchObject(Part2DObject):
"""
...
def setDriving(self, constraintIndex: int, state: bool) -> None:
def setDriving(self, constraintIndex: int, state: bool, /) -> None:
"""
Set the Driving status of a datum constraint.
@@ -408,7 +408,7 @@ class SketchObject(Part2DObject):
"""
...
def setDatumsDriving(self, state: bool) -> None:
def setDatumsDriving(self, state: bool, /) -> None:
"""
Set the Driving status of all datum constraints.
@@ -433,7 +433,7 @@ class SketchObject(Part2DObject):
...
@constmethod
def getDriving(self, constraintIndex: int) -> bool:
def getDriving(self, constraintIndex: int, /) -> bool:
"""
Get the Driving status of a datum constraint.
@@ -448,7 +448,7 @@ class SketchObject(Part2DObject):
"""
...
def toggleDriving(self, constraintIndex: int) -> None:
def toggleDriving(self, constraintIndex: int, /) -> None:
"""
Toggle the Driving status of a datum constraint.
@@ -483,7 +483,7 @@ class SketchObject(Part2DObject):
"""
...
def setActive(self, constraintIndex: int, state: bool) -> None:
def setActive(self, constraintIndex: int, state: bool, /) -> None:
"""
Activates or deactivates a constraint (enforce it or not).
@@ -497,7 +497,7 @@ class SketchObject(Part2DObject):
...
@constmethod
def getActive(self, constraintIndex: int) -> bool:
def getActive(self, constraintIndex: int, /) -> bool:
"""
Get whether a constraint is active, i.e. enforced, or not.
@@ -512,7 +512,7 @@ class SketchObject(Part2DObject):
"""
...
def toggleActive(self, constraintIndex: int) -> None:
def toggleActive(self, constraintIndex: int, /) -> None:
"""
Toggle the constraint between active (enforced) and inactive.
@@ -524,7 +524,7 @@ class SketchObject(Part2DObject):
...
@constmethod
def getLabelPosition(self, constraintIndex: int) -> float:
def getLabelPosition(self, constraintIndex: int, /) -> float:
"""
Get label position of the constraint.
@@ -538,7 +538,7 @@ class SketchObject(Part2DObject):
"""
...
def setLabelPosition(self, constraintIndex: int, value: float) -> None:
def setLabelPosition(self, constraintIndex: int, value: float, /) -> None:
"""
Set label position of the constraint.
@@ -551,7 +551,7 @@ class SketchObject(Part2DObject):
...
@constmethod
def getLabelDistance(self, constraintIndex: int) -> float:
def getLabelDistance(self, constraintIndex: int, /) -> float:
"""
Get label distance of the constraint.
@@ -565,7 +565,7 @@ class SketchObject(Part2DObject):
"""
...
def setLabelDistance(self, constraintIndex: int, value: float) -> None:
def setLabelDistance(self, constraintIndex: int, value: float, /) -> None:
"""
Set label distance of the constraint.
@@ -578,8 +578,7 @@ class SketchObject(Part2DObject):
...
def moveGeometry(
self, GeoIndex: int, PointPos: int, Vector: Vector, relative: bool = False
) -> None:
self, GeoIndex: int, PointPos: int, Vector: Vector, relative: bool = False, /) -> None:
"""
Move a given point (or curve) to another location.
@@ -596,8 +595,7 @@ class SketchObject(Part2DObject):
...
def moveGeometries(
self, Geos: List[Tuple[int, int]], Vector: Vector, relative: bool = False
) -> None:
self, Geos: List[Tuple[int, int]], Vector: Vector, relative: bool = False, /) -> None:
"""
Move given points and curves to another location.
@@ -615,7 +613,7 @@ class SketchObject(Part2DObject):
...
@constmethod
def getPoint(self, GeoIndex: int, PointPos: int) -> Vector:
def getPoint(self, GeoIndex: int, PointPos: int, /) -> Vector:
"""
Retrieve the vector of a point in the sketch.
@@ -624,7 +622,7 @@ class SketchObject(Part2DObject):
...
@constmethod
def getGeoVertexIndex(self, index: int) -> Tuple[int, int]:
def getGeoVertexIndex(self, index: int, /) -> Tuple[int, int]:
"""
Retrieve the GeoId and PosId of a point in the sketch.
@@ -753,7 +751,7 @@ class SketchObject(Part2DObject):
"""
...
def calculateAngleViaPoint(self, GeoId1: int, GeoId2: int, px: float, py: float) -> float:
def calculateAngleViaPoint(self, GeoId1: int, GeoId2: int, px: float, py: float, /) -> float:
"""
calculateAngleViaPoint(GeoId1, GeoId2, px, py) - calculates angle between
curves identified by GeoId1 and GeoId2 at point (x,y). The point must be
@@ -762,7 +760,7 @@ class SketchObject(Part2DObject):
"""
...
def isPointOnCurve(self, GeoIdCurve: int, x: float, y: float) -> bool:
def isPointOnCurve(self, GeoIdCurve: int, x: float, y: float, /) -> bool:
"""
isPointOnCurve(GeoIdCurve, float x, float y) -> bool - tests if the point (x,y)
geometrically lies on a curve (e.g. ellipse). It treats lines as infinite,
@@ -770,7 +768,7 @@ class SketchObject(Part2DObject):
"""
...
def calculateConstraintError(self, index: int) -> float:
def calculateConstraintError(self, index: int, /) -> float:
"""
calculateConstraintError(index) - calculates the error function of the
constraint identified by its index and returns the signed error value.
@@ -780,7 +778,7 @@ class SketchObject(Part2DObject):
"""
...
def changeConstraintsLocking(self, bLock: bool) -> None:
def changeConstraintsLocking(self, bLock: bool, /) -> None:
"""
changeConstraintsLocking(bLock) - locks or unlocks all tangent and
perpendicular constraints. (Constraint locking prevents it from
@@ -837,19 +835,19 @@ class SketchObject(Part2DObject):
"""
...
def makeMissingPointOnPointCoincident(self, arg: bool) -> None:
def makeMissingPointOnPointCoincident(self, arg: bool, /) -> None:
"""
Applies the detected / set Point On Point coincident constraints. If the argument is True, then solving and redundant removal is done after each individual addition.
"""
...
def makeMissingVerticalHorizontal(self, arg: bool) -> None:
def makeMissingVerticalHorizontal(self, arg: bool, /) -> None:
"""
Applies the detected / set Vertical/Horizontal constraints. If the argument is True, then solving and redundant removal is done after each individual addition.
"""
...
def makeMissingEquality(self, arg: bool) -> None:
def makeMissingEquality(self, arg: bool, /) -> None:
"""
Applies the detected / set Equality constraints. If the argument is True, then solving and redundant removal is done after each individual addition.
"""
@@ -870,7 +868,7 @@ class SketchObject(Part2DObject):
"""
...
def autoRemoveRedundants(self, arg: bool) -> None:
def autoRemoveRedundants(self, arg: bool, /) -> None:
"""
Removes constraints currently detected as redundant by the solver. If the argument is True, then the geometry is updated after solving.
"""
@@ -888,7 +886,7 @@ class SketchObject(Part2DObject):
"""
...
def setGeometryIds(GeoIdsToIds: List[Tuple[int, int]]):
def setGeometryIds(GeoIdsToIds: List[Tuple[int, int]], /):
"""
Sets the GeometryId of the SketchGeometryExtension of the geometries with the provided GeoIds
Expects a list of pairs (GeoId, id)

View File

@@ -1,3 +1,7 @@
# SPDX-License: LGPL-2.1-or-later
from __future__ import annotations
from Base.Metadata import export
from Part.App.Part2DObject import Part2DObject

View File

@@ -1,3 +1,7 @@
# SPDX-License: LGPL-2.1-or-later
from __future__ import annotations
from Base.Metadata import export
from Part.App.GeometryExtension import GeometryExtension