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
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 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
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 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
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 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
declare module 'rhino3dm' { | |
enum ActiveSpace { | |
None, | |
ModelSpace, | |
PageSpace | |
} | |
enum ComponentIndexType { | |
InvalidType, |
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
[{"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="}] |
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
import Rhino | |
import scriptcontext | |
import time | |
import math | |
start = time.clock() | |
for i in xrange(600000): | |
line = Rhino.Geometry.Line(0,0,0,math.sin(i),math.cos(i),0) | |
scriptcontext.doc.Objects.AddLine(line) | |
end = time.clock() |
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
import rhinoscriptsyntax as rs | |
import Rhino | |
def ModifyInstancePiece(): | |
rs.UnselectAllObjects() | |
go = Rhino.Input.Custom.GetObject() | |
go.SubObjectSelect = True | |
go.Get() | |
if go.CommandResult() != Rhino.Commands.Result.Success: | |
return |
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
struct SubDVertex | |
{ | |
SubD m_parent; | |
IntPtr m_ptr_vertex; // ON_SubDVertex* vertex | |
uint m_parent_sn; | |
ComponentIndex m_component_index; | |
internal SubDVertex(SubD subd, IntPtr ptr_vertex, ComponentIndex ci, Point3d location) | |
{ | |
m_parent = subd; |
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
public static PlugIn CreatePlugIn(Type pluginType, bool printDebugMessages) | |
{ | |
if (null == pluginType || !typeof(PlugIn).IsAssignableFrom(pluginType)) | |
return null; | |
InitializeRhinoCommon(); | |
// If we turn on debug messages, we always get debug output | |
if (printDebugMessages) | |
SendDebugToCommandLine = true; |
NewerOlder