
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
.. image:: https://img.shields.io/pypi/v/ncollpyde.svg :target: https://pypi.python.org/pypi/ncollpyde
.. image:: https://github.com/clbarnes/ncollpyde/workflows/.github/workflows/ci.yaml/badge.svg :target: https://github.com/clbarnes/ncollpyde/actions :alt: Actions Status
.. image:: https://readthedocs.org/projects/ncollpyde/badge/?version=latest :target: https://ncollpyde.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg :target: https://github.com/ambv/black
A python library for spatial queries of points and line segments with meshes. ncollpyde wraps around a subset of the parry rust library (formerly its predecessor ncollide).
pip install ncollpyde
Pre-built wheels are available for Linux, MacOS, and Windows. If you have a stable rust compiler, you should also be able to install from source.
This library implements most of its functionality through the Volume
class,
instantiated from an array of vertices,
and an array of triangles as indices into the vertex array.
.. code-block:: python
# get an array of vertices and triangles which refer to those points
import meshio
mesh = meshio.read("meshes/teapot.stl")
# use this library
from ncollpyde import Volume
volume = Volume(mesh.points, mesh.cells_dict["triangle"])
# or, for convenience
volume = Volume.from_meshio(mesh)
# containment checks: singular and multiple
assert [-2.30, -4.15, 1.90] in volume
assert np.array_equal(
volume.contains(
[
[-2.30, -4.15, 1.90],
[-0.35, -0.51, 7.61],
]
),
[True, False]
)
# line segment intersection
seg_idxs, intersections, is_backface = volume.intersections(
[[-10, -10, -10], [0, 0, 3], [10, 10, 10]],
[[0, 0, 3], [10, 10, 10], [20, 20, 20]],
)
assert np.array_equal(seg_idxs, [0, 1]) # idx 2 does not intersect
assert np.array_equal(seg_idxs, [0, 1])
assert np.allclose(
intersections,
[
[-2.23347309, -2.23347309, 0.09648498],
[ 3.36591285, 3.36591285, 5.356139],
],
)
assert np.array_equal(
is_backface,
[False, True],
)
# distance from boundary (negative means internal)
assert np.array_equal(
volume.distance([[10, 10, 10], [0, 0, 3]]),
[10.08592464, -2.99951118],
)
See the API docs for more advanced usage.
this issue <https://github.com/clbarnes/ncollpyde/issues/12>
_bug in the underlying library <https://github.com/rustsim/ncollide/issues/335>
_is_backface
result for ray intersection checksrust toolchain <https://www.rust-lang.org/tools/install>
_ncollpyde v0.11 was the last to support meshio < 4.0
.
Thanks to top users
Philipp Schlegel <https://github.com/schlegelp/>
_ (check out navis <https://github.com/navis-org/navis>
!)
and Nik Drummond <https://github.com/nikdrummond>
for their help in debugging and expanding ncollpyde
's functionality.
Thanks also to pyo3
/ maturin
developers
@konstin <https://github.com/konstin>
_
and @messense <https://github.com/messense/>
_
for taking an interest in the project and helping along the way.
FAQs
A python wrapper around a subset of the ncollide rust library
We found that ncollpyde demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.