
python-yapgvb is a python binding for Graphviz, using Boost.python.
rate (100)
ball.pos = ball.pos + ball.velocity*dt
if ball.y < ball.radius:ball.velocity.y = -ball.velocity.y
else:ball.velocity.y = ball.velocity.y - 9.8*dt
Boost http://www.boost.org1. Install CGAL 3.3.1
sudo apt-get install libboost-python1.34.1
GMP http://gmplib.org/
sudo apt-get install python-gmpy # will also install libgmp3c2
MPFR http://www.mpfr.org/
(search in synaptic )
Traceback (most recent call last):
File "", line 1, in
File "CGAL/__init__.py", line 3, in
from Kernel import *
ImportError: CGAL/Kernel.so: undefined symbol: _ZN4CGAL8ROTATIONE
python setup.py buildand it works.
sudo python setup.py install
#setup.py---------------------------------------------------
from distutils.core import setup
from distutils.extension import Extension
import os
import os.path
import glob
# Author: Patrick Farrell
# patrick.farrell06@imperial.ac.uk
def MakeExtension(directory):
try:
os.stat(os.path.join("bindings", directory, "All_files_at_once.cpp"))
files = [os.path.join("bindings", directory, "All_files_at_once.cpp")]
except OSError:
files = glob.glob(os.path.join("bindings", directory, "*.cpp"))
ext = Extension(
"CGAL/%s" % directory,
files,
include_dirs=["../.."],
libraries=["CGAL", "boost_python", "gmp", "mpfr"],
define_macros=[('CGAL_DONT_USE_LAZY_KERNEL', None)]
)
return ext
directories = [directory for directory in os.listdir("bindings") if os.path.isdir(
os.path.join("bindings", directory))]
extensions = [MakeExtension(directory) for directory in directories]
setup(
name='CGAL-Python',
version='0.9',
description="Python bindings for the Computational Geometry Algorithms Libra
ry",
author = "CGAL team",
url = "http://cgal-python.gforge.inria.fr/",
packages=["CGAL"],
package_dir={"CGAL": "cgal_package/CGAL"},
ext_modules=extensions,
)
vert[i] = dt.insert(Point_2(random(),random()))# the finite vertices:
print v.point()# the finite edges
print e.vertex()# the finite faces
for i in range(3): print f.vertex(i).point()# compute the finite faces incident to Vertex = vert[0]
finites_faces.append(f1)for f in cir_faces:
if f == f1:break---------------------------------------------------------------
finites_faces.append(f)
pyste是boost.python自带的代码生成器,利用pyste可以很方便的为c++ 的 lib加一层python的shell。pyste依赖gccxml. dependent on boost
mapnik 地图渲染引擎,其渲染的地图效果堪和googlemaps媲美. 里面的底层绘制是使用Agg库,Agg是一个高效的2D图形引擎库. python-mapnik, dependent on boost
geomview http://www.geomview.org 画二维图最好用GnuPlot,而画三维图的时候最好用geomview