Skip to content

Instantly share code, notes, and snippets.

View ji-podhead's full-sized avatar

Ji ji-podhead

View GitHub Profile
@ji-podhead
ji-podhead / threejs_voxelize.js
Created October 7, 2025 13:38
Voxelize a mesh with threejs and sample the texture
import * as THREE from 'three';
import { MeshSurfaceSampler } from 'three/examples/jsm/math/MeshSurfaceSampler.js';
/**
* Extrahiert Textureddaten in ein format, das einfach zu sampeln ist.
* @param {THREE.Texture} texture - Die zu verarbeitende Texture.
* @returns {ImageData} Die Bilddaten der Texture.
*/
function getTextureImageData(texture) {
const image = texture.image;
@ji-podhead
ji-podhead / voxelize_blender.py
Created October 7, 2025 13:35
Voxelize A Mesh in Blender and sample the color from the texture
import bpy
import bmesh
import numpy as np
import json
from mathutils import Vector
from collections import defaultdict
def texture_surface_voxelizer(obj, particle_count, output_filepath="voxel_data.json"):
"""
Voxelizes the surface of a Blender object, extracts texture colors,
@ji-podhead
ji-podhead / node24+python3.11+npx.compose.yml
Created May 14, 2025 15:05
an example compose file for creating the requirements for using mcp servers
version: "3.9"
services:
gmail:
image: python:3.11
ports:
- "8000:3000"
command: bash -c "apt-get update && apt install --assume-yes npm && npm i -g npx && curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash && \. $HOME/.nvm/nvm.sh && nvm install 24"
privileged: true
# restart: always
tty: true
#!/bin/sh
# create ovs bridge named bridge0
nmcli conn add type ovs-bridge conn.interface bridge0 autoconnect yes
# add add a port to the bridge for the internal ovs interface (iface0)
nmcli conn add type ovs-port conn.interface port0 master bridge0 autoconnect yes
# add internal ovs interface to the create port0
nmcli conn add type ovs-interface conn.interface iface0 master port0 autoconnect yes ipv4.method auto
@justsml
justsml / fetch-api-examples.md
Last active April 22, 2025 13:44
JavaScript Fetch API Examples