Skip to content

Instantly share code, notes, and snippets.

public ConwayPoly Subdivide(float offset)
{
var faceIndices = new List<int[]>();
var vertexPoints = new List<Vector3>();
// Add existing vertices
for (int vertexIndex = 0; vertexIndex < Vertices.Count; vertexIndex++)
{
var x = Vertices[vertexIndex];
//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/
Shader "Custom/Moebius"
{
/*
* Copyright (c) 2013 Calvin Rien
*
* Based on the JSON parser by Patrick van Bergen
* http://techblog.procurios.nl/k/618/news/view/14605/14863/How-do-I-write-my-own-parser-for-JSON.html
*
* Simplified it so that it doesn't throw exceptions
* and can be used in Unity iPhone with maximum code stripping.
*
* Permission is hereby granted, free of charge, to any person obtaining
using System.Collections.Generic;
using ProceduralToolkit;
using ProceduralToolkit.Samples.Primitives;
using UnityEngine;
using XNode;
public enum PrimitiveType
{
Dodecahedron,
Octahedron
def gltf(request, lat, lng, distance):
scale = 100000
pnt = GEOSGeometry(f'POINT({lng} {lat})', srid=4326)
buildings = Building.objects.filter(outline__distance_lte=(pnt, D(km=distance)))
scene = Scene()
centroid_total = (0,0)
count = 0.0
{
"Name": "Snapping",
"ShapeType": "Johnson",
"PolyTypeCategory": "All",
"PolyType": "Small_Cubicuboctahedron",
"JohnsonPolyType": "Cupola",
"OtherPolyType": "L1",
"GridType": "Square",
"GridShape": "Cube",
"BypassOps": false,
using UnityEngine.Rendering;
using UnityEngine.Rendering.Universal;
public class DepthNormalsFeature : ScriptableRendererFeature
{
private DepthNormalsPass depthNormalsPass;
RenderTargetHandle m_DepthNormalsTexture;
public override void Create()
using UnityEngine;
public ChangeStuff()
{
gameobject.GetComponent<MeshRenderer>().material.color = Color.red;
transform.localScale = new Vector3(5,5,5);
}
{
"Name": "Brazier",
"ShapeType": "Uniform",
"PolyType": 39,
"JohnsonPolyType": 4,
"BypassOps": false,
"TwoSided": true,
"GridType": "Hex",
"PrismP": 5,
"PrismQ": 2,
{
"Name": "Vicious",
"ShapeType": "Uniform",
"PolyType": 29,
"JohnsonPolyType": 4,
"BypassOps": false,
"TwoSided": true,
"GridType": "Hex",
"PrismP": 5,
"PrismQ": 2,