Created
January 19, 2018 12:48
-
-
Save didimitrie/2635d9f94b63159cf2a37edc31404989 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace SpeckleNMT_Converter { | |
| public static class SpeckleTypeExtensions | |
| { | |
| // will add a .ToSpeckle() method on RobertPoints | |
| public static SpecklePoint ToSpeckle(this RobertPoint point) | |
| { | |
| return new SpecklePoint() { X = point.X, Y = point.Y, Z = point.Z }; | |
| } | |
| //and the reverse: | |
| // will add a ToNative() method on SpecklePoints, which will return a | |
| // RobertPoint. | |
| // These can coexist with potentially other ToNative mehtods, as long as they return different | |
| // object types, ie a ToNative() that returns Point3ds from rhino. | |
| public static RobertPoint ToNative(this SpecklePoint point) | |
| { | |
| return new RobertPoint(...); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment