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: http://wiki.blender.org/index.php/Doc:2.6/Manual/Extensions/Python/Geometry | |
import bpy | |
# Define the coordinates of the vertices. Each vertex is defined by a tuple of 3 floats. | |
coords=[(-1.0, -1.0, -1.0), (1.0, -1.0, -1.0), (1.0, 1.0 ,-1.0), \ | |
(-1.0, 1.0,-1.0), (0.0, 0.0, 1.0)] | |
# Define the faces by index numbers of its vertices. Each face is defined by a tuple | |
# of 3 or more integers. N-gons would require a tuple of size N. | |
faces=[ (2,1,0,3), (0,1,4), (1,2,4), (2,3,4), (3,0,4)] |
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 bpy | |
if "Cube" in bpy.data.objects.keys(): | |
bpy.data.objects.get("Cube").select = True | |
bpy.ops.object.delete() |
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
""" | |
============== | |
Marching Cubes | |
============== | |
Marching cubes is an algorithm to extract a 2D surface mesh from a 3D volume. | |
This can be conceptualized as a 3D generalization of isolines on topographical | |
or weather maps. It works by iterating across the volume, looking for regions | |
which cross the level of interest. If such regions are found, triangulations | |
are generated and added to an output mesh. The final result is a set of |
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 argparse | |
from pyPdf import PdfFileWriter, PdfFileReader | |
def create_parsers(): | |
p = argparse.ArgumentParser( | |
prog='crop', | |
description='"%(prog)s" crop pdfs', |
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
$pdflatex='pdflatex -interaction=nonstopmode'; | |
$pdf_previewer = "start zathura"; | |
$pdf_update_method=0; | |
$pdf_mode = 1; | |
$dvi_mode = 0; | |
$preview_continuous_mode = 1; | |
add_cus_dep('glo', 'gls', 0, 'run_makeglossaries'); |