Skip to content

Instantly share code, notes, and snippets.

# dependencies
apk install gcc make build-base readline readline-dev zlib zlib-dev linux-headers
# path
mkdir /usr/local/src
mkdir /usr/local/postgresql-13.5
# download
cd /usr/local/src
wget https://ftp.postgresql.org/pub/source/v13.5/postgresql-13.5.tar.gz
@ytakzk
ytakzk / sample.py
Last active May 29, 2021 09:05
hyperelastic-meterial-test
import getfem as gf
import numpy as np
#Moony-Rivlinの構成則
C10 = 1.195056693 #[MPa]=[N/mm2]
C01 = 0.0 #[MPa]=[N/mm2]
dim = 3 # 3次元要素
@ytakzk
ytakzk / sdf_on_gpujs.html
Last active May 10, 2020 13:50
SDF operations on gpu.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./css/styles.css">
</head>
<body>
@ytakzk
ytakzk / training.py
Created January 7, 2020 14:46
A snipet to train a model for Generative Modelling with Design Constraints
import gym
from rl.agents import DDPGAgent
from rl.policy import EpsGreedyQPolicy, LinearAnnealedPolicy
from rl.memory import SequentialMemory
from rl.random import OrnsteinUhlenbeckProcess, GaussianWhiteNoiseProcess
from keras.optimizers import Adam
nb_steps = 1500000
memory = SequentialMemory(limit=200000, window_length=WINDOW_LENGTH)
import csv
def write_rhino_points(points, path='./points.csv'):
with open(path, mode='w') as f:
writer = csv.writer(f, delimiter=',')
for p in points:
rosdep update
apt-get -y update
apt-get -y dist-upgrade
apt-get install -y ros-kinetic-catkin python-catkin-tools
apt install -y ros-kinetic-moveit
mkdir -p ~/ws_moveit/src
nx, ny, nz = ax5, ay5, az5
n_length = math.sqrt(nx ** 2 + ny ** 2 + nz ** 2)
distance = 50
nx, ny, nz = nx / n_length * distance, ny / n_length * distance, nz / n_length * distance
ur.send_command_movel([x5 + nx, y5 + ny, z5 + nz, ax5, ay5, az5], v=speed_set, r=radius)
"""Provides a scripting component.
Inputs:
x: The x script variable
y: The y script variable
Output:
a: The a output variable"""
__author__ = "ytakzk"
__version__ = "2019.02.27"
@ytakzk
ytakzk / cgal_installer.sh
Created December 3, 2018 10:31
A script to install CGAL on ubuntu
apt update
apt install g++ cmake libcgal-dev build-essential vim git
g++ main.cpp -lCGAL -lgmp
import sys
sys.path.append('./MAS-1819/T1')
from grlib import graphics as gr
import math
import random
window_length = 800
outline_width = 1
black_color = gr.color_rgb(11, 11, 11)
min_length = 5 # 2, 5, 10 # should be positive over 1