-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
166 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#! python3 | ||
|
||
""" | ||
This script collects all the files needed to create the yak package. | ||
""" | ||
|
||
from invoke import run | ||
import os | ||
|
||
|
||
# Run a command just like you would in the shell | ||
result = run("dir", hide=True, warn=True) | ||
|
||
# You can check if the command was successful | ||
if result.ok: | ||
# print it in green | ||
print("\033[92mCommand succeeded\033[0m") | ||
else: | ||
print("\033[91mCommand failed\033[0m") | ||
|
||
# print(secret) | ||
# # You can access the output of the command | ||
# print("Command output was:") | ||
# print(result.stdout) | ||
|
||
############################################ | ||
|
||
path_rhldir : str = "./" | ||
|
||
# copy the yaker directory to the build folder | ||
result = run("cd yaker", hide=True, warn=True) | ||
# result = run("cd", hide=False, warn=True) | ||
|
||
# get the rhino .rhp and its dependencies |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# tasks.py | ||
from invoke import task | ||
|
||
@task | ||
def yakerize(c): | ||
path_yakerize : str = "./invokes/yakerize.py" | ||
c.run(f"python {path_yakerize}") | ||
|
||
#access a repository secret |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
name: script-sync | ||
version: 1.1.4 | ||
authors: | ||
- Andrea Settimi | ||
description: Script-sync is a Rhino plug-in to run C# and Python (IronPython or CPython) in RhinoV8. | ||
url: https://github.com/ibois-epfl/script-sync | ||
keywords: | ||
- Rhino | ||
- Cs | ||
- Python | ||
- IronPython | ||
- CPython | ||
- VScode | ||
- Utility | ||
icon: logo.png |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Laboratory for Timber Constructions IBOIS, EPFL | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<p align="center"> | ||
<img src="VSCode\scriptsync\logo\scriptsync_480.png" width="140"> | ||
</p> | ||
|
||
# script-sync | ||
|
||
This repository contains the code and Rhino plug-in to run C# and Python (IronPython or CPython) in RhinoV8. | ||
|
||
![record_vid_gif20fps](https://github.com/ibois-epfl/script-sync/assets/50238678/7ccb2aa5-e646-45cd-9657-95776d24a48a) | ||
|
||
## Features | ||
To start `script-sync` in RhinoV8, run the command `ScriptSyncStart` in RhinoV8. This will start a server that listens to commands from VSCode. | ||
|
||
Open a `.py` or `.cs` file in VSCode and run it in RhinoV8 by pressing `F4`. | ||
Add a `shebang` to the first line of the file to specify the Python interpreter to use, e.g.: | ||
* `#!python3` to interpret it with CPython | ||
* `#!python2` to interpret it with IronPython | ||
|
||
To close `script-sync` in RhinoV8, run the command `ScriptSyncStop` in RhinoV8. | ||
|
||
## Requirements | ||
The plug-in needs to be installed on RhinoV8. | ||
|
||
## Caveats | ||
There is no intellisense for C# and Python in VSCode. | ||
|
||
## Release Notes | ||
|
||
### 1.0.0 | ||
|
||
First release of script-sync: it can run C# and Python (IronPython or CPython) in RhinoV8 from VSCode. It is only tested on Windows. | ||
* Extension for VSCode | ||
* Rhino plug-in with basic commands to start/stop script-sync server | ||
* basic documentation | ||
|
||
## References | ||
|
||
There are a lot of plug-ins that allow to run Python in Rhino. Among them, [CodeListener](https://github.com/ccc159/CodeListener) was working until RhinoV8 and it was a source of inspiration for this project. This is a simplified version, but it can run `C#` and both `IronPython` and `CPython` in RhinoV8. | ||
|
||
## Citation | ||
This project is part of the research activities of the [IBOIS lab](https://www.epfl.ch/labs/ibois/) at EPFL. It was developed by [Andrea Settimi](https://github.com/9and3). | ||
|
||
|
||
## For more information | ||
|
||
* [GitHub repo](https://github.com/ibois-epfl/script-sync) | ||
* [IBOIS GitHub organization](https://github.com/ibois-epfl) | ||
* [IBOIS lab page](https://www.epfl.ch/labs/ibois/) | ||
|
||
|
||
## Roadmap | ||
- [ ] publish yak package + auto pipeline | ||
- [ ] publish on tools website lab | ||
- [ ] add instructions for dev and contribution | ||
- [ ] add icons | ||
- [ ] write ci | ||
- [ ] write tests | ||
- [ ] ci action to publish automatic releases | ||
- [ ] possibly redirect output from RhinoApp.RunScript() to vscode consoles or log file |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
name: script-sync | ||
version: 1.1.4 | ||
authors: | ||
- Andrea Settimi | ||
description: Script-sync is a Rhino plug-in to run C# and Python (IronPython or CPython) in RhinoV8. | ||
url: https://github.com/ibois-epfl/script-sync | ||
keywords: | ||
- Rhino | ||
- Cs | ||
- Python | ||
- IronPython | ||
- CPython | ||
- VScode | ||
- Utility | ||
icon: logo.png |