Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Python] Stubs - update Guid -> UUID #669

Merged
merged 7 commits into from
Mar 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -6,13 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [8.17.0-beta] - UNRELEASED

diff:
diff:

### Added

- (js, py) DimensionStyle.Id
- (js, py) Several delete methods for File3dm Tables: File3dmMaterialTable::Delete, BND_File3dmLayerTable::Delete, BND_File3dmDimStyleTable::Delete
- (js, py) Added tests for various ::Delete methods.
- (js, py) Added tests for various ::Delete methods.
- (js, py) Extrusion::CreateWithPlane #636
- (js, py) BND_Bitmap also inherits from Common object and now exposes an Id property.
- (js, py) DimensionStyle now has an Id property
@@ -21,12 +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) 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
- (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
@@ -38,7 +37,7 @@ diff:
- (js) File3dm.objects().deleteItem(id) -> File3dm.objects().delete(id)
- (dotnet) Linux release builds in an Amazon Linux 2023 container

### Fixed
### Fixed

- (py) uuid conversion in c++ was broken
- (js, py) Changes to ViewInfo.Viewport would not set.
@@ -56,7 +55,7 @@ diff: https://github.com/mcneel/rhino3dm/compare/8.6.1...8.9.0

See changes in 8.9.0-beta.

### Fixed
### Fixed

- (js) AnnotationBase objects would be undefined due to new cast to Text in the bindings but no Text class exposed to emscripten

@@ -227,7 +226,7 @@ diff: https://github.com/mcneel/rhino3dm/pull/561/files
- (py) Added Line.Transform, Brep.TryConvertBrep
- (py) Added 3.11 support
- (.net) Added macOS arm64 (Apple Silicon) builds
- (.net) Addded .net 7.0 support
- (.net) Addded .net 7.0 support

### Removed

79 changes: 40 additions & 39 deletions src/rhino3dm/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Tuple, Set, Iterable, List, overload
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:
@@ -308,37 +309,37 @@ class File3dmObject:

class File3dmObjectTable:
@overload
def AddPoint(self, x: float, y: float, z: float) -> Guid: ...
def AddPoint(self, x: float, y: float, z: float) -> UUID: ...
@overload
def AddPoint(self, point: Point3d) -> Guid: ...
def AddPoint(self, point: Point3d) -> UUID: ...
@overload
def AddPoint(self, point: Point3f) -> Guid: ...
def AddPoint(self, point: Point3f) -> UUID: ...
@overload
def AddPoint(self, x: float, y: float, z: float, attributes: ObjectAttributes) -> Guid: ...
def AddPoint(self, x: float, y: float, z: float, attributes: ObjectAttributes) -> UUID: ...
@overload
def AddPoint(self, point: Point3d, attributes: ObjectAttributes) -> Guid: ...
def AddPoint(self, point: Point3d, attributes: ObjectAttributes) -> UUID: ...
@overload
def AddPoint(self, point: Point3f, attributes: ObjectAttributes) -> Guid: ...
def AddPointCloud(self, cloud: PointCloud) -> Guid: ...
def AddPoint(self, point: Point3f, attributes: ObjectAttributes) -> UUID: ...
def AddPointCloud(self, cloud: PointCloud) -> UUID: ...
@overload
def AddLine(self, _from: Point3d, to: Point3d) -> Guid: ...
def AddLine(self, _from: Point3d, to: Point3d) -> UUID: ...
@overload
def AddLine(self, _from: Point3d, to: Point3d, attributes: ObjectAttributes) -> 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 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: ...

@@ -816,11 +817,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
@@ -872,12 +873,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
@@ -904,9 +905,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
@@ -919,11 +920,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: ...
@@ -933,7 +934,7 @@ class Layer(CommonObject):

class ModelComponent(CommonObject):
@property
def Id(self) -> Guid: ...
def Id(self) -> UUID: ...

class ObjectAttributes(CommonObject):
@property
@@ -979,11 +980,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: ...
@@ -1074,7 +1075,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: ...
@@ -1547,7 +1548,7 @@ class File3dmRdkDocumentData(File3dmPlugInData): ...

class Material(ModelComponent):
@property
def RenderPlugInId(self) -> Guid: ...
def RenderPlugInId(self) -> UUID: ...
@property
def Name(self) -> str: ...
@property