Skip to content

Commit 3a0b108

Browse files
committed
fix of the spatial index model
1 parent f5fb122 commit 3a0b108

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Microsoft.VisualBasic.Core/src/Drawing/PointF3D.vb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,26 @@ Namespace Imaging
117117
''' <returns></returns>
118118
Public Property Z As Integer Implements IPoint3D.Z
119119

120+
Sub New(x As Integer, y As Integer, z As Integer)
121+
_X = x
122+
_Y = y
123+
_Z = z
124+
End Sub
125+
126+
Sub New(index As SpatialIndex3D)
127+
X = index.X
128+
Y = index.Y
129+
Z = index.Z
130+
End Sub
131+
132+
Public Overrides Function ToString() As String
133+
Return $"[{X}, {Y}, {Z}]"
134+
End Function
135+
136+
Public Shared Operator -(a As SpatialIndex3D, b As SpatialIndex3D) As SpatialIndex3D
137+
Return New SpatialIndex3D(a.X - b.X, a.Y - b.Y, a.Z - b.Z)
138+
End Operator
139+
120140
End Structure
121141

122142
''' <summary>

0 commit comments

Comments
 (0)