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 bpy | |
from bpy_extras.io_utils import ExportHelper | |
import os | |
import sys | |
import shutil | |
import struct | |
import tempfile | |
import zipfile | |
bl_info = { |
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 { Document, NodeIO } from '@gltf-transform/core'; | |
import { DracoMeshCompression } from '@gltf-transform/extensions'; | |
import * as draco3d from 'draco3dgltf'; | |
const decoderModule = draco3d.createDecoderModule({}); | |
const encoderModule = draco3d.createEncoderModule({}); | |
export async function draco_extension_issue () { | |
const doc = new Document(); |
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 { Document, NodeIO } from '@gltf-transform/core'; | |
import { DracoMeshCompression } from '@gltf-transform/extensions'; | |
import * as draco3d from 'draco3dgltf'; | |
export async function draco_encode_issue (useTimeout = false) { | |
const doc = new Document(); | |
const buffer = doc.createBuffer('bin'); |
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 { Document, NodeIO } from '@gltf-transform/core'; | |
import { DracoMeshCompression } from '@gltf-transform/extensions'; | |
import * as draco3d from 'draco3dgltf'; | |
export async function draco_extension_issue (useTimeout = false) { | |
const doc = new Document(); | |
const buffer = doc.createBuffer('bin'); |
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
/** | |
* Shuffles array in place using the Fisher-Yates algorithm. | |
* @see https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle#The_modern_algorithm | |
* | |
* @param {Array} a items An array containing the items. | |
*/ | |
function shuffle(a) { | |
for (let i = a.length - 1; i > 0; i--) { | |
const j = Math.floor(Math.random() * (i + 1)); | |
[a[i], a[j]] = [a[j], a[i]]; |
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 openmesh as om | |
import numpy as np | |
mesh = om.read_trimesh('earth.obj', vertex_normal=True, vertex_tex_coord=True) | |
# make mesh handle these attributes | |
mesh.request_vertex_normals() | |
mesh.request_vertex_texcoords2D() | |
# create decimater |
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
cd "$PROGRAMFILES"/nodejs | |
rm npm npx npm.cmd npx.cmd | |
mv node_modules/npm node_modules/npm2 | |
node node_modules/npm2/bin/npm-cli.js i -g npm@latest | |
rm -rf node_modules/npm2/ |
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
pngtopnm -mix assign.png > a.pnm && potrace a.pnm -s -o a.svg |
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
(defn trimmed-bounds | |
[ctx w h] | |
(let [data (.-data (.getImageData ctx 0 0 w h))] | |
(loop [y 0 minx Infinity miny Infinity maxx -Infinity maxy -Infinity] | |
(if (< y h) | |
(let [yw (* y w) | |
minx' (loop [x 0] | |
(when (< x w) | |
(if (= (aget data (+ (* (+ yw x) 4) 3)) 0) | |
(recur (inc x)) |
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
(defn crop-old | |
[ctx w h] | |
(let [data (.-data (.getImageData ctx 0 0 w h)) | |
s (* w h 4) | |
[a b] (loop [y 0 px [] py []] | |
(if (< y h) | |
(let [[x' y'] | |
(loop [x 0 px' px py' py] | |
(if (< x w) | |
(let [a? (> (aget data (+ (* (+ (* y w) x) 4) 3)) 0)] |
NewerOlder