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
# Main CMakeFile.txt | |
# Minimal version of CMake | |
cmake_minimum_required (VERSION 2.6) | |
# Build type | |
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | |
message(STATUS "Setting build type to 'Debug' as none was specified.") | |
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE) | |
# Set the possible values of build type for cmake-gui |
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
# Main CMakeFile.txt | |
# Minimal version of CMake | |
cmake_minimum_required (VERSION 2.6) | |
# Build type | |
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | |
message(STATUS "Setting build type to 'Debug' as none was specified.") | |
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE) | |
# Set the possible values of build type for cmake-gui |
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
""" | |
This module is able to create simple solid object (cube). Each side of | |
cube is bspline surface. This solid object can be exported to BREP file. | |
""" | |
from OCC.gp import * | |
from OCC.Geom import * | |
from OCC.TColGeom import * | |
from OCC.TColgp import * | |
from OCC.GeomConvert import * |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"/> | |
<title>WebGL Simple Point</title> | |
</head> | |
<body> | |
<canvas width="512" height="512" id="webgl_canvas"></canvas> |
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 | |
import bmesh | |
import mathutils | |
def main(): | |
""" | |
Example of bmesh and shape keys | |
""" | |
# Add basis shape |
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
""" | |
This example try to create new empty object visualized as | |
image. Image fits to the background of current active camera. | |
When you set X,Y coordinates of empty object called 'Pixel', | |
then this object is position at corresponding X,Y coordinate | |
at image in 3D space. | |
""" | |
import bpy | |
import math |
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
""" | |
Demonstration of computation distance point to plane. Plane is represented by normal | |
vector and point laying at the plane. | |
""" | |
import bpy | |
import mathutils | |
def main(): |
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 <stdlib.h> | |
#include <TColgp_Array2OfPnt.hxx> | |
#include <TColStd_Array1OfReal.hxx> | |
#include <TColStd_Array1OfInteger.hxx> | |
#include <gp_Pnt.hxx> | |
#include <TopoDS_Edge.hxx> | |
#include <BRepBuilderAPI_MakeEdge.hxx> | |
#include <TopoDS_Wire.hxx> |
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
""" | |
This simple example of Blender Python script prints membership of verticies in vertex groups and weights. It uses deform layer. | |
""" | |
import bpy | |
import bmesh | |
obj = bpy.context.object | |
# Get the active mesh |
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 | |
import bmesh | |
obj = bpy.context.active_object | |
mesh = obj.data | |
bmsh = bmesh.new() | |
bmsh.from_mesh(mesh) | |
# Do something with mesh: e.g. add layer | |
layer = bmsh.verts.layers.int.new('Example') | |
for id,vert in enumerate(bmsh.verts): |