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
# IFC files using XBim and Geometry Gym |
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
//Moebius transformations in 3d, by reverse stereographic projection to the 3-sphere, | |
//rotation in 4d space, and projection back. | |
//by Daniel Piker 09/08/20 | |
//Feel free to use, adapt and reshare. I'd appreciate a mention if you post something using this. | |
//You can also now find this transformation as a component in Grasshopper/Rhino | |
//I first wrote about these transformations here: | |
//https://spacesymmetrystructure.wordpress.com/2008/12/11/4-dimensional-rotations/ | |
//If you want to transform about a given circle. Points on the circle and its axis stay on those curves. | |
//You can skip these 2 lines if you want to always use the origin centred unit circle. |
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; | |
using System.Collections.Generic; | |
using Rhino; | |
using Rhino.Geometry; | |
using Grasshopper; | |
using Grasshopper.Kernel; | |
using Grasshopper.Kernel.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.Runtime.InteropServices; | |
using Rhino.Render; | |
using Rhino.Geometry; | |
using Rhino.UI; | |
using Rhino.DocObjects; | |
using Rhino.Commands; | |
using Rhino; | |
using System.Drawing; | |
using Rhino.Display; |
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
from scriptcontext import sticky as st | |
import Rhino as rc | |
def customDisplay(toggle,component): | |
""" Make a custom display which is unique to the component and lives in sticky """ | |
# Make unique name and custom display | |
displayGuid = "customDisplay_" + str(component.InstanceGuid) | |
if displayGuid not in st: |
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 as rc | |
def mapValuesAsColors(values,srcMin,srcMax,targetMin,targetMax): | |
""" Make a list of HSL colors where the values are mapped onto a | |
targetMin-targetMax hue domain. Meaning that low values will be red, medium | |
values green and large values blue if targetMin: 0.0 and targetMax: 0.7 """ | |
# Remap numbers into new numeric domain | |
remappedValues = [] |
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
"""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: |