-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not Found "embree2/rtcore.h" #25
Comments
Can you please provide more information on how you tried to install pyembree? |
Chinese meaning means files and folders can not be found |
That means you need to download and install embree, which is a dependency of embree. |
Is a dependency of embree downloaded from https://www.embree.org/downloads.html? In additional, C language is used for this dependency . What do I need to pay attention to when installing this dependency? Is there a detailed installation procedure? |
The short answer is yes, you will need a C compiler. Sorry I don't have the time right now to properly answer your question in full. If you would like to use a precompiled version, I recommend that you use conda and install the pyembree package from conda-forge |
Running into this issue as well. Turns out the current release at https://github.com/embree/embree/releases/ is version 3, and |
Specifically, you'll want to install https://github.com/embree/embree/releases/tag/v2.17.7 |
Yeah, I really disagree with the PyPI model, but if someone wanted to PR wheel building to the rever.xsh script, I would merge it. |
Strangely, I've been able to build I'm attaching the wheel here (zipped due to github), but I'd like to know if it's actually functioning as expected. @Pursur, could you take a look at this? |
Thanks vary much, I hava install this library by directly copying the folder named embree2 in Embree v2 to the pyembree-master folder . However, I don't know if it's the right thing to do. Your method is also successfully achieved in my environment that the operation system is Ubuntu18.04 ,python version is 3.7 |
Thanks @Pursur. I'm curious why the wheel works without having the
While I appreciate your sentiment regarding PyPI, I like the flexibility of being able to use system python without resorting to anaconda for multi-platform Python development. Though, admittedly part of that comes with being somewhat unfamiliar with conda packages. I'd actually recommend building via GitHub Actions or using Azure pipelines as this allows for multi-platform automated development. It takes a bit to get setup, but once it's done automating package creation and deployment is quite straightforward. |
Yeah, to be fair, I don't use anaconda either. I use conda and conda-forge. |
@scopatz and @akaszynski I'm also struggling to install |
Installation InstructionsTested on:OS: Windows 10 x64 Professional, Build 1909 Steps
cd C:\vcpkg
git clone https://github.com/Microsoft/vcpkg.git
bootstrap-vcpkg.bat
vcpkg integrate install Alternatively, you can download and install the embree-2.17.7.x64.msi Installer on Embree's GitHub page (to learn more about Embree, visit their website).
vcpkg install embree2:x64-windows
py -m pip install numpy cython wheel setuptools pyvista pykdtree rtree trimesh
git clone https://github.com/scopatz/pyembree.git and remove the underlying
import os
from setuptools import find_packages, setup
import numpy as np
from Cython.Build import cythonize
from Cython.Distutils import build_ext
include_path = [
np.get_include(),
]
ext_modules = cythonize("pyembree/*.pyx", language_level=3, include_path=include_path)
for ext in ext_modules:
ext.include_dirs = include_path
ext.libraries = [
"pyembree/embree2/lib/embree",
"pyembree/embree2/lib/tbb",
"pyembree/embree2/lib/tbbmalloc",
]
setup(
name="pyembree",
version="0.1.6",
cmdclass={"build_ext": build_ext},
ext_modules=ext_modules,
zip_safe=False,
packages=find_packages(),
include_package_data=True,
package_data={"pyembree": ["*.cpp", "*.dll"]},
)
and dynamic libraries
# distutils: language=c++ and change every relative import of an cimport rtcore as rtc to cimport pyembree.rtcore as rtc
>>> import pyembree
>>> from pyembree import rtcore_scene
>>> If you get no errors, then
The
import numpy as np
from pykdtree.kdtree import KDTree
import pyvista as pv
from pyvista import examples
# Load data
data = examples.load_random_hills()
data.translate((10, 10, 10))
# Create triangular plane (vertices [10, 0, 0], [0, 10, 0], [0, 0, 10])
size = 10
vertices = np.array([[size, 0, 0], [0, size, 0], [0, 0, size]])
face = np.array([3, 0, 1, 2])
planes = pv.PolyData(vertices, face)
# Subdivide plane so we have multiple points to project to
planes = planes.subdivide(8)
# Get origins and normals
origins = planes.cell_centers().points
normals = planes.compute_normals(cell_normals=True, point_normals=False)["Normals"]
# Vectorized Ray trace
points, pt_inds, cell_inds = data.multi_ray_trace(
origins, normals
) # Must have rtree, trimesh, and pyembree installed
# Filter based on distance threshold, if desired (mimics VTK ray_trace behavior)
# threshold = 10 # Some threshold distance
# distances = np.linalg.norm(origins[inds] - points, ord=2, axis=1)
# inds = inds[distances <= threshold]
tree = KDTree(data.points.astype(np.double))
_, data_inds = tree.query(points)
elevations = data.point_arrays["Elevation"][data_inds]
# Mask points on planes
planes.cell_arrays["Elevation"] = np.zeros((planes.n_cells,))
planes.cell_arrays["Elevation"][pt_inds] = elevations
planes.set_active_scalars("Elevation") # Probably not necessary, but just in case
# Create axes
axis_length = 20
tip_length = 0.25 / axis_length * 3
tip_radius = 0.1 / axis_length * 3
shaft_radius = 0.05 / axis_length * 3
x_axis = pv.Arrow(
direction=(axis_length, 0, 0),
tip_length=tip_length,
tip_radius=tip_radius,
shaft_radius=shaft_radius,
scale="auto",
)
y_axis = pv.Arrow(
direction=(0, axis_length, 0),
tip_length=tip_length,
tip_radius=tip_radius,
shaft_radius=shaft_radius,
scale="auto",
)
z_axis = pv.Arrow(
direction=(0, 0, axis_length),
tip_length=tip_length,
tip_radius=tip_radius,
shaft_radius=shaft_radius,
scale="auto",
)
x_label = pv.PolyData([axis_length, 0, 0])
y_label = pv.PolyData([0, axis_length, 0])
z_label = pv.PolyData([0, 0, axis_length])
x_label.point_arrays["label"] = [
"x",
]
y_label.point_arrays["label"] = [
"y",
]
z_label.point_arrays["label"] = [
"z",
]
# Plot results
p = pv.Plotter()
p.add_mesh(x_axis, color="r")
p.add_point_labels(x_label, "label", show_points=False, font_size=24)
p.add_mesh(y_axis, color="r")
p.add_point_labels(y_label, "label", show_points=False, font_size=24)
p.add_mesh(z_axis, color="r")
p.add_point_labels(z_label, "label", show_points=False, font_size=24)
p.add_mesh(data)
p.add_mesh(planes)
p.show() |
@scopatz Why do you disagree with the PyPI model? I'm curious and would like to learn. |
|
Hi, I need to use this lib for my research. There is a fatal error to say“ ‘embree2/rtcore.h’ file was not found”? How do I install this lib?
The text was updated successfully, but these errors were encountered: