Skip to content

Instantly share code, notes, and snippets.

View FantasyVR's full-sized avatar
🎯
Focusing

pengyu FantasyVR

🎯
Focusing
  • Taichi Graphics
  • Beijing
View GitHub Profile
@FantasyVR
FantasyVR / photoshop.md
Last active June 30, 2018 11:20
photoshop步骤

人脸修图

用PS打开图片之后的第一步总是复制背景图层,也可以用快捷键ctrl + J。这样做的原因是可以恢复到最初的状态,其实图层就像是一系列操作的集合?!

去污工具

污点修复画笔工具,快捷键J。这个可以用来擦除脸上的痘痘

高斯去噪

  1. 复制蓝通道
  2. 滤镜-其他-高反差保留;半径:4.0像素
  3. 图像-计算;混合:强光。重复3次本步骤
  4. Ctrl+鼠标左键 点击通道下边的Alpha 3通道
  5. Ctrl + Shift + I反选择
position=<-10351, -10360> velocity=< 1, 1>
position=< 52528, 31539> velocity=<-5, -3>
position=<-31270, -20838> velocity=< 3, 2>
position=< 52486, -10365> velocity=<-5, 1>
position=< 31558, 10589> velocity=<-3, -1>
position=<-52253, 21064> velocity=< 5, -2>
position=<-10354, 42015> velocity=< 1, -4>
position=<-41798, 42013> velocity=< 4, -4>
position=<-52253, -52267> velocity=< 5, 5>
position=< 31550, -41793> velocity=<-3, 4>
#ip 3
addi 3 16 3
seti 1 6 1
seti 1 4 5
mulr 1 5 4
eqrr 4 2 4
addr 4 3 3
addi 3 1 3
addr 1 0 0
addi 5 1 5
@FantasyVR
FantasyVR / day21
Last active December 21, 2018 11:25
#ip 2
# 0 1 2 3 4 5
# a b ip c d e
0 seti 123 0 5 # e = 123
1 bani 5 456 5 # e &= 456 = 72
2 eqri 5 72 5 # if e == 72 then e = 1 else e = 0
3 addr 5 2 2 # ip += e
4 seti 0 0 2 # ip = 0
5 seti 0 4 5 # e = 0
6 bori 5 65536 4 # d = e | 65536
@FantasyVR
FantasyVR / convertG2T.py
Created February 26, 2019 03:32
convert *.msh to tetgen mesh "*.node, *.ele"
'''
convert gmseh to tetgen mesh: *.node, *.ele
'''
import sys
def anylize(filename):
file = open(filename,'r')
nodes = []
eles = []
isnode = False;

From This Answer

[CertUtil][1] is a pre-installed Windows utility that can be used to generate hash checksums:

certUtil -hashfile pathToFileToCheck [HashAlgorithm]

常用的 CMake 和 VS 对应

  1. include_directoriesProperty -> C/C++ -> Additional Include Diretories
  2. link_directoriesProperty -> Linker -> Additional Library Directories
  3. target_link_librariesProperty -> Linker -> Additional Dependencies

常用的一些命令

set命令

git 常用指令

如何协作

  1. git remote add upstream git@...
  2. git fetch upstream
  3. git merge upstream/master
  4. git push

然后在自己的仓库创建新的pull request合并到远程的upstream仓库。

@FantasyVR
FantasyVR / ComputeGradient.m
Last active September 17, 2019 14:15
XPBD based FEM
function [gc] = ComputeGradient(F,D_m)
%ComputeGradient Summary of this function goes here
% Compute the gradient of constraints
gc = zeros(12,6);
f1 = F(:,1);
f2 = F(:,2);
f3 = F(:,3);
invD_m = inv(D_m);
@FantasyVR
FantasyVR / rigidNeedleSuture.xml
Created May 27, 2020 14:01
Flexible suture attached with rigid needle in sofa framwork
<?xml version="1.0"?>
<Node name="root" dt="0.01" gravity="0 0 -9.81">
<RequiredPlugin name="SofaOpenglVisual"/>
<VisualStyle displayFlags="showBehaviorModels showForceFields showCollisionModels" />
<DefaultPipeline depth="6" verbose="0" draw="0" />
<BruteForceDetection name="N2" />
<MinProximityIntersection name="Proximity" alarmDistance="0.03" contactDistance="0.02" />
<DefaultContactManager name="Response" response="default" />
<FreeMotionAnimationLoop /><!-- this is necessary in BilateralInteractionConstraint-->
<LCPConstraintSolver tolerance="1e-3" maxIt="1000"/>