This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Space is your leader | |
let mapleader = "\<Space>" | |
" My <leader> mappings | |
nnoremap <leader>w :w<CR> | |
nnoremap <leader>q :q<CR> | |
vmap <leader>y "+y | |
vmap <leader>d "+d | |
nmap <leader>p "+p | |
nmap <leader>P "+P |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[]{beamer} | |
% These two lines allows to create PDF with notes | |
%\usepackage{pgfpages} | |
%\setbeameroption{show notes on second screen} | |
\let\Tiny=\tiny | |
\usetheme{Berlin} | |
%\usetheme{Copenhagen} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2012-2013 DreamWorks Animation LLC | |
# | |
# All rights reserved. This software is distributed under the | |
# Mozilla Public License 2.0 ( http://www.mozilla.org/MPL/2.0/ ) | |
# | |
# Redistributions of source code must retain the above copyright | |
# and license notice and the following restrictions and disclaimer. | |
# | |
# * Neither the name of DreamWorks Animation nor the names of | |
# its contributors may be used to endorse or promote products derived |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <typeinfo> | |
#include <tuple> | |
#include <limits> | |
#include <openvdb/openvdb.h> | |
typedef openvdb::FloatGrid GridType; | |
typedef GridType::TreeType TreeType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CXX=clang | |
EXE=ovdb_01 | |
OPENVDB_INCLUDE=/opt/OpenVDB/include | |
OPENVDB_LIB=/opt/OpenVDB/lib | |
LIBS=-lm -lstdc++ -ltbb -lHalf -llog4cplus -lopenvdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
from matplotlib.path import Path | |
import matplotlib.patches as patches | |
pylab.rcParams['figure.figsize'] = (10.0, 10.0) | |
class Ray: | |
def __init__(self): | |
self.origin = np.zeros((2)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef OPENVDB_USE_ZORDER | |
namespace openvdb { | |
namespace v3_0_0 { | |
namespace tree { | |
inline uint32_t splitBy3(uint32_t x) | |
{ | |
return (x & 0x1) | ((x & 0x2) << 2) | ((x & 0x4) << 4); | |
} | |
template<> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// V type must provide "V::aabb()" and "V::distance(const glm::vec3&)" methods | |
template <typename GridType, typename V> | |
typename GridType::Ptr | |
create_levelset_volume(const V& kVolume, const float kVoxelSize, | |
const float kHalfWidth) | |
{ | |
using ValueType = typename GridType::ValueType; | |
// GridType::ValueType is required to be a floating-point scalar. | |
BOOST_STATIC_ASSERT( | |
boost::is_floating_point<typename GridType::ValueType>::value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using GridT = openvdb::FloatGrid; | |
auto grid1 = openvdb::tools::createLevelSetSphere<GridT>( | |
512.0, openvdb::Vec3f(0, 0, 0), 1, 2); | |
Sphere s0{glm::vec4(-512,-512,512,1), 16}; | |
LinearSphereSweptVolume volume0(s0, /*translation=*/glm::vec3(1024, 1024, 0)); | |
auto grid2 = create_levelset_volume<GridT>(volume0, 1, 2); | |
openvdb::tools::csgDifference(*grid1, *grid2); | |
s0 = Sphere{glm::vec4(-512,512,1024,1), 16}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from mpl_toolkits.mplot3d import axes3d | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import scipy as sp | |
import scipy.optimize | |
def cylinderLineFirstInterval(cylinderLength, lineP0, lineP1): | |
l = cylinderLength | |
p0 = lineP0 | |
p1 = lineP1 |
OlderNewer