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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Fullscreen Canvas</title> | |
<style> | |
body, html { | |
margin: 0; | |
padding: 0; |
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 tess | |
import random | |
import trimesh | |
import manifold3d | |
import numpy as np | |
from time import perf_counter | |
rand_color = [random.random(), random.random(), random.random()] | |
def explode(convex_pieces, explode_amount = 1.5, debug_shapes = None): | |
global rand_color |
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 numpy as np | |
import cv2 | |
import dxcam | |
import win32api | |
import threading | |
import time | |
#from line_profiler import LineProfiler | |
class webcamThread(threading.Thread): | |
def __init__(self): |
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
#ifdef RENDER_SNIPPET | |
#include <vector> | |
#include "PxPhysicsAPI.h" | |
#include "../snippetrender/SnippetRender.h" | |
#include "../snippetrender/SnippetCamera.h" | |
using namespace physx; |
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 ctypes import * | |
from ctypes.wintypes import * | |
# Constants | |
# For touchMask | |
TOUCH_MASK_NONE= 0x00000000 # Default | |
TOUCH_MASK_CONTACTAREA= 0x00000001 | |
TOUCH_MASK_ORIENTATION= 0x00000002 | |
TOUCH_MASK_PRESSURE= 0x00000004 | |
TOUCH_MASK_ALL= 0x00000007 |
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
/** This class provides Debug Utilities. */ | |
class Debug { | |
/** Reroute Console Errors to the Main Screen (for mobile) | |
* @param {Worker} worker */ | |
constructor(worker) { | |
// Route Worker Errors Here | |
worker.registerCallback("error", this.fakeError.bind(this)); | |
// Intercept Main Window Errors as well |
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
export default opencascade; // Optional Line | |
declare function opencascade<T>(target?: T): Promise<T & typeof opencascade>; | |
declare module opencascade { | |
function destroy(obj: any): void; | |
function _malloc(size: number): number; | |
function _free(ptr: number): void; | |
const HEAP8: Int8Array; | |
const HEAP16: Int16Array; | |
const HEAP32: Int32Array; | |
const HEAPU8: Uint8Array; |
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
// This is just an example script for converting hand motions to PWM Servo Angles 1-255 | |
// Designed to be used with UnityModules - https://github.com/leapmotion/UnityModules | |
using Leap; | |
using Leap.Unity; | |
using UnityEngine; | |
public class HandAngleParser : MonoBehaviour { | |
private const int N_FINGERS = 5; | |
private const int N_ACTIVE_BONES = 2; |
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 numpy as np | |
import cv2 | |
import pyperclip | |
from PIL import ImageFont, ImageDraw, Image | |
laplacian = False | |
density = 17 | |
font_size_y = 18 | |
blur = 5 # Must Be Odd |
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
# Fitting Google's "Turbo" Palette with a Cosine Approximation | |
# https://ai.googleblog.com/2019/08/turbo-improved-rainbow-colormap-for.html | |
# Inspired by: https://observablehq.com/@mbostock/turbo | |
# Compare: https://i.imgur.com/5GW6Se2.png | |
# First import the usual suspects | |
import numpy as np | |
from scipy.optimize import curve_fit | |
import matplotlib.pyplot as plt |
NewerOlder