Skip to content

Instantly share code, notes, and snippets.

View fstwn's full-sized avatar
💯
keep it clean, keep it lean, work in a team & puff the green (u kno what i mean)

Max Eschenbach fstwn

💯
keep it clean, keep it lean, work in a team & puff the green (u kno what i mean)
View GitHub Profile
@craigforneris
craigforneris / *IFC*
Created December 29, 2022 15:31 — forked from giobel/*IFC*
# IFC files using XBim and Geometry Gym
@Dan-Piker
Dan-Piker / Moebius3d
Last active March 27, 2024 08:06
Moebius transformations in 3d
//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.
@texone
texone / grasshopper csharp only
Created January 16, 2020 22:45
mesh based reaction diffusion
using System;
using System.Collections;
using System.Collections.Generic;
using Rhino;
using Rhino.Geometry;
using Grasshopper;
using Grasshopper.Kernel;
using Grasshopper.Kernel.Data;
@jesterKing
jesterKing / Nathan.cs
Created June 21, 2017 12:03
MemoryBitmapTexture implementation and test command.
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;
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:
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 = []
@sbaer
sbaer / gist:6117280
Created July 30, 2013 21:43
Using python inside of a RhinoCommon command
...
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)
@sbaer
sbaer / gist:2512920
Created April 27, 2012 20:43
Recursive Panelization translation into python
"""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: