Skip to content

Instantly share code, notes, and snippets.

@zeffii
zeffii / index_progress.html
Last active Aug 27, 2022
script for triangulated geometry
View index_progress.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>three.js webgl - geometry - vertex colors</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<link type="text/css" rel="stylesheet" href="../files/main.css">
<style>
body {
@zeffii
zeffii / mellow_movies.md
Last active Aug 13, 2022
mellow movies
View mellow_movies.md
  • back to the future (any, all)
  • honey i shrunk the kids
  • microcosm
  • hunt for red october
  • the abyss
  • california man
  • jurrasic park
  • ghost busters 1
  • jacques cousteau docs (any, all)
  • red dwarf (series)
@zeffii
zeffii / ng2svg_converter_writer.py
Last active Dec 3, 2022
sverchok nodetree to svg basic
View ng2svg_converter_writer.py
import os
import re
import bpy
import inspect
import textwrap
import sverchok
import numpy as np
from mathutils.geometry import interpolate_bezier as bezlerp
from sverchok.utils.sv_node_utils import recursive_framed_location_finder as absloc
from dataclasses import dataclass
@zeffii
zeffii / beginnings_of_simple_svg.py
Last active Jul 16, 2022
blender (sverchok) nodetree to svg
View beginnings_of_simple_svg.py
import os
import re
import bpy
import sverchok
from dataclasses import dataclass
from xml.etree import ElementTree as et
@dataclass
@zeffii
zeffii / find_islands.py
Created Jul 6, 2022
disjoint meshes set theory
View find_islands.py
verts = [[1.101621389389038, 0.541892945766449, 0.0], [0.8510395884513855, -0.006982157006859779, 0.0], [0.7924670577049255, -0.006982157006859779, 0.0], [0.5302482843399048, 0.541892945766449, 0.0], [0.677261471748352, 0.541892945766449, 0.0], [0.8203957080841064, 0.23273855447769165, 0.0], [0.9561598300933838, 0.541892945766449, 0.0], [0.37742435932159424, 0.541892945766449, 0.0], [0.6179208755493164, 0.0, 0.0], [0.4728471636772156, 0.0, 0.0], [0.42823895812034607, 0.10705973953008652, 0.0], [0.18580295145511627, 0.10705973953008652, 0.0], [0.14546160399913788, 0.0, 0.0], [0.0023273855913430452, 0.0, 0.0], [0.22071373462677002, 0.541892945766449, 0.0], [0.38828548789024353, 0.20170675218105316, 0.0], [0.30100852251052856, 0.4123351573944092, 0.0], [0.2214895337820053, 0.20170675218105316, 0.0]]
faces = [[2, 4, 3], [2, 5, 4], [5, 0, 6], [5, 1, 0], [2, 1, 5], [13, 7, 14], [13, 16, 7], [16, 8, 7], [13, 17, 16], [15, 8, 16], [13, 11, 17], [11, 15, 17], [11, 10, 15], [10, 8, 15], [13, 12, 11], [9, 8, 10]]
im
@zeffii
zeffii / FCStd_read_mod.py
Created Jun 11, 2022
FCStd read node (unknown origin)
View FCStd_read_mod.py
from sverchok.dependencies import FreeCAD
from sverchok.utils.dummy_nodes import add_dummy
from sverchok.utils.sv_operator_mixins import SvGenericNodeLocator
if FreeCAD is None:
add_dummy('SvReadFCStdNode', 'SvReadFCStdNode', 'FreeCAD')
else:
F = FreeCAD
@zeffii
zeffii / io_import_fcstd_280.py
Created Jun 11, 2022 — forked from yorikvanhavre/FreeCAD .FCStd importer for Blender 2.80
FreeCAD .FCStd importer for Blender 2.80
View io_import_fcstd_280.py
bl_info = {
"name": "FreeCAD Importer",
"category": "Import-Export",
"author": "Yorik van Havre",
"version": (5, 0, 0),
"blender": (2, 80, 0),
"location": "File > Import > FreeCAD",
"description": "Imports a .FCStd file from FreeCAD",
"warning": "This addon needs FreeCAD installed on your system. Only Part- and Mesh-based objects supported at the moment.",
}
@zeffii
zeffii / snlite_flatterer_live.py
Last active May 12, 2022
flatterer_decomposer_to_pydata
View snlite_flatterer_live.py
"""
>in objects o
>in FilePath FP
out verts v
out edges s
"""
import pathlib
import flatterer
from flatterer import svg_export, mesh_analysis, _pack_sort_items
from sverchok.core.handlers import get_sv_depsgraph
@zeffii
zeffii / gist:0a82d36aae36b6961b529fa5d672c8cc
Created May 5, 2022
_PropertyDeferred is because you are assigning variablename = bpy.props.SomeProperty instead of variablename: bpy.props.SomeProperty
View gist:0a82d36aae36b6961b529fa5d672c8cc
description contains all you need. probably doing this in an Operator or Custom Blender node.
View polygon_indices_from_multipolygons.py
"""
>in geom s
out verts v
out edges s
out faces s
"""
try:
import mathutils
import pandas as pd