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
import scriptcontext | |
import time | |
import System | |
import Rhino | |
rc, view = Rhino.Input.RhinoGet.GetView("select view") | |
print "position mouse where you want" | |
for i in [5,4,3,2,1]: | |
time.sleep(0.5) |
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
"""recursively subdivide surface based on curvature | |
author: robert stuart-smith | 2008 | www.kokkugia.com | |
translated to python by S. Baer (2012)""" | |
import rhinoscriptsyntax as rs | |
import scriptcontext | |
def PanelizeSurface(surface, subdivisions, generation): | |
#conditional statement to stop subdividing infinitely | |
#(as we will Call the Function recursively) | |
if generation<=0: |
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
... | |
Rhino.Runtime.PythonScript m_py_script; | |
Rhino.Runtime.PythonCompiledCode m_compiled_script; | |
protected override Rhino.Commands.Result RunCommand(RhinoDoc doc, Rhino.Commands.RunMode mode) | |
{ | |
// create an instance of a python script processor | |
if (m_py_script == null) | |
m_py_script = Rhino.Runtime.PythonScript.Create(); | |
if (m_py_script == null) |
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
class MeshDisplayCache : IDisposable | |
{ | |
Dictionary<System.Drawing.Color, Tuple<DisplayMaterial, Mesh>> _meshesToDraw; | |
public void Add(System.Drawing.Color color, Mesh mesh) | |
{ | |
if (null == _meshesToDraw) | |
_meshesToDraw = new Dictionary<System.Drawing.Color, Tuple<DisplayMaterial, Mesh>>(); | |
Tuple<DisplayMaterial, Mesh> data; |
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
using System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
using Grasshopper.Kernel; | |
using Grasshopper.Kernel.Types; | |
using Rhino; | |
using Rhino.Commands; | |
namespace InactiveGhDocDisplay | |
{ |
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
import Rhino | |
import System.Drawing | |
import scriptcontext | |
import rhinoscriptsyntax as rs | |
class CustomConduit(Rhino.Display.DisplayConduit): | |
def __init__(self): | |
url = 'https://gist.githubusercontent.com/sbaer/bebd530d103a56cdd0076156af66f54b/raw/a92efce9ef85fd09316a42afcd899bd0e2d19b15/greetings.png' | |
self.image = Rhino.Display.DisplayBitmap.Load(url) |
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
"""Use Google translate web service""" | |
import rhinoscriptsyntax as rs | |
import json, urllib | |
import scriptcontext | |
# Api key that I (Steve Baer) got from Google | |
# http://code.google.com/apis/console-help/#UsingKeys | |
# You might want to generate your own key, but I don't care | |
# if you continue to use this one. | |
KEY = "AIzaSyAZGoS-GjZGaSHZMZdoczfdUtWTjm_D-p4" |
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
declare module 'rhino3dm' { | |
enum ActiveSpace { | |
None, | |
ModelSpace, | |
PageSpace | |
} | |
enum ComponentIndexType { | |
InvalidType, |
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
[{"version": 10000, "archive3dm": 60, "opennurbs": -1942458756, "data": "+n8CAP0BAAAAAAAA+/8CABQAAAAAAAAA3dTXTkfp0xG/5QAQgwEi8BDyeHD8/wIAxQEAAAAAAAAQAwAAAAEAAAADAAAACQAAAAAAAAAAAAAAAAAAAAAA8D8AAAAAAAAAAAAAAAAAAAAAAAAAAAAA8L8AAAAAAAAAAAAAAAAAAAAACgAAAAAAAAAAAAAAAAAAAAAAAAAYLURU+yH5PxgtRFT7Ifk/GC1EVPshCUAYLURU+yEJQNIhM3982RJA0iEzf3zZEkAYLURU+yEZQBgtRFT7IRlACQAAAAAAAAAAAChAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPA/2WzfzHb4IEDZbN/MdvggQAAAAAAAAAAAzDt/Zp6g5j8AAAAAAAAAAAAAAAAAAChAAAAAAAAAAAAAAAAAAADwP9ls38x2+CDA2WzfzHb4IEAAAAAAAAAAAMw7f2aeoOY/AAAAAAAAKMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA8D/ZbN/MdvggwNls38x2+CDAAAAAAAAAAADMO39mnqDmPwAAAAAAAAAAAAAAAAAAKMAAAAAAAAAAAAAAAAAAAPA/2WzfzHb4IEDZbN/MdvggwAAAAAAAAAAAzDt/Zp6g5j8AAAAAAAAoQAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwP04BQN3/fwKAAAAAAAAAAAA="}] |
NewerOlder