Skip to content

Instantly share code, notes, and snippets.

@melund
melund / AnatomicalJointAngleTemplate.any
Created March 5, 2012 08:01
Anatomical joint angles
// This file contains two template to measure anatomical joint angles
// and projected moments for the anybody modelling system.
//
// The CreateJointMeasures template creates a folder with measures of
// the anatomical joint angles. Angles are measured based on the
// Grood&Suntay convention also recommended by ISB.
//
// Inputs are AnyRefFrame derived classes which represent the antomical
// coordinate system for the segments. In the example below; all *StaticMarkerFrame
// are embedded cordinate systems between which the joint angles are measured.
@melund
melund / default.reg
Created July 6, 2016 06:52 — forked from P4/default.reg
Color schemes for Windows Command Prompt
Windows Registry Editor Version 5.00
; Default color scheme
; for Windows command prompt.
; Values stored as 00-BB-GG-RR
[HKEY_CURRENT_USER\Console]
; BLACK DGRAY
"ColorTable00"=dword:00000000
"ColorTable08"=dword:00808080
; BLUE LBLUE
@melund
melund / smootherstep.any
Last active November 9, 2016 09:17
Inline AnyScript implementation of a smooth step function with zero 1st and 2nd derivative at the edges.
/*
// Inline AnyScript implementation of the following C++ function:
// https://en.wikipedia.org/wiki/Smoothstep
float smootherstep(float edge0, float edge1, float x)
{
// Scale, and clamp x to 0..1 range
x = clamp((x - edge0)/(edge1 - edge0), 0.0, 1.0);
// Evaluate polynomial
return x*x*x*(x*(x*6 - 15) + 10);
}

Keybase proof

I hereby claim:

  • I am melund on github.
  • I am mortenlund (https://keybase.io/mortenlund) on keybase.
  • I have a public key ASC-ZFXJdBpvpCzL8bf79fRFDZWY_L29s_f3BV6QU_585Qo

To claim this, I am signing this object:

// This file contains usefull macro functions for the AnyBody Modeling system.
#ifndef _HELPER_MACORS_ANY_
#define _HELPER_MACORS_ANY_
// Running number to compare file versions.
#define _HELPER_MACORS_ANY_VERSION 3
// Inline implemention of an MxN zero matrix
#define ZEROS(M,N) reshape(0.0*iarr(0,(M)*(N)-1),{M,N})
@melund
melund / 0001-Updates-since-3.0.patch
Created December 19, 2019 22:58
Update to BTK since 3.0 release
This file has been truncated, but you can view the full file.
From 3169f41cfba3a3287b2674b3175b13830815f848 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arnaud=20Barre=CC=81?= <arnaud.barre@gmail.com>
Date: Fri, 10 Jan 2014 22:07:34 +0100
Subject: [PATCH 1/2] Updates since 3.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[UPD] CMake option BTK_EXTRA_COMPILER_WARNINGS works also with the Clang compiler.
@melund
melund / 0002-Python-3-support.patch
Created December 19, 2019 23:00
Updates to BTK for Python3 support
From 86e1ad72b08e0a421efda791e87ed77c87b2866d Mon Sep 17 00:00:00 2001
From: Allard Hoeve <allardhoeve@gmail.com>
Date: Thu, 28 Mar 2019 12:03:41 +0100
Subject: [PATCH] Python 3 support
Enable Python 3 build
Moved the *.tpp includes from the .h to the .cpp.
Fix the problem with using BTK in other libraries (like OpenSim) on Windows.