Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View kaosat-dev's full-sized avatar

Mark Moissette kaosat-dev

View GitHub Profile
@kaosat-dev
kaosat-dev / Flecs_ecs_collisions_error
Created December 26, 2020 14:10
Compile / run errors for ecs_collisions (flecs)
ckaos@pop-os:~/dev/experiments/flecs$ bake run ecs_collisions
[ build] package cglm => '/home/ckaos/bake/src/cglm'
[ build] package flecs => '/home/ckaos/dev/experiments/flecs/flecs'
[ build] package flecs.meta => '/home/ckaos/bake/src/flecs-meta'
[ build] package flecs.util => '/home/ckaos/bake/src/flecs-util'
[ 50%] ringbuf.c
In file included from /home/ckaos/bake/src/flecs-util/include/flecs_util.h:5,
from /home/ckaos/bake/src/flecs-util/src/ringbuf.c:3:
/home/ckaos/bake/src/flecs-util/include/flecs-util/ringbuf.h:15:1: error: unknown type name ‘FLECS_UTIL_EXPORT’; did you mean ‘FLECS_UTIL_API’?
15 | FLECS_UTIL_EXPORT
@kaosat-dev
kaosat-dev / !QuickJs_SharedLib.md
Last active December 20, 2020 06:20
QuickJS: creating a shared c module and import it as a module in js

QuickJS: creating a shared c module and import it as a module in js

preparing the .c/.h files

  • the first few lines of your .c/.h files are very important !
    • #define countof(x) (sizeof(x) / sizeof((x)[0])) => this one should be copy & pasted, or inclued
  • the JS_INIT_MOULE is also critical as quickjs relies on that ! typos are critical (spent an hour on a typo ...)
@kaosat-dev
kaosat-dev / differenceVSnegate.js
Last active October 26, 2018 09:15
Laying out the differences (pun intended) between boolean difference & the proposed 'negate()/negative()' operation
// with difference only, assuming that the details of partWithCuts are known (otherwise it cannot work)
const partWithCuts = () => {
const block = cube()
const cutOut = cylinder()
const cutOut2 = cylinder()
// not useable, information about cut is lost
// return difference(block, cutOut, cutout2)
return {keep: [block], remove: [cutOut, cutOut2]}
}
const projection = function (params, ...csgs) {
const defaults = {
plane: [0, 0, 1, 1],// x, y, z, w : as an array, magically simple !!
cut: false
}
const {plane, cut} = Object.assign({}, defaults, params)
const [x, y, z, w] = plane
// for now we still have to convert arrays to something way more complicated internally , sigh
const orthobasis = new CSG.OrthoNormalBasis(new CSG.Plane(new CSG.Vector3D([x, y, z]), w))
@kaosat-dev
kaosat-dev / codepen.md
Created December 2, 2017 15:12 — forked from serapath/codepen.md
A synchronous `require` function for the browser that downloads and caches modules from npm - just copy & paste it to the dev tools javascript console

use require in a codepen

  1. click on the little icon Open JS Settings on the JavaScript editor pane
  2. Then add the following link under Add External Javascript
https://cdn.rawgit.com/serapath/e2b55cab315e60fbbffea7b43acd8749/raw/a2709905ca06830f78d6069b97cda1f18eb9ef4c/require.js
  1. Press Save & Close and start using the require(...) in your JavaScript code on codepen
@kaosat-dev
kaosat-dev / .gitignore
Created November 10, 2017 20:24 — forked from claudiopro/.gitignore
require-from-dat
/node_modules/
module.js
@kaosat-dev
kaosat-dev / notes.md
Last active July 11, 2017 21:25
CSG.js restructuring notes

CSG.js notes:

  • CAG : any boolean ops converts to CSG and back again !
    • sides are very inneficient data structures : there are duplicates of every points! (end of one side, start of next)
    • CAG’s could retain api by just providing accessors to underlying data structures
  • Vertex vs Vector :
    • potentially redundant ? needs more investigating
    • “only” has an extra ‘tag’ field nothing more
  • methods that can be easily extracted (barely any ‘this’ references, if at all, etc)
    • overCutInsideCorners
  • used in tests only => good candidate
@kaosat-dev
kaosat-dev / esnextbin.md
Last active June 6, 2017 12:07
esnextbin sketch
@kaosat-dev
kaosat-dev / auto-deploy.md
Created May 5, 2017 07:12 — forked from domenic/0-github-actions.md
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.

@kaosat-dev
kaosat-dev / esnextbin.md
Last active May 14, 2017 12:13
esnextbin sketch