Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Cython wrapper around sp4acerat's quadrics mesh reduction algorithm <https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification>
__.
Requirements:
- *Numpy*
- *Cython* (only for compilation, but not needed if installed from PyPI)
Installation :
pyfqmr can be installed via pip <https://pypi.org/project/pyfqmr/0.1.1/>
_ :
.. code:: bash
pip install pyfqmr
Compilation :
Run:
.. code:: bash
pip install .
Usage:
~~~~~~
.. code:: python
>>> # We assume you have a numpy based mesh processing software
>>> # Where you can get the vertices and faces of the mesh as numpy arrays.
>>> # For example Trimesh or meshio
>>> import pyfqmr
>>> import trimesh as tr
>>> bunny = tr.load_mesh('example/Stanford_Bunny_sample.stl')
>>> # Simplify object
>>> mesh_simplifier = pyfqmr.Simplify()
>>> mesh_simplifier.setMesh(bunny.vertices, bunny.faces)
>>> mesh_simplifier.simplify_mesh(target_count = 1000, aggressiveness=7, preserve_border=True, verbose=True)
>>> vertices, faces, normals = mesh_simplifier.getMesh()
>>>
>>> # To make verbose visible, use logging module :
>>> import logging
>>>
>>> # Configure the logger to show debug messages
>>> logging.basicConfig(level=logging.DEBUG)
>>> logger = logging.getLogger("pyfqmr")
>>>
>>> # Optionally, log to a file:
>>> # logging.basicConfig(filename='mesh_simplification.log', level=logging.DEBUG)
>>>
>>> # Now, when `simplify_mesh(verbose=True)` is called,
>>> # messages will appear in the console or the log file
Controlling the reduction algorithm
Parameters of the simplify\_mesh
method that can be tuned.
this issue <https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification/issues/14>
__.Controlling the lossless reduction algorithm
Parameters of the **`simplify\_mesh\_lossless`** method that can be tuned.
- **verbose**
Falg controlling verbosity
- **epsilon**
Maximal error after which a vertex is not deleted.
- **max\_iterations**
Maximum number of iterations.
- **preserve\_border**
Flag for preserving the vertices situated on open borders. Applies the method described in `this issue <https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification/issues/14>`__.
Note
~~~~
- The **`simplify\_mesh\_lossless`** method is different from the **`simplify\_mesh`** method with the lossless flag enabled, and should be prefered when quality is the aim and not a precise number of target triangles.
- Tests have shown that the **threshold\_lossless** argument has little to no influence on the reduction of the meshes.
Implications of the parameters for the threshold growth rate :
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
(``simplify_mesh()`` method when not in lossless mode)
$$threshold = alpha \* (iteration + K)^{agressiveness}$$
More information is to be found on Sp4cerat's repository :
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
`Fast-Quadric-Mesh-Simplification <https://github.com/sp4cerat/Fast-Quadric-Mesh-Simplification>`__
Huge thanks to Sp4cerat for making his code available!
FAQs
cython wrapper around C++ library for fast triangular mesh reduction
We found that pyfqmr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.