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
distance = [] | |
vector = [] | |
#### Check each attractor against all surface points | |
for pt in srfPT: | |
v = None | |
for att in attPT: | |
line_vector = att - pt | |
if not v or line_vector.Length < v.Length: | |
v = line_vector |
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
// Your "get" class will have code that looks like. | |
var go = new Rhino.Input.Custom.GetOption(); | |
var optDbl = new Rhino.Input.Custom.OptionDouble(12, 0,100); | |
go.SetCommandPrompt("Give me an option"); | |
go.SetCommandPromptDefault(""); | |
go.AcceptCustomMessage(true); // NEW!! | |
while (true) | |
{ | |
// need to clear and reset the command options every iteration because | |
// Rhino doesn't know that it needs to update the option string |
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
public static bool CellulateGrid3D(List<Rhino.Geometry.Point3d[]> points1, | |
List<Rhino.Geometry.Point3d[]> points2, | |
out Rhino.Geometry.Line[] wires, | |
out List<Rhino.Geometry.Point3d[]> cells, | |
out Rhino.Geometry.Brep[] boxes) | |
{ | |
bool rc = false; | |
if (points1.Count > 0 && points2.Count > 0) | |
{ | |
using (var divide_points1 = new ClassArrayPointArray(points1)) |
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 rhinoscriptsyntax as rs | |
import Rhino | |
import clr | |
clr.AddReference("grasshopper") | |
import Grasshopper as gh | |
DomainU = rs.SurfaceDomain(srf, 0) | |
DomainV = rs.SurfaceDomain(srf, 1) | |
flatlist = [] |
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
"""Sample script that accesses the shapeways API | |
http://www.shapeways.com/api | |
""" | |
import wsdlprovider | |
wsdl_url = "http://api.shapeways.com/v1/wsdl.php" | |
username = "username" | |
password = "password" | |
application_id = "rhinotest" |
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 | |
# read geometry out of 3dm files and filter by layernames | |
if DoImport and FilePaths and LayerNames: | |
geometry = [] | |
for filepath in FilePaths: | |
model = Rhino.FileIO.File3dm.Read(filepath) | |
if not model: continue | |
for layer in LayerNames: | |
objs = model.Objects.FindByLayer(layer) |
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) |
NewerOlder