From beb80563f909516b9e83c42b65a14cf8a3bcb150 Mon Sep 17 00:00:00 2001 From: StudioWEngineers Date: Thu, 16 Jan 2025 21:32:08 +0100 Subject: [PATCH 1/5] fix return type for UUID --- src/rhino3dm/__init__.pyi | 73 ++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 36 deletions(-) diff --git a/src/rhino3dm/__init__.pyi b/src/rhino3dm/__init__.pyi index 8097eead..6009603d 100644 --- a/src/rhino3dm/__init__.pyi +++ b/src/rhino3dm/__init__.pyi @@ -1,4 +1,5 @@ from typing import Tuple, Set, Iterable, List +from uuid import UUID class Arc: def __init__(self, circle: Circle, angleRadians: float): ... @@ -294,7 +295,7 @@ class File3dmInstanceDefinitionTable: class File3dmLayerTable: def AddLayer(self, name: str, color: Tuple[int, int, int, int]) -> int: ... - def FindName(self, name: str, parentId: Guid) -> Layer: ... + def FindName(self, name: str, parentId: UUID) -> Layer: ... def FindIndex(self, index: int) -> Layer: ... class File3dmMaterialTable: @@ -307,26 +308,26 @@ class File3dmObject: def Geometry(self) -> GeometryBase: ... class File3dmObjectTable: - def AddPoint(self, x: float, y: float, z: float) -> Guid: ... - def AddPoint(self, x: float, y: float, z: float) -> Guid: ... - def AddPoint(self, x: float, y: float, z: float) -> Guid: ... - def AddPointCloud(self, cloud: PointCloud) -> Guid: ... - def AddLine(self, _from: Point3d, to: Point3d) -> Guid: ... - def AddPolyline(self, points: Iterable[Point3d]) -> Guid: ... - def AddArc(self, arc: Arc) -> Guid: ... - def AddCircle(self, circle: Circle) -> Guid: ... - def AddEllipse(self, ellipse: Ellipse) -> Guid: ... - def AddSphere(self, sphere: Sphere) -> Guid: ... - def AddCurve(self, curve: Curve) -> Guid: ... - def AddTextDot(self, text: str, location: Point3d) -> Guid: ... - def AddSurface(self, surface: Surface) -> Guid: ... - def AddExtrusion(self, extrusion: Extrusion) -> Guid: ... - def AddMesh(self, mesh: Mesh) -> Guid: ... - def AddBrep(self, brep: Brep) -> Guid: ... - def AddHatch(self, hatch: Hatch) -> Guid: ... + def AddPoint(self, x: float, y: float, z: float) -> UUID: ... + def AddPoint(self, x: float, y: float, z: float) -> UUID: ... + def AddPoint(self, x: float, y: float, z: float) -> UUID: ... + def AddPointCloud(self, cloud: PointCloud) -> UUID: ... + def AddLine(self, _from: Point3d, to: Point3d) -> UUID: ... + def AddPolyline(self, points: Iterable[Point3d]) -> UUID: ... + def AddArc(self, arc: Arc) -> UUID: ... + def AddCircle(self, circle: Circle) -> UUID: ... + def AddEllipse(self, ellipse: Ellipse) -> UUID: ... + def AddSphere(self, sphere: Sphere) -> UUID: ... + def AddCurve(self, curve: Curve) -> UUID: ... + def AddTextDot(self, text: str, location: Point3d) -> UUID: ... + def AddSurface(self, surface: Surface) -> UUID: ... + def AddExtrusion(self, extrusion: Extrusion) -> UUID: ... + def AddMesh(self, mesh: Mesh) -> UUID: ... + def AddBrep(self, brep: Brep) -> UUID: ... + def AddHatch(self, hatch: Hatch) -> UUID: ... def Add(self, item: File3dmObject) -> None: ... def GetBoundingBox(self) -> BoundingBox: ... - def Delete(self, objectId: Guid) -> bool: ... + def Delete(self, objectId: UUID) -> bool: ... class File3dmPlugInData: ... @@ -804,11 +805,11 @@ class DimensionStyle(CommonObject): @property def Font(self) -> Font: ... @property - def ArrowBlockId1(self) -> Guid: ... + def ArrowBlockId1(self) -> UUID: ... @property - def ArrowBlockId2(self) -> Guid: ... + def ArrowBlockId2(self) -> UUID: ... @property - def LeaderArrowBlockId(self) -> Guid: ... + def LeaderArrowBlockId(self) -> UUID: ... @property def SuppressExtension1(self) -> bool: ... @property @@ -860,12 +861,12 @@ class DimensionStyle(CommonObject): @property def IsChild(self) -> bool: ... @property - def ParentId(self) -> Guid: ... + def ParentId(self) -> UUID: ... def ScaleLengthValues(self, scale: float) -> None: ... def SetFieldOverride(self, field: Field) -> None: ... def ClearFieldOverride(self, field: Field) -> None: ... def ClearAllFieldOverrides(self) -> None: ... - def IsChildOf(self, parentId: Guid) -> bool: ... + def IsChildOf(self, parentId: UUID) -> bool: ... class GeometryBase(CommonObject): @property @@ -892,9 +893,9 @@ class Layer(CommonObject): @property def FullPath(self) -> str: ... @property - def Id(self) -> Guid: ... + def Id(self) -> UUID: ... @property - def ParentLayerId(self) -> Guid: ... + def ParentLayerId(self) -> UUID: ... @property def IgesLevel(self) -> int: ... @property @@ -907,11 +908,11 @@ class Layer(CommonObject): def LinetypeIndex(self) -> int: ... @property def RenderMaterialIndex(self) -> int: ... - def HasPerViewportSettings(self, viewportId: Guid) -> bool: ... - def DeletePerViewportSettings(self, viewportId: Guid) -> None: ... - def PerViewportColor(self, viewportId: Guid) -> Tuple[int, int, int, int]: ... - def SetPerViewportColor(self, viewportId: Guid, color: Tuple[int, int, int, int]) -> None: ... - def DeletePerViewportColor(self, viewportId: Guid) -> None: ... + def HasPerViewportSettings(self, viewportId: UUID) -> bool: ... + def DeletePerViewportSettings(self, viewportId: UUID) -> None: ... + def PerViewportColor(self, viewportId: UUID) -> Tuple[int, int, int, int]: ... + def SetPerViewportColor(self, viewportId: UUID, color: Tuple[int, int, int, int]) -> None: ... + def DeletePerViewportColor(self, viewportId: UUID) -> None: ... def GetPersistentVisibility(self) -> bool: ... def SetPersistentVisibility(self, persistentVisibility: bool) -> None: ... def UnsetPersistentVisibility(self) -> None: ... @@ -921,7 +922,7 @@ class Layer(CommonObject): class ModelComponent(CommonObject): @property - def Id(self) -> Guid: ... + def Id(self) -> UUID: ... class ObjectAttributes(CommonObject): @property @@ -967,11 +968,11 @@ class ObjectAttributes(CommonObject): @property def WireDensity(self) -> int: ... @property - def ViewportId(self) -> Guid: ... + def ViewportId(self) -> UUID: ... @property def GroupCount(self) -> int: ... def Transform(self, xform: Transform) -> bool: ... - def HasDisplayModeOverride(self, viewportId: Guid) -> bool: ... + def HasDisplayModeOverride(self, viewportId: UUID) -> bool: ... def GetGroupList(self) -> List[int]: ... def AddToGroup(self, groupIndex: int) -> None: ... def RemoveFromGroup(self, groupIndex: int) -> None: ... @@ -1062,7 +1063,7 @@ class ViewportInfo(CommonObject): @property def Camera35mmLensLength(self) -> float: ... @property - def Id(self) -> Guid: ... + def Id(self) -> UUID: ... def ChangeToParallelProjection(self, symmetricFrustum: bool) -> bool: ... def ChangeToPerspectiveProjection(self, targetDistance: float, symmetricFrustum: bool, lensLength: float) -> bool: ... def ChangeToTwoPointPerspectiveProjection(self, targetDistance: float, up: Vector3d, lensLength: float) -> bool: ... @@ -1535,7 +1536,7 @@ class File3dmRdkDocumentData(File3dmPlugInData): ... class Material(ModelComponent): @property - def RenderPlugInId(self) -> Guid: ... + def RenderPlugInId(self) -> UUID: ... @property def Name(self) -> str: ... @property From 9bd102ad373aefffeec16a9d2891fffcfb0efdc3 Mon Sep 17 00:00:00 2001 From: StudioWEngineers Date: Thu, 16 Jan 2025 22:01:42 +0100 Subject: [PATCH 2/5] add CHANGELOG.md entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ff9f9a2..9625d3a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ diff: - (dotnet) Linux release builds in an Amazon Linux 2023 container - (py) AddPoint now supports attributes #665 @StudioWEngineers - (py) AddLine now supports attributes #666 @StudioWEngineers +- (py) Improved stubs. WIP. #668 and 669 @StudioWEngineers ### Changed From 0d19ab17e9c3255d788a09ff4027f25e6d2ba903 Mon Sep 17 00:00:00 2001 From: StudioWEngineers Date: Sat, 25 Jan 2025 11:13:16 +0100 Subject: [PATCH 3/5] typo in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9625d3a1..55d372a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ diff: - (dotnet) Linux release builds in an Amazon Linux 2023 container - (py) AddPoint now supports attributes #665 @StudioWEngineers - (py) AddLine now supports attributes #666 @StudioWEngineers -- (py) Improved stubs. WIP. #668 and 669 @StudioWEngineers +- (py) Improved stubs. WIP. #668 and #669 @StudioWEngineers ### Changed From b509465db7db9a0b8dcc9586dc5abe053b8ae031 Mon Sep 17 00:00:00 2001 From: StudioWEngineers Date: Sat, 1 Mar 2025 14:12:25 +0100 Subject: [PATCH 4/5] remove duplicate entrie in CHANGELOG.md --- CHANGELOG.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50dd5cb2..a8799386 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,13 +21,11 @@ diff: - (js) Added several methods and properties for Planes #568 - (js) Layer.index - (js) Mesh.CreateFromThreeJSON inclides vertex color information -- (py) AddPoint now supports attributes #665 @StudioWEngineers -- (py) AddLine now supports attributes #666 @StudioWEngineers +- (py) AddPoint now supports attributes #665 @StudioWEngineers - TODO for JS +- (py) AddLine now supports attributes #666 @StudioWEngineers - TODO for JS - (py) Improved stubs. WIP. #668 and #669 @StudioWEngineers - (py) Added python 3.13 target #654 - (py) BND_MeshingParameters::Decode now supports more properties -- (py) File3dm.ObjectTable.AddPoint with attributes - TODO for JS -- (py) File3dm.ObjectTable.AddLine with attributes - TODO for JS - (py) Exposed a LightStyle enum which was previously only used internally ### Changed From fb3cbd2ca6b85721e2b07ebf01358d62479fca7e Mon Sep 17 00:00:00 2001 From: StudioWEngineers Date: Sat, 1 Mar 2025 14:18:27 +0100 Subject: [PATCH 5/5] typo --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8799386..f8d5fbc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,8 +21,8 @@ diff: - (js) Added several methods and properties for Planes #568 - (js) Layer.index - (js) Mesh.CreateFromThreeJSON inclides vertex color information -- (py) AddPoint now supports attributes #665 @StudioWEngineers - TODO for JS -- (py) AddLine now supports attributes #666 @StudioWEngineers - TODO for JS +- (py) File3dm.ObjectTable.AddPoint now supports attributes #665 @StudioWEngineers - TODO for JS +- (py) File3dm.ObjectTable.AddLine now supports attributes #666 @StudioWEngineers - TODO for JS - (py) Improved stubs. WIP. #668 and #669 @StudioWEngineers - (py) Added python 3.13 target #654 - (py) BND_MeshingParameters::Decode now supports more properties