Skip to content

Instantly share code, notes, and snippets.

@twobob
twobob / example_image_utils.py
Created August 31, 2022 12:02 — forked from pojda/example_image_utils.py
Layer on top of Python Imaging Library (PIL) to write text in images easily
#!/usr/bin/env python
# coding: utf-8
# You need PIL <http://www.pythonware.com/products/pil/> to run this script
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use
# any TTF you have)
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <http://www.gnu.org/copyleft/gpl.html>
from image_utils import ImageText
@twobob
twobob / example_image_utils.py
Created August 31, 2022 12:01 — forked from turicas/example_image_utils.py
Layer on top of Python Imaging Library (PIL) to write text in images easily
#!/usr/bin/env python
# coding: utf-8
# You need PIL <http://www.pythonware.com/products/pil/> to run this script
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use
# any TTF you have)
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <http://www.gnu.org/copyleft/gpl.html>
from image_utils import ImageText
@twobob
twobob / Sine.cs
Created August 12, 2021 16:17 — forked from xshazwar/Sine.cs
MapMagic2 Custom Generator Node
using System;
using System.Collections.Concurrent;
using System.Threading.Tasks;
using Den.Tools;
using Den.Tools.GUI;
using Den.Tools.Matrices;
using MapMagic.Products;
using MapMagic.Nodes;
@twobob
twobob / bom2grouped_csv_jlcpcb.xsl
Created March 28, 2020 04:58 — forked from arturo182/bom2grouped_csv_jlcpcb.xsl
A KiCad BOM script for generating JLCPCB PCBA-compatible files!
<!--XSL style sheet to convert EESCHEMA XML Partlist Format to grouped CSV BOM Format
Copyright (C) 2014, Wolf Walter.
Copyright (C) 2013, Stefan Helmert.
Copyright (C) 2018, Kicad developers.
Copyright (C) 2019, arturo182.
GPL v2.
Functionality:
Generation of JLCPCB PCBA compatible BOM
@twobob
twobob / ZipExample.cs
Created September 12, 2018 12:26 — forked from n1ckfg/ZipExample.cs
Compress and decompress using SharpZipLib in Unity
// http://www.sebaslab.com/how-to-compress-and-decompress-binary-stream-in-unity/
using ICSharpCode.SharpZipLib.BZip2;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
static void Compress (string nameOfTheFileToSave, ISerializable objectToSerialize)
{
using (FileStream fs = new FileStream(nameOfTheFileToSave, FileMode.Create))
{
@twobob
twobob / FreeFormDeformer.cs
Created September 8, 2018 01:35 — forked from Jerdak/FreeFormDeformer.cs
Example of free form deformation using Unity. Full package can be found in my main repository: https://github.com/Jerdak/FreeFormDeformation/tree/master/Unity
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// Helper class that represents a parameterized vertex
/// </summary>
public class Vector3Param {
///bernstein polynomial packing
@twobob
twobob / SkinnedMeshCombiner.cs
Created September 8, 2018 01:31 — forked from radiatoryang/SkinnedMeshCombiner.cs
example code for combining SkinnedMeshRenderers at runtime (for optimization reasons usually), which I use in my games for Mixamo Fuse models specifically... PLEASE DON'T ASK ME FOR HELP WITH THIS, this is more for learning purposes, and it's not really an easy-to-use Asset Store thing? also I have a lot of weird hacks specific for my uses... ag…
// this code is under MIT License, by Robert Yang + others (credits in comments)
// a lot of this is based on http://wiki.unity3d.com/index.php?title=SkinnedMeshCombiner
// but I removed the atlasing stuff because I don't need it
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@twobob
twobob / MeshCut.cs
Created September 7, 2018 08:28 — forked from alexcmd/MeshCut.cs
Mesh cut algorithm for Unity
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MeshCut
{
private static Plane blade;
private static Transform victim_transform;
private static Mesh victim_mesh;
using UnityEngine;
public class SimpleSoundManager:MonoBehaviour {
// Audio source
private AudioSource musicSrc;
private AudioSource effectSrc;
// Instance variable
private static SimpleSoundManager instance;
// Instance
@twobob
twobob / ToonDeferredShading2017.shader
Created August 25, 2018 23:18 — forked from xDavidLeon/ToonDeferredShading2017.shader
Unity 5.6 Deferred Cel Shading Modification
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Modifications by David Leon. Copyright (c) 2017 Lince Works SL. MIT license (see license.txt)
Shader "ToonDeferredShading2017" {
Properties {
_LightTexture0 ("", any) = "" {}
_LightTextureB0 ("", 2D) = "" {}
_ShadowMapTexture ("", any) = "" {}
_SrcBlend ("", Float) = 1
_DstBlend ("", Float) = 1