This file contains hidden or 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 os, requests, json | |
q = 'recipe' | |
p = 0 | |
imgs = [] | |
out_dir = 'fetched-images' | |
if not os.path.exists(out_dir): os.makedirs(out_dir) | |
while True: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='UTF-8'> | |
<style>* {margin: 0; padding: 0; height: 100%; width: 100%;}</style> | |
</head> | |
<body> | |
<script src='https://cdnjs.cloudflare.com/ajax/libs/three.js/110/three.min.js'></script> | |
<script> | |
var scene = new THREE.Scene(); |
This file contains hidden or 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
controls.noZoom = true; | |
window.addEventListener('mousewheel', function(e) { | |
e.preventDefault(); | |
var x = ( event.clientX / window.innerWidth ) * 2 - 1, | |
y = - ( event.clientY / window.innerHeight ) * 2 + 1, | |
vector = new THREE.Vector3(x, y, 1), | |
factor = 0.005, | |
func = e.deltaY < 0 ? 'addVectors' : 'subVectors'; | |
vector.unproject(camera); |
This file contains hidden or 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
.ipynb_checkpoints | |
*.pyc | |
*.pem | |
*.swp | |
*.json | |
*.DS_Store |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file contains hidden or 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
/** | |
* Loads a Wavefront .mtl file specifying materials | |
* | |
* @author angelxuanchang | |
*/ | |
THREE.MTLLoader = function ( manager ) { | |
this.manager = ( manager !== undefined ) ? manager : THREE.DefaultLoadingManager; |
This file contains hidden or 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
%matplotlib inline | |
import matplotlib.pyplot as plt | |
import numpy as np | |
side = 85 | |
n = side * side | |
np.random.seed(0) | |
xy = np.random.uniform(low=-1, high=+1, size=(n, 2)) | |
xy = np.cumsum(xy, axis=0) | |
xy -= xy.min(axis=0) |
This file contains hidden or 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
def lat_lon_hex_mesh(bounds, d=3): | |
"""Creates a hexagonal lat/lon mesh within bounds that has a radial separation of d""" | |
lone, lonw, lats, latn = bounds | |
# heigt of equilatral triangle from radial distance sqrt(r^2 - (r/2)^2) | |
h = np.sqrt(0.75) * d | |
w = d / 2 | |
lat_vals = np.arange(lats, latn, h) |