The problem is that you can inherit from
Rhino.Geometry.Point, since its a class, but you can’t inherit from
Rhino.Geometry.Point3d since it’s a struct.
C# structs are sealed, which means that you can’t inherit from them. It has to do with structs being value types, and value types are always sealed, I believe.
The problem with
Rhino.Geometry.Point is that it takes at least 2 arguments during initialisation, which are
self and a
Rhino.Geometry.Point3d. This means that when inheriting from it, you always have to provide both arguments. You can’t simply initialise your own class, which inherits, without arguments, which is inconvenient, since you want to initialise as an origin point, right?
Overriding this is probably not possible, so you have two options that I can think of:
The first one, would be to inherit from
Rhino.Geometry.Point, extend it with your custom attributes and methods, and pass in a Rhino.Geometry.Point3d.Origin, when you initialise it. This way you can benefit from the already available attributes and methods, as well as your very own extensions.
The other option would be to create your very own, customised Point class. Of course, you’d have to start pretty much from scratch. However, if your custom attributes and method are, what you would primarily use either way, this would be the way to go.
Rhino.Geometry.Point is a pretty simple class. It’s basically just composed of three coordinates.
Your custom class could look something like this:
self.x = 0.0
self.y = 0.0
self.z = 0.0
return Rhino.Geometry.Point3d(self.x, self.y, self.z)
pt = Point3d()