-
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
Install without conda #23
Comments
Yeah, you should be able to install it without conda, but you'll need to install embree seprately and then point pip/setup.py install to the location you installed embree at |
@shuocao818 go into the just modify your |
Thank you so much! |
For whatever it's worth we install pyembree/embree 2.17.7 on the
|
After changing to
-----edit------- |
@yehDilBeparwah but since you were linking to the embree v2.17.7 the folder |
I installed it by going to |
@ttsesm @Shivin302 @yeDilBeparwah @mikedh I am trying to install System: Windows 10 x64, Build 1909, Python 3.8.10
However, no matter what, I get the following output:
Any ideas what I'm doing wrong? |
Is part of my issue that I'm using Embree 3 and not Embree 2? |
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() |
After a while of struggling with installing pyembree on Windows, I found this instruction more straightforward and included only the necessary steps to install the package.
|
Hi, is it possible to install pyembree without using conda?
I tried python setup.py install and also I set the include path of my embree in the setup.py like this
include_path = [np.get_include(),"C:\python36\Lib\site-packages\embree-2.14.0.x64.windows\include"]
but I got an error: fatal error LNK1181: cannot open input file 'embree.lib'
so I am wondering whether conda is the only way to install it. Thanks!
The text was updated successfully, but these errors were encountered: