[bindings] remove redundant signatures. batch1

This commit is contained in:
Frank Martinez
2025-10-10 14:09:50 -05:00
parent d8b1a36e19
commit fc99a20a03
34 changed files with 194 additions and 668 deletions

View File

@@ -7,6 +7,7 @@ from typing import Any, Final
from Base.Metadata import constmethod, export
from App.Part import Part
from App.DocumentObject import DocumentObject
@export(Include="Mod/Assembly/App/AssemblyObject.h", Namespace="Assembly")
@@ -19,10 +20,9 @@ class AssemblyObject(Part):
"""
@constmethod
def solve(self) -> Any:
"""Solve the assembly and update part placements.
solve(enableRedo=False) -> int
def solve(self, enableUndo: bool = False, /) -> int:
"""
Solve the assembly and update part placements.
Args:
enableRedo: Whether the solve save the initial position of parts
@@ -38,14 +38,14 @@ class AssemblyObject(Part):
-3 if conflicting constraints,
-5 if malformed constraints
-1 if solver error,
-2 if redundant constraints."""
-2 if redundant constraints.
"""
...
@constmethod
def generateSimulation(self) -> Any:
"""Generate the simulation.
solve(simulationObject) -> int
def generateSimulation(self, simulationObject: DocumentObject, /) -> int:
"""
Generate the simulation.
Args:
simulationObject: The simulation Object.
@@ -58,111 +58,101 @@ class AssemblyObject(Part):
-3 if conflicting constraints,
-5 if malformed constraints
-1 if solver error,
-2 if redundant constraints."""
-2 if redundant constraints.
"""
...
@constmethod
def updateForFrame(self) -> Any:
"""Update entire assembly to frame number specified.
def updateForFrame(self, index: int, /) -> None:
"""
Update entire assembly to frame number specified.
updateForFrame(index)
Args:
index: index of frame.
Args: index of frame.
Returns: None"""
Returns: None
"""
...
@constmethod
def numberOfFrames(self) -> Any:
"""numberOfFrames()
Args: None
Returns: Number of frames"""
def numberOfFrames(self) -> int:
"""Return Number of frames"""
...
@constmethod
def undoSolve(self) -> Any:
"""Undo the last solve of the assembly and return part placements to their initial position.
undoSolve()
Returns: None"""
def undoSolve(self) -> None:
"""
Undo the last solve of the assembly and return part placements to their initial position.
"""
...
@constmethod
def ensureIdentityPlacements(self) -> Any:
"""Makes sure that LinkGroups or sub-assemblies have identity placements.
ensureIdentityPlacements()
Returns: None"""
def ensureIdentityPlacements(self) -> None:
"""
Makes sure that LinkGroups or sub-assemblies have identity placements.
"""
...
@constmethod
def clearUndo(self) -> Any:
"""Clear the registered undo positions.
clearUndo()
Returns: None"""
def clearUndo(self) -> None:
"""
Clear the registered undo positions.
"""
...
@constmethod
def isPartConnected(self) -> Any:
"""Check if a part is connected to the ground through joints.
isPartConnected(obj) -> bool
Args: document object to check.
Returns: True if part is connected to ground"""
def isPartConnected(self, obj: DocumentObject, /) -> bool:
"""
Check if a part is connected to the ground through joints.
Returns: True if part is connected to ground.
"""
...
@constmethod
def isJointConnectingPartToGround(self) -> Any:
"""Check if a joint is connecting a part to the ground.
isJointConnectingPartToGround(joint, propName) -> bool
def isJointConnectingPartToGround(self, joint: DocumentObject, prop_name: str, /) -> Any:
"""
Check if a joint is connecting a part to the ground.
Args:
- joint: document object of the joint to check.
- propName: string 'Part1' or 'Part2' of the joint.
- prop_name: string 'Part1' or 'Part2' of the joint.
Returns: True if part is connected to ground"""
Returns: True if part is connected to ground.
"""
...
@constmethod
def isPartGrounded(self) -> Any:
"""Check if a part has a grounded joint.
isPartGrounded(obj) -> bool
def isPartGrounded(self, obj: DocumentObject, /) -> Any:
"""
Check if a part has a grounded joint.
Args:
- obj: document object of the part to check.
Returns: True if part has grounded joint"""
Returns: True if part has grounded joint.
"""
...
@constmethod
def exportAsASMT(self) -> Any:
"""Export the assembly in a text format called ASMT.
exportAsASMT(fileName:str)
def exportAsASMT(self, file_name: str, /) -> None:
"""
Export the assembly in a text format called ASMT.
Args:
fileName: The name of the file where the ASMT will be exported."""
- fileName: The name of the file where the ASMT will be exported.
"""
...
@constmethod
def getDownstreamParts(self, start_part: "App.DocumentObject", joint_to_ignore: "App.DocumentObject",
/) -> list["App.DocumentObject"]:
def getDownstreamParts(
self,
start_part: DocumentObject,
joint_to_ignore: DocumentObject,
/) -> list[DocumentObject]:
"""
Finds all parts connected to a start_part that are not connected to ground
when a specific joint is ignored.
getDownstreamParts(start_part, joint_to_ignore) -> list
This is used to find the entire rigid group of unconstrained components that
should be moved together during a pre-solve operation or a drag.

View File

@@ -2,12 +2,13 @@
from __future__ import annotations
from typing import Any, List, Tuple
from typing import Any, List, Tuple, TypeAlias
from Base.Metadata import export
from App.DocumentObject import DocumentObject
from Gui.ViewProvider import ViewProvider
SoTransformDragger: TypeAlias = Any
@export(Include="Mod/Assembly/Gui/ViewProviderAssembly.h", Namespace="AssemblyGui")
class ViewProviderAssembly(ViewProvider):
@@ -21,17 +22,11 @@ class ViewProviderAssembly(ViewProvider):
def isInEditMode(self) -> Any:
"""
Return true if the assembly object is currently in edit mode.
isInEditMode() -> bool"""
"""
...
def getDragger(self) -> Any:
"""
Return the assembly dragger coin object.
getDragger() -> SoTransformDragger
Returns: dragger coin object of the assembly"""
def getDragger(self) -> SoTransformDragger:
"""Return the assembly dragger coin object."""
...
def isolateComponents(

View File

@@ -29,24 +29,25 @@ class Area(BaseClass):
""""""
...
def setPlane(self) -> Any:
"""setPlane(shape): Set the working plane.
def setPlane(self) -> None:
"""
Set the working plane.
The supplied shape does not need to be planar. Area will try to find planar
sub-shape (face, wire or edge). If more than one planar sub-shape is found, it
will prefer the top plane parallel to XY0 plane. If no working plane are set,
Area will try to find a working plane from the added children shape using the
same algorithm"""
same algorithm
"""
...
def getShape(self, **kwargs) -> Any:
"""getShape(index=-1,rebuild=False): Return the resulting shape
"""
Return the resulting shape
* index (-1): the index of the section. -1 means all sections. No effect on planar shape.
* rebuild: clean the internal cache and rebuild"""
* rebuild: clean the internal cache and rebuild
"""
...
def makeOffset(self, **kwargs) -> Any:

View File

@@ -22,15 +22,15 @@ class Command(Persistence):
@constmethod
def toGCode(self) -> str:
"""toGCode(): returns a GCode representation of the command"""
"""returns a GCode representation of the command"""
...
def setFromGCode(self, gcode: str, /) -> None:
"""setFromGCode(): sets the path from the contents of the given GCode string"""
"""sets the path from the contents of the given GCode string"""
...
def transform(self, placement: Placement, /) -> Command:
"""transform(Placement): returns a copy of this command transformed by the given placement"""
"""returns a copy of this command transformed by the given placement"""
...
Name: str

View File

@@ -24,7 +24,10 @@ class FeatureArea(DocumentObject):
...
def setParams(self, **kwargs) -> Any:
"""setParams(key=value...): Convenient function to configure this feature.
"""
Convenient function to configure this feature.
Call with keywords: setParams(key=value, ...)
Same usage as Path.Area.setParams(). This function stores the parameters in the properties.
"""

View File

@@ -1,10 +1,12 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
from typing import Any, Final
from __future__ import annotations
from typing import Any, Final, overload, Union
from Base.Metadata import constmethod, export
from Base.Persistence import Persistence
from .Command import Command
@export(
Include="Mod/CAM/App/Path.h",
@@ -23,36 +25,44 @@ class Path(Persistence):
License: LGPL-2.1-or-later
"""
def addCommands(self) -> Any:
@overload
def addCommands(self, command: Command, /) -> Path: ...
@overload
def addCommands(self, commands: list[Command], /) -> Path: ...
def addCommands(self, arg: Union[Command, list[Command]], /) -> Path:
"""adds a command or a list of commands at the end of the path"""
...
def insertCommand(self) -> Any:
"""insertCommand(Command,[int]):
adds a command at the given position or at the end of the path"""
def insertCommand(self, command: Command, pos: int = -1, /) -> Path:
"""
adds a command at the given position or at the end of the path
"""
...
def deleteCommand(self) -> Any:
"""deleteCommand([int]):
deletes the command found at the given position or from the end of the path"""
def deleteCommand(self, pos: int = -1, /) -> Path:
"""
deletes the command found at the given position or from the end of the path
"""
...
def setFromGCode(self) -> Any:
def setFromGCode(self, gcode: str, /) -> None:
"""sets the contents of the path from a gcode string"""
...
@constmethod
def toGCode(self) -> Any:
def toGCode(self) -> str:
"""returns a gcode string representing the path"""
...
@constmethod
def copy(self) -> Any:
def copy(self) -> Path:
"""returns a copy of this path"""
...
@constmethod
def getCycleTime(self) -> Any:
def getCycleTime(self, h_feed: float, v_feed: float, h_rapid: float, v_rapid: float, /) -> float:
"""return the cycle time estimation for this path in s"""
...

View File

@@ -5,6 +5,7 @@ from typing import Any, Final
from Base.BaseClass import BaseClass
from Base.Metadata import constmethod, export
from Base.Vector import Vector
@export(
Include="Mod/CAM/App/Voronoi.h",
@@ -35,12 +36,12 @@ class Voronoi(BaseClass):
"""Return number of vertices"""
...
def addPoint(self) -> Any:
"""addPoint(vector|vector2d) add given point to input collection"""
def addPoint(self, point: Vector, /) -> None:
"""add given point to input collection"""
...
def addSegment(self) -> Any:
"""addSegment(vector|vector2d, vector|vector2d) add given segment to input collection"""
def addSegment(self, point1: Vector, point2: Vector, /) -> Any:
"""add given segment to input collection"""
...
def construct(self) -> Any:

View File

@@ -7,6 +7,10 @@ from typing import Any, Final
from Base.BaseClass import BaseClass
from Base.Metadata import export
from Part.App.TopoShape import TopoShape
from Mesh.App.Mesh import Mesh
from Base.Placement import Placement
from CAM.App.Command import Command
@export(
FatherInclude="Base/BaseClassPy.h",
@@ -27,30 +31,28 @@ class PathSim(BaseClass):
License: LGPL-2.1-or-later
"""
def BeginSimulation(self, **kwargs) -> Any:
"""BeginSimulation(stock, resolution):
Start a simulation process on a box shape stock with given resolution"""
...
def SetToolShape(self) -> Any:
"""SetToolShape(shape):
Set the shape of the tool to be used for simulation"""
...
def GetResultMesh(self) -> Any:
def BeginSimulation(self, stock: TopoShape, resolution: float) -> None:
"""
Start a simulation process on a box shape stock with given resolution
"""
GetResultMesh():
Return the current mesh result of the simulation."""
...
def ApplyCommand(self, **kwargs) -> Any:
def SetToolShape(self, tool: TopoShape, resolution: float, /) -> None:
"""
ApplyCommand(placement, command):
Set the shape of the tool to be used for simulation
"""
...
Apply a single path command on the stock starting from placement."""
def GetResultMesh(self) -> tuple[Mesh, Mesh]:
"""
Return the current mesh result of the simulation.
"""
...
def ApplyCommand(self, placement: Placement, command: Command) -> Placement:
"""
Apply a single path command on the stock starting from placement.
"""
...
Tool: Final[Any]

View File

@@ -5,8 +5,10 @@ from __future__ import annotations
from typing import Any
from Base.BaseClass import BaseClass
from Base.Metadata import export
from Metadata import no_args
from Base.Metadata import export, no_args
from Part.App.TopoShape import TopoShape
from CAM.App.Command import Command
@export(
@@ -28,38 +30,33 @@ class CAMSim(BaseClass):
License: LGPL-2.1-or-later
"""
def BeginSimulation(self, **kwargs) -> Any:
def BeginSimulation(self, stock: TopoShape, resolution: float) -> None:
"""
Start a simulation process on a box shape stock with given resolution
"""
BeginSimulation(stock, resolution):
Start a simulation process on a box shape stock with given resolution"""
...
@no_args
def ResetSimulation(self) -> Any:
def ResetSimulation(self) -> None:
"""
Clear the simulation and all gcode commands
"""
ResetSimulation():
Clear the simulation and all gcode commands"""
...
def AddTool(self, **kwargs) -> Any:
def AddTool(self, shape: TopoShape, toolnumber: int, diameter: float, resolution: float) -> Any:
"""
Set the shape of the tool to be used for simulation
"""
AddTool(shape, toolnumber, diameter, resolution):
Set the shape of the tool to be used for simulation"""
...
def SetBaseShape(self, **kwargs) -> Any:
def SetBaseShape(self, shape: TopoShape, resolution: float) -> None:
"""
Set the shape of the base object of the job
"""
SetBaseShape(shape, resolution):
Set the shape of the base object of the job"""
...
def AddCommand(self) -> Any:
def AddCommand(self, command: Command, /) -> Any:
"""
Add a path command to the simulation.
"""
AddCommand(command):
Add a path command to the simulation."""
...