fixing unnecessary list import

This commit is contained in:
Ian 'z0r0' Abreu
2025-07-20 18:55:33 -04:00
committed by Chris Hennes
parent e64b654699
commit ab225f5672
22 changed files with 481 additions and 22 deletions

View File

@@ -77,6 +77,7 @@ SET(SCL_Resources
SOURCE_GROUP("SCL" FILES ${SCL_Resources})
generate_from_xml(StepShapePy)
generate_from_py_(StepShapePy)
add_library(Import SHARED ${Import_SRCS})
target_link_libraries(Import ${Import_LIBS})

View File

@@ -0,0 +1,27 @@
from typing import Any
from Base.Metadata import export
from Base.PyObjectBase import PyObjectBase
@export(
Father="PyObjectBase",
Name="StepShapePy",
Twin="StepShape",
TwinPointer="StepShape",
Include="Mod/Import/App/StepShape.h",
Namespace="Import",
FatherInclude="Base/PyObjectBase.h",
FatherNamespace="Base",
Constructor=True,
Delete=True,
)
class StepShapePy(PyObjectBase):
"""
StepShape in Import
This class gives a interface to retrieve TopoShapes out of an loaded STEP file of any kind.
"""
def read(self) -> Any:
"""method read()
Read a STEP file into memory and make it accessible"""
...

View File

@@ -13,6 +13,9 @@ set(Measure_LIBS
generate_from_xml(MeasurementPy)
generate_from_xml(MeasureBasePy)
generate_from_py_(MeasurementPy)
generate_from_py_(MeasureBasePy)
SET(Python_SRCS
MeasurementPy.xml
MeasurementPyImp.cpp

View File

@@ -0,0 +1,19 @@
from Base.Metadata import export
from App.DocumentObject import DocumentObject
@export(
Father="DocumentObjectPy",
Name="MeasureBasePy",
Twin="MeasureBase",
TwinPointer="MeasureBase",
Include="Mod/Measure/App/MeasureBase.h",
Namespace="Measure",
FatherInclude="App/DocumentObjectPy.h",
FatherNamespace="App",
Constructor=True,
)
class MeasureBasePy(DocumentObject):
"""
User documentation here
"""

View File

@@ -0,0 +1,68 @@
from typing import Any
from Base.BaseClass import BaseClass
from Base.Metadata import export
@export(
Father="BaseClassPy",
Name="MeasurementPy",
Twin="Measurement",
TwinPointer="Measurement",
Include="Mod/Measure/App/Measurement.h",
Namespace="Measure",
FatherInclude="Base/BaseClassPy.h",
FatherNamespace="Base",
Constructor=True,
)
class MeasurementPy(BaseClass):
"""
Make a measurement
"""
def addReference3D(self) -> Any:
"""add a geometric reference"""
...
def has3DReferences(self) -> Any:
"""does Measurement have links to 3D geometry"""
...
def clear(self) -> Any:
"""measure the difference between references to obtain resultant vector"""
...
def delta(self) -> Any:
"""measure the difference between references to obtain resultant vector"""
...
def length(self) -> Any:
"""measure the length of the references"""
...
def volume(self) -> Any:
"""measure the volume of the references"""
...
def area(self) -> Any:
"""measure the area of the references"""
...
def lineLineDistance(self) -> Any:
"""measure the line-Line Distance of the references. Returns 0 if references are not 2 lines."""
...
def planePlaneDistance(self) -> Any:
"""measure the plane-plane distance of the references. Returns 0 if references are not 2 planes."""
...
def angle(self) -> Any:
"""measure the angle between two edges"""
...
def radius(self) -> Any:
"""measure the radius of an arc or circle edge"""
...
def com(self) -> Any:
"""measure the center of mass for selected volumes"""
...

View File

@@ -29,6 +29,7 @@ SET(MeasureGui_UIC_SRCS
)
generate_from_xml(QuickMeasurePy)
generate_from_py_(QuickMeasurePy)
SET(MeasureGui_SRCS
${CMAKE_SOURCE_DIR}/src/Mod/Measure/InitGui.py

View File

@@ -0,0 +1,19 @@
from Base.Metadata import export
from Base.PyObjectBase import PyObjectBase
@export(
Father="PyObjectBase",
Name="QuickMeasurePy",
Twin="QuickMeasure",
TwinPointer="QuickMeasure",
Include="Mod/Measure/Gui/QuickMeasure.h",
Namespace="MeasureGui",
FatherInclude="Base/PyObjectBase.h",
FatherNamespace="Base",
Constructor=True,
Delete=True,
)
class QuickMeasurePy(PyObjectBase):
"""
Selection Observer for the QuickMeasure label.
"""

View File

@@ -39,6 +39,7 @@ list(APPEND Points_LIBS
)
generate_from_xml(PointsPy)
generate_from_py_(PointsPy)
SET(Points_SRCS
AppPoints.cpp

View File

@@ -0,0 +1,65 @@
from typing import Any, Final
from Base.Metadata import constmethod, export
from Data import object
@export(
Father="ComplexGeoDataPy",
Name="PointsPy",
Twin="PointKernel",
TwinPointer="PointKernel",
Include="Mod/Points/App/Points.h",
Namespace="Points",
FatherInclude="App/ComplexGeoDataPy.h",
FatherNamespace="Data",
Constructor=True,
)
class PointsPy(object):
"""
Points() -- Create an empty points object.
This class allows one to manipulate the Points object by adding new points, deleting facets, importing from an STL file,
transforming and much more.
"""
@constmethod
def copy(self) -> Any:
"""Create a copy of this points object"""
...
def read(self) -> Any:
"""Read in a points object from file."""
...
@constmethod
def write(self) -> Any:
"""Write the points object into file."""
...
@constmethod
def writeInventor(self) -> Any:
"""Write the points in OpenInventor format to a string."""
...
def addPoints(self) -> Any:
"""add one or more (list of) points to the object"""
...
@constmethod
def fromSegment(self) -> Any:
"""Get a new point object from a given segment"""
...
@constmethod
def fromValid(self) -> Any:
"""Get a new point object from points with valid coordinates (i.e. that are not NaN)"""
...
CountPoints: Final[int]
"""Return the number of vertices of the points object."""
Points: Final[list]
"""A collection of points
With this attribute it is possible to get access to the points of the object
for p in pnt.Points:
print p"""

View File

@@ -67,12 +67,9 @@ With this attribute it is possible to get access to the points of the object
for p in pnt.Points:
print p
</UserDocu>
</Documentation>
<Parameter Name="Points" Type="List" />
</Attribute>
<ClassDeclarations>
</ClassDeclarations>
</PythonExport>
</GenerateModel>

View File

@@ -25,6 +25,12 @@ generate_from_xml(TrajectoryPy)
generate_from_xml(WaypointPy)
generate_from_xml(RobotObjectPy)
generate_from_py_(Robot6AxisPy)
generate_from_py_(TrajectoryPy)
generate_from_py_(WaypointPy)
generate_from_py_(RobotObjectPy)
SET(Python_SRCS
Robot6AxisPy.xml

View File

@@ -0,0 +1,49 @@
from typing import Any
from Base.Metadata import export
from Base.Persistence import Persistence
@export(
Father="PersistencePy",
Name="Robot6AxisPy",
Twin="Robot6Axis",
TwinPointer="Robot6Axis",
Include="Mod/Robot/App/Robot6Axis.h",
Namespace="Robot",
FatherInclude="Base/PersistencePy.h",
FatherNamespace="Base",
Constructor=True,
Delete=True,
)
class Robot6AxisPy(Persistence):
"""
Robot6Axis class
"""
def check(self) -> Any:
"""Checks the shape and report errors in the shape structure.
This is a more detailed check as done in isValid()."""
...
Axis1: float
"""Pose of Axis 1 in degrees"""
Axis2: float
"""Pose of Axis 2 in degrees"""
Axis3: float
"""Pose of Axis 3 in degrees"""
Axis4: float
"""Pose of Axis 4 in degrees"""
Axis5: float
"""Pose of Axis 5 in degrees"""
Axis6: float
"""Pose of Axis 6 in degrees"""
Tcp: Any
"""Tool center point frame. Where the tool of the robot is"""
Base: Any
"""Actual Base system in respect to the robot world system"""

View File

@@ -0,0 +1,25 @@
from typing import Any
from Base.Metadata import export
from App.DocumentObject import DocumentObject
@export(
Father="DocumentObjectPy",
Name="RobotObjectPy",
Twin="RobotObject",
TwinPointer="RobotObject",
Include="Mod/Robot/App/RobotObject.h",
Namespace="Robot",
FatherInclude="App/DocumentObjectPy.h",
FatherNamespace="App",
)
class RobotObjectPy(DocumentObject):
"""
Robot document object
"""
def getRobot(self) -> Any:
"""Returns a copy of the robot. Be aware, the robot behaves the same
like the robot of the object but is a copy!"""
...

View File

@@ -16,8 +16,8 @@
<Methode Name="getRobot">
<Documentation>
<UserDocu>
Returns a copy of the robot. Be aware, the robot behaves the same
like the robot of the object but is a copy!
Returns a copy of the robot. Be aware, the robot behaves the same
like the robot of the object but is a copy!
</UserDocu>
</Documentation>
</Methode>

View File

@@ -0,0 +1,48 @@
from typing import Any, Final
from Base.Metadata import export
from Base.Persistence import Persistence
@export(
Father="PersistencePy",
Name="TrajectoryPy",
Twin="Trajectory",
TwinPointer="Trajectory",
Include="Mod/Robot/App/Trajectory.h",
Namespace="Robot",
FatherInclude="Base/PersistencePy.h",
FatherNamespace="Base",
Constructor=True,
Delete=True,
)
class TrajectoryPy(Persistence):
"""
Trajectory class
"""
def insertWaypoints(self) -> Any:
"""adds one or a list of waypoint to the end of the trajectory"""
...
def position(self) -> Any:
"""returns a Frame to a given time in the trajectory"""
...
def velocity(self) -> Any:
"""returns the velocity to a given time in the trajectory"""
...
def deleteLast(self) -> Any:
"""
deleteLast(n) - delete n waypoints at the end
deleteLast() - delete the last waypoint
"""
...
Duration: Final[float]
"""duration of the trajectory"""
Length: Final[float]
"""length of the trajectory"""
Waypoints: list
"""waypoints of this trajectory"""

View File

@@ -39,8 +39,8 @@
<Methode Name="deleteLast">
<Documentation>
<UserDocu>
deleteLast(n) - delete n waypoints at the end
deleteLast() - delete the last waypoint
deleteLast(n) - delete n waypoints at the end
deleteLast() - delete the last waypoint
</UserDocu>
</Documentation>
</Methode>

View File

@@ -0,0 +1,45 @@
from typing import Any
from Base.Metadata import export
from Base.Persistence import Persistence
@export(
Father="PersistencePy",
Name="WaypointPy",
Twin="Waypoint",
TwinPointer="Waypoint",
Include="Mod/Robot/App/Waypoint.h",
Namespace="Robot",
FatherInclude="Base/PersistencePy.h",
FatherNamespace="Base",
Constructor=True,
Delete=True,
)
class WaypointPy(Persistence):
"""
Waypoint class
"""
Name: str
"""Name of the waypoint"""
Type: str
"""Type of the waypoint[PTP|LIN|CIRC|WAIT]"""
Pos: Any
"""End position (destination) of the waypoint"""
Cont: bool
"""Control the continuity to the next waypoint in the trajectory"""
Velocity: float
"""Control the velocity to the next waypoint in the trajectory
In Case of PTP 0-100% Axis speed
In Case of LIN m/s
In Case of WAIT s wait time"""
Tool: int
"""Describe which tool frame to use for that point"""
Base: int
"""Describe which Base frame to use for that point"""

View File

@@ -0,0 +1,36 @@
from typing import Any
from Base.BaseClass import PyObjectBase
from Base.Metadata import export
@export(
Father="PyObjectBase",
Name="BlendCurvePy",
Twin="BlendCurve",
TwinPointer="BlendCurve",
Include="Mod/Surface/App/Blending/BlendCurve.h",
Namespace="Surface",
FatherInclude="Base/BaseClassPy.h",
FatherNamespace="Base",
Constructor=True,
Delete=True,
)
class BlendCurvePy(PyObjectBase):
"""
Create a BlendCurve that interpolate 2 BlendPoints.
curve = BlendCurve(BlendPoint1, BlendPoint2)
"""
def compute(self) -> Any:
"""
Return the BezierCurve that interpolate the input BlendPoints.
"""
...
def setSize(self) -> Any:
"""
Set the tangent size of the blendpoint at given index.
If relative is true, the size is considered relative to the distance between the two blendpoints.
myBlendCurve.setSize(idx, size, relative)
"""
...

View File

@@ -17,23 +17,23 @@
<Documentation>
<Author Licence="LGPL" Name="Mattéo Grellier" EMail="matteogrellier@gmail.com" />
<UserDocu>
Create a BlendCurve that interpolate 2 BlendPoints.
curve = BlendCurve(BlendPoint1, BlendPoint2)
Create a BlendCurve that interpolate 2 BlendPoints.
curve = BlendCurve(BlendPoint1, BlendPoint2)
</UserDocu>
</Documentation>
<Methode Name="compute">
<Documentation>
<UserDocu>
Return the BezierCurve that interpolate the input BlendPoints.
Return the BezierCurve that interpolate the input BlendPoints.
</UserDocu>
</Documentation>
</Methode>
<Methode Name="setSize">
<Documentation>
<UserDocu>
Set the tangent size of the blendpoint at given index.
If relative is true, the size is considered relative to the distance between the two blendpoints.
myBlendCurve.setSize(idx, size, relative)
Set the tangent size of the blendpoint at given index.
If relative is true, the size is considered relative to the distance between the two blendpoints.
myBlendCurve.setSize(idx, size, relative)
</UserDocu>
</Documentation>
</Methode>

View File

@@ -0,0 +1,46 @@
from typing import Any, Final
from Base.BaseClass import PyObjectBase
from Base.Metadata import constmethod, export
@export(
Father="PyObjectBase",
Name="BlendPointPy",
Twin="BlendPoint",
TwinPointer="BlendPoint",
Include="Mod/Surface/App/Blending/BlendPoint.h",
Namespace="Surface",
FatherInclude="Base/BaseClassPy.h",
FatherNamespace="Base",
Constructor=True,
Delete=True,
)
class BlendPointPy(PyObjectBase):
"""
Create BlendPoint from a point and some derivatives.
myBlendPoint = BlendPoint([Point, D1, D2, ..., DN])
BlendPoint can also be constructed from an edge
myBlendPoint = BlendPoint(Edge, parameter = float, continuity = int)
"""
@constmethod
def getSize(self) -> Any:
"""Return BlendPoint first derivative length."""
...
def setSize(self) -> Any:
"""
Resizes the BlendPoint vectors,
by setting the length of the first derivative.
theBlendPoint.setSize(new_size)
"""
...
def setvectors(self) -> Any:
"""
Set the vectors of BlendPoint.
BlendPoint.setvectors([Point, D1, D2, ..., DN])
"""
...
Vectors: Final[list]
"""The list of vectors of this BlendPoint."""

View File

@@ -17,10 +17,10 @@
<Documentation>
<Author Licence="LGPL" Name="Mattéo Grellier" EMail="matteogrellier@gmail.com" />
<UserDocu>
Create BlendPoint from a point and some derivatives.
myBlendPoint = BlendPoint([Point, D1, D2, ..., DN])
BlendPoint can also be constructed from an edge
myBlendPoint = BlendPoint(Edge, parameter = float, continuity = int)
Create BlendPoint from a point and some derivatives.
myBlendPoint = BlendPoint([Point, D1, D2, ..., DN])
BlendPoint can also be constructed from an edge
myBlendPoint = BlendPoint(Edge, parameter = float, continuity = int)
</UserDocu>
</Documentation>
<Attribute Name="Vectors" ReadOnly="true">
@@ -39,17 +39,17 @@
<Methode Name="setSize">
<Documentation>
<UserDocu>
Resizes the BlendPoint vectors,
by setting the length of the first derivative.
theBlendPoint.setSize(new_size)
Resizes the BlendPoint vectors,
by setting the length of the first derivative.
theBlendPoint.setSize(new_size)
</UserDocu>
</Documentation>
</Methode>
<Methode Name="setvectors">
<Documentation>
<UserDocu>
Set the vectors of BlendPoint.
BlendPoint.setvectors([Point, D1, D2, ..., DN])
Set the vectors of BlendPoint.
BlendPoint.setvectors([Point, D1, D2, ..., DN])
</UserDocu>
</Documentation>
</Methode>

View File

@@ -16,6 +16,9 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Blending)
generate_from_xml(Blending/BlendPointPy)
generate_from_xml(Blending/BlendCurvePy)
generate_from_py_(Blending/BlendPointPy)
generate_from_py_(Blending/BlendCurvePy)
set(Surface_LIBS
FreeCADApp
Part