https://github.com/goswinr/rhino.scripting.fsharp
F# Extensions to the Rhino.Scripting libray.
https://github.com/goswinr/rhino.scripting.fsharp
fsharp rhino rhino3d rhinocommon rhinoscript
Last synced: 3 months ago
JSON representation
F# Extensions to the Rhino.Scripting libray.
- Host: GitHub
- URL: https://github.com/goswinr/rhino.scripting.fsharp
- Owner: goswinr
- License: mit
- Created: 2021-08-04T18:44:13.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-25T11:20:39.000Z (4 months ago)
- Last Synced: 2025-03-25T12:25:19.544Z (4 months ago)
- Topics: fsharp, rhino, rhino3d, rhinocommon, rhinoscript
- Language: F#
- Homepage: https://goswinr.github.io/Rhino.Scripting.FSharp/
- Size: 11.7 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README

# Rhino.Scripting.FSharp
[](https://www.nuget.org/packages/Rhino.Scripting.FSharp/)
[](https://github.com/goswinr/Rhino.Scripting.FSharp/actions/workflows/build.yml)
[](https://github.com/goswinr/Rhino.Scripting.FSharp/actions/workflows/docs.yml)
[](https://github.com/goswinr/Rhino.Scripting.FSharp/actions/workflows/outdatedDotnetTool.yml)
[](LICENSE.md)
Rhino.Scripting.FSharp is a set of useful extensions to the [Rhino.Scripting](https://github.com/goswinr/Rhino.Scripting) library.
This includes type extension for pretty printing of Rhino objects as well as implementations of commonly used functions in curried form for use with F#.This library allows you to compose RhinoScript functions with pipelines:
Get started by opening the Rhino.Scripting namespaces:
```fsharp
open Rhino.Scripting
open Rhino.Scripting.FSharp // opening this will extend RhinoScriptSyntax and some Rhino.Geometry types with additional static and member functions.
type rs = RhinoScriptSyntax
``````fsharp
rs.AddPoint( 1. , 2., 3.)
|>! rs.setLayer "my points"
|>! rs.setUserText "id" "point123"
|> rs.setName "123"
```instead of
```fsharp
let guid = rs.AddPoint( 1. , 2., 3.)
rs.ObjectLayer (guid, "my points")
rs.SetUserText (guid, "id", "point123")
rs.ObjectName (guid, "123")
```The `|>!` operator is part of Rhino.Scripting.FSharp library.
It passes it's input on as output. See [definition](https://github.com/goswinr/Rhino.Scripting.FSharp/blob/main/Src/Rhino.Scripting/Curried.fs#L16).### Full API Documentation
[goswinr.github.io/Rhino.Scripting.FSharp](https://goswinr.github.io/Rhino.Scripting.FSharp)
## Thread Safety
While the main Rhino Document is officially not thread safe, this library can be used from any thread.
If running async this library will automatically marshal all calls that affect the UI to the main Rhino UI thread
and wait for switching back till completion on UI thread.
Modifying the Rhino Document from a background thread is actually OK as long as there is only one thread doing it.
The main reason to use this library async is to keep the Rhino UI and Fesh scripting editor UI responsive while doing long running operations.## Contributing
Contributions are welcome even for small things like typos. If you have problems with this library please submit an issue.### License
[MIT](https://github.com/goswinr/Rhino.Scripting.FSharp/blob/main/LICENSE.md)### Changelog
see [CHANGELOG.md](https://github.com/goswinr/Rhino.Scripting.FSharp/blob/main/CHANGELOG.md)