Questions tagged [numpy]

A python library adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays

Filter by
Sorted by
Tagged with
0 votes
1 answer
63 views

Numpy array to openvdb conversion returns a shuffled volume

I have a 3d numpy array containing results from a simulation which I want to render using Blender. When visualized using napari I get the expected result: Using ...
Tom Aubier's user avatar
1 vote
1 answer
114 views

How do I get a "correct" isosurface from points to volume to mesh workflow?

I am a computational chemist, looking to visualize an electron density in blender. The density is basically a 3D-array with a value assigned to each point. I managed to load the density to blender, ...
Hendrik's user avatar
  • 41
0 votes
0 answers
165 views

How to set the camera distortion by script?

I have: A 3D point cloud indoor scene; camera_poses.npy: records the camera pose changes, e.g. (x,y,z,qx,qy,qz,qw) camera_info.txt: stores the parameters of the real camera, the contents are as ...
Dongze Yang's user avatar
3 votes
1 answer
200 views

vertex positional difference alternative using numpy

I have a function looking at a difference in vertex positions, and storing that difference on a third mesh - ...
dan283's user avatar
  • 259
0 votes
0 answers
213 views

How to fix "numpy.core._multiarray_umath is not found"?

I am not able to load the addons Construction Lines and Precision Drawing Tools because "numpy.core._multiarray_umath is not found". I saw that similar questions has been asked but I found ...
c4nier's user avatar
  • 1
1 vote
0 answers
143 views

Faster way to get selection bounding boxes

I'm trying to get the bounding box coordinates of certain groups of faces. I am running this in a frame update so I'm trying to squeeze out as much performance as possible. I use the result of the ...
Stijn's user avatar
  • 11
0 votes
1 answer
41 views

matrix_world is transposed silently under the hood? Why?

I'm setting the matrix_world property of an object (from a numpy array) and I discovered that: The last column (translation) is not set. The matrix appears ...
Sergio's user avatar
  • 123
1 vote
1 answer
2k views

Calculate the distance for every entry of 2 lists with x y z 3D coordinates using python

I have two numpy lists with 3D coordinates of vertecies of two meshes. These lists are of unequal length. I would like to calculate the 3D distance between every coordinate in arrayA and arrayB. ...
TheAliw1's user avatar
1 vote
2 answers
927 views

Python: Get Polygons Vertex Indices with Numpy

I get polygons instances with a simple python list but it's really interesting how I could get these instances with Numpy as it should be faster. ...
mifth's user avatar
  • 2,341
1 vote
1 answer
792 views

What is the fastest way to set global vertices coordinates to a numpy array using bpy?

The fastest way I know to get the vertices coordinates from the mesh is to use .foreach_get() method: ...
Andrey Sokolov's user avatar
1 vote
2 answers
134 views

If there is any way in Blender I can use a mathematical formula to control particle density?

I'm trying to visualize something in physics. I have a formula that determines the density of particles at each point in 3D space. How can I visualize this? For example: density=1/r^2
Shaun's user avatar
  • 11
0 votes
0 answers
300 views

how to get origin of an stl file , from ascii stl file

I have a stl file, content as usual ...
aryan singh's user avatar
3 votes
1 answer
972 views

How to Convert Image to numpy array, then convert it back to image by script

I know this can be done with matplotlib or PIL, but I need it to be done in blender, without installing any other package. I searched and tried following code in blender, but only get a black image as ...
butaixianran's user avatar
5 votes
1 answer
1k views

How to use the Anaconda environment on blender at linux?

I'm having problems to use some modes like numpy and pandas on blender, apparently the blender's python do not allow us to install packages using pip; so I thought that I could resolve this issue ...
mack_hyuuga's user avatar
1 vote
1 answer
137 views

How can I add many keyframes for an object without a loop? [duplicate]

...
Carl's user avatar
  • 23
7 votes
2 answers
538 views

Fastest way to skin a grid

Having recently answered a question re the Z surface math function, from the add mesh extras addon, made me get back to coding same via numpy for instance with a ...
batFINGER's user avatar
  • 84k
0 votes
1 answer
853 views

Apply texture from numpy array

I am new to blender. I have an obj file that contains UV mapping information [extracted using smart UV project]. I have a code that generates random textures as a NumPy array [say 512 x 512 x 3]. I ...
Dharma's user avatar
  • 101
3 votes
1 answer
553 views

Numpy / lidar point-cloud to mesh: How to separate polygons?

I have lidar data in numpy structured array with x,y,z and other lidar specifics that I can use to colourize and display. I have got pretty far on the numpy side for filtering the points down (near, ...
Enger Bewza's user avatar
2 votes
2 answers
126 views

Animation Nodes Loop Input performance issue with large 3d vectors numpy arrays

I am working on scientific visualizations involving huge arrays of 3d vectors, sometimes 100k or sometimes even millions of vectors. I quickly ran into performance related issues, mostly when needing ...
radoo's user avatar
  • 345
4 votes
2 answers
1k views

Fastest way copying from bgl.Buffer() to numpy array

I have some rendered or processed pixel data in a bgl.Buffer() object and need it in a numpy array but that proccess seems to take very long. Here is what I have tried so far: ...
Gottfried Hofmann's user avatar
1 vote
0 answers
133 views

Python: Which numpy float type is better for Blender?

I've been working on addons for blender (modeling, sculpting). I use millions of vertex positions/normals through Numpy. Which Float Type is better for Blender? float16, float32, float64? What type of ...
mifth's user avatar
  • 2,341
5 votes
1 answer
2k views

Python : Custom Attribute for Vertices

I want to store custom Vector attribute for each vertex (custom vertex positions). I want to get it through numpy as I have millions of vertices: ...
mifth's user avatar
  • 2,341
8 votes
1 answer
205 views

Numpy optimise mesh edges length calculation

To improve my very rudimentary numpy knowledge am going to ask a number of optimise my numpy questions here on BSE Can find the length of each edge in a mesh using ...
batFINGER's user avatar
  • 84k
2 votes
1 answer
2k views

Create curve from Numpy Array using Python

I have looked through previous questions on this and many other boards and I cannot seem to find a previous answer. I have a largish Numpy generated ndarray that represents a harmonograph output (...
Terela02's user avatar
15 votes
4 answers
3k views

Replace matrix @ vector list comprehensions with something more efficient

I'm looking to replace list comprehensions like the following with something more efficient and I was wondering if numpy can be used. ...
MACHIN3's user avatar
  • 797