Date: Mon, 24 Jan 2022 17:13:39 GMT From: Yuri Victorovich <yuri@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 3054f22f929e - main - science/py-fresnel: New port: Publication quality path tracing in real time Message-ID: <202201241713.20OHDd3x074153@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=3054f22f929ef70c69904de17be9a681c8f8fa14 commit 3054f22f929ef70c69904de17be9a681c8f8fa14 Author: Yuri Victorovich <yuri@FreeBSD.org> AuthorDate: 2022-01-24 17:12:40 +0000 Commit: Yuri Victorovich <yuri@FreeBSD.org> CommitDate: 2022-01-24 17:13:37 +0000 science/py-fresnel: New port: Publication quality path tracing in real time --- science/Makefile | 1 + science/py-fresnel/Makefile | 32 +++++++++++++ science/py-fresnel/distinfo | 9 ++++ science/py-fresnel/files/example.py | 55 +++++++++++++++++++++++ science/py-fresnel/pkg-descr | 9 ++++ science/py-fresnel/pkg-plist | 90 +++++++++++++++++++++++++++++++++++++ 6 files changed, 196 insertions(+) diff --git a/science/Makefile b/science/Makefile index 33c9edc38c12..a5cb7726def3 100644 --- a/science/Makefile +++ b/science/Makefile @@ -266,6 +266,7 @@ SUBDIR += py-dlib SUBDIR += py-eccodes SUBDIR += py-esda + SUBDIR += py-fresnel SUBDIR += py-geolinks SUBDIR += py-geomet SUBDIR += py-geometer diff --git a/science/py-fresnel/Makefile b/science/py-fresnel/Makefile new file mode 100644 index 000000000000..625ee8d90c52 --- /dev/null +++ b/science/py-fresnel/Makefile @@ -0,0 +1,32 @@ +PORTNAME= fresnel +DISTVERSIONPREFIX= v +DISTVERSION= 0.13.4-4 +DISTVERSIONSUFFIX= -g3ba217f +CATEGORIES= science # physics +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Publication quality path tracing in real time + +LICENSE= BSD3CLAUSE +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= pybind11>0:devel/pybind11 +LIB_DEPENDS= libembree3.so:graphics/embree \ + libqhull_r.so:math/qhull8 \ + libtbb.so:devel/onetbb +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pillow>0:graphics/py-pillow@${PY_FLAVOR} + +USES= cmake:testing compiler:c++14-lang python + +USE_GITHUB= yes +GH_ACCOUNT= glotzerlab + +GH_TUPLE= glotzerlab:random123:7f2371b8c597a486cd33fb421a196d78efe08043:glotzerlab_random123/extern/random123 \ + glotzerlab:fresnel-examples:dad005682fc3b5d167861ce7eda23a157baf2ce7:glotzerlab_fresnel_examples/doc/examples \ + glotzerlab:qhull:613debeaea72ee66626dace9ba1a2eff11b5d37d:glotzerlab_qhull/extern/qhull + +do-test: install + @cd ${WRKDIR} && ${PYTHON_CMD} ${FILESDIR}/example.py + +.include <bsd.port.mk> diff --git a/science/py-fresnel/distinfo b/science/py-fresnel/distinfo new file mode 100644 index 000000000000..e9eab2d2039d --- /dev/null +++ b/science/py-fresnel/distinfo @@ -0,0 +1,9 @@ +TIMESTAMP = 1642820220 +SHA256 (glotzerlab-fresnel-v0.13.4-4-g3ba217f_GH0.tar.gz) = ac0b4f0e26050cdb4c1f5aa65cca66462127f2e6f2d6e0c97138d510fe5356e6 +SIZE (glotzerlab-fresnel-v0.13.4-4-g3ba217f_GH0.tar.gz) = 11009467 +SHA256 (glotzerlab-random123-7f2371b8c597a486cd33fb421a196d78efe08043_GH0.tar.gz) = c96b9240953197387977244858d624c81bef15d74c5badd77a07c8d29cb30a8e +SIZE (glotzerlab-random123-7f2371b8c597a486cd33fb421a196d78efe08043_GH0.tar.gz) = 648611 +SHA256 (glotzerlab-fresnel-examples-dad005682fc3b5d167861ce7eda23a157baf2ce7_GH0.tar.gz) = c603a5a48b7b559ae091d11f4a1ccdae2628929ccef721d9da1bd17bb8928e5a +SIZE (glotzerlab-fresnel-examples-dad005682fc3b5d167861ce7eda23a157baf2ce7_GH0.tar.gz) = 8110548 +SHA256 (glotzerlab-qhull-613debeaea72ee66626dace9ba1a2eff11b5d37d_GH0.tar.gz) = b4504a190dc15c3ae932b998a2eed3cba8c7bdda1ab2a886e7e09d0526ee8143 +SIZE (glotzerlab-qhull-613debeaea72ee66626dace9ba1a2eff11b5d37d_GH0.tar.gz) = 1308230 diff --git a/science/py-fresnel/files/example.py b/science/py-fresnel/files/example.py new file mode 100644 index 000000000000..71d7325011b0 --- /dev/null +++ b/science/py-fresnel/files/example.py @@ -0,0 +1,55 @@ +# the example is taken from https://fresnel.readthedocs.io/en/stable/examples/00-Basic-tutorials/00-Introduction.html +# image display is altered to use PIL + +## generate image + +import fresnel + +scene = fresnel.Scene() + +geometry = fresnel.geometry.Sphere(scene, N=8, radius=1.0) + +geometry.position[:] = [[1,1,1], + [1,1,-1], + [1,-1,1], + [1,-1,-1], + [-1,1,1], + [-1,1,-1], + [-1,-1,1], + [-1,-1,-1]] + + +geometry.material = fresnel.material.Material(color=fresnel.color.linear([0.25,0.5,0.9]), + roughness=0.8) +scene.camera = fresnel.camera.Orthographic.fit(scene) + +fresnel.preview(scene) + +fresnel.preview(scene, anti_alias=False) + +fresnel.pathtrace(scene) + +fresnel.pathtrace(scene, light_samples=40) + +out = fresnel.preview(scene) +print(out[:].shape) +print(out[:].dtype) + +import PIL + +image = PIL.Image.fromarray(out[:], mode='RGBA') +image.save('output.png') + +image = PIL.Image.fromarray(out[:,:,0:3], mode='RGB') +image.save('output.jpeg') + + +## display image + +from PIL import Image + +im = Image.open('output.png') +im.show() + +im = Image.open('output.jpeg') +im.show() diff --git a/science/py-fresnel/pkg-descr b/science/py-fresnel/pkg-descr new file mode 100644 index 000000000000..0b93f238e831 --- /dev/null +++ b/science/py-fresnel/pkg-descr @@ -0,0 +1,9 @@ +fresnel is a python library for path tracing publication quality +images of soft matter simulations in real time. The fastest render +performance is possible on NVIDIA GPUs using their OptiX ray tracing +engine. fresnel also supports multi-core CPUs using Intel's Embree ray +tracing kernels. Path tracing enables high quality global illumination +and advanced rendering effects controlled by intuitive parameters +(like roughness, specular, and metal). + +WWW: https://github.com/glotzerlab/fresnel diff --git a/science/py-fresnel/pkg-plist b/science/py-fresnel/pkg-plist new file mode 100644 index 000000000000..09ef36e04193 --- /dev/null +++ b/science/py-fresnel/pkg-plist @@ -0,0 +1,90 @@ +%%PYTHON_SITELIBDIR%%/fresnel/__init__.py +%%PYTHON_SITELIBDIR%%/fresnel/_common%%PYTHON_EXT_SUFFIX%%.so +%%PYTHON_SITELIBDIR%%/fresnel/_cpu%%PYTHON_EXT_SUFFIX%%.so +%%PYTHON_SITELIBDIR%%/fresnel/camera.py +%%PYTHON_SITELIBDIR%%/fresnel/color.py +%%PYTHON_SITELIBDIR%%/fresnel/conftest.py +%%PYTHON_SITELIBDIR%%/fresnel/geometry.py +%%PYTHON_SITELIBDIR%%/fresnel/interact.py +%%PYTHON_SITELIBDIR%%/fresnel/light.py +%%PYTHON_SITELIBDIR%%/fresnel/material.py +%%PYTHON_SITELIBDIR%%/fresnel/test/conftest.py +%%PYTHON_SITELIBDIR%%/fresnel/test/pytest.ini +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_f_stop.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_focal_distance.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_focal_length.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_height.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_pathtrace.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_camera_perspective.test_render.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_box_color.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_box_radius.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_color.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_radius.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render0.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render1.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render2.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render3.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render4.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_box.test_render5.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_clyinder.test_color.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_clyinder.test_outline.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_clyinder.test_position.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_clyinder.test_radius.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_clyinder.test_render.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_convex_polyhedron.test_face_color.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_convex_polyhedron.test_outline.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_convex_polyhedron.test_render.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_mesh.test_color_interp.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_mesh.test_multiple.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_mesh.test_outline.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_mesh.test_render.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_angle.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_color.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_outline.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_position.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_render.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_polygon.test_rounded.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_sphere.test_color.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_sphere.test_outline.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_sphere.test_position.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_sphere.test_radius.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_geometry_sphere.test_render.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_color.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_metal.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_primitive_color_mix.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_roughness.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_set_material.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_solid.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_material.test_specular.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_outline_material.test_color.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_outline_material.test_primitive_color_mix.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_outline_material.test_set_material.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_outline_material.test_solid.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_camera.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_light_dir.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_multiple_geometries1.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_multiple_geometries2.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_multiple_geometries3.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_scene.test_multiple_geometries4.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_tracer_direct.test_render.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_tracer_direct.test_render_aa.png +%%PYTHON_SITELIBDIR%%/fresnel/test/reference/test_tracer_path.test_render.png +%%PYTHON_SITELIBDIR%%/fresnel/test/test_camera_orthographic.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_camera_perspective.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_device.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_box.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_convex_polyhedron.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_cylinder.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_mesh.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_polygon.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_geometry_sphere.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_light.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_material.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_outline_material.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_scene.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_tracer_direct.py +%%PYTHON_SITELIBDIR%%/fresnel/test/test_tracer_path.py +%%PYTHON_SITELIBDIR%%/fresnel/tracer.py +%%PYTHON_SITELIBDIR%%/fresnel/util.py +%%PYTHON_SITELIBDIR%%/fresnel/version.py
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202201241713.20OHDd3x074153>