[Radiance-general] Re: Radiance-general Digest, Vol 37, Issue 7
Jelle Feringa / EZCT Architecture & Design Research
jelle.feringa at ezct.net
Fri Mar 16 16:22:22 CET 2007
Hi Martin,
I agree with Francesco, (t)vtk is a good option, there is a powerful surface
reconstruction method.
https://svn.enthought.com/enthought/wiki/*TVTK*
Something else you might want to look into is cgal's alpha-shapes.
If you allow me for yet-another-python-plug:
http://cgal-python.gforge.inria.fr/
implements this functionality:
http://www.cgal.org/Manual/3.2/doc_html/cgal_manual/Alpha_shapes_3/Chapter_main.html
Here's a tvtk snippet that might of some use:
---------------------------------------------------------------------------------------------
import random
from pickle import loads
from pprint import pprint
from enthought.pyface import GUI
import numpy as np
import scipy as sp
from enthought.tvtk.tools import ivtk
from enthought.tvtk.api import tvtk
from enthought.pyface.tvtk import actors
gui = GUI()
window = ivtk.IVTKWithCrustAndBrowser(size=(800,600)) # Size is optional.
window.open()
# note that this data is generated with ALL rtrace output flags enabled!
f =
open('E:\\EZCT\\EZCT___projects\\Seroussi_House\\01_Correspondance\\send_program_to_marc\\rtrace_values.pickle')
rtrace_values = loads(f.read())
radiance_origin = rtrace_values[:,:3]
radiance_direction = rtrace_values[:,3:6]
radiance_value = rtrace_values[:,6:9]
radiance_value = ((radiance_value * sp.array((0.265, 0.670,
0.065),'f'))*110.)/3683.
# -> Lux conversion
radiance_vec_length = rtrace_values[:,9:10]
radPts = tvtk.Points(data=radiance_origin)
radPoly = tvtk.PolyData(points=radPts)
radPoly.point_data.vectors = radiance_direction
radPoly.point_data.scalars = radiance_value
reducedRadPts = tvtk.MaskPoints(input=radPoly, on_ratio=10)
reducedRadPts.output.point_data.vectors = radiance_direction
reducedRadPts.output.point_data.scalars = radiance_value
thresh = tvtk.ThresholdPoints(input=radPoly)
thresh.threshold_between(radiance_value.mean(), radiance_value.max())
ugrid = tvtk.UnstructuredGrid(points=radPts)
#srf = tvtk.ContourFilter(input=thresh.output)
srf = tvtk.SurfaceReconstructionFilter(input=thresh.output)
cf = tvtk.ContourFilter(input=srf.output)
cf.set_value(0, 0.0)
srfMap = tvtk.PolyDataMapper(input=cf.output)
srfProp = tvtk.Property(representation='s')
srfActor= tvtk.Actor(mapper=srfMap, property=srfProp)
window.scene.add_actor(srfActor)
---------------------------------------------------------------------------------------------
from here use window.scene.(save_obj?) to export the reconstructed surface
to a polygon file.
By the way, are you still working on top-down-lighting design approaches
Martin?
Very inspiring research!
-jelle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://radiance-online.org/pipermail/radiance-general/attachments/20070316/2c38317f/attachment.htm
More information about the Radiance-general
mailing list