All Questions
9
questions
1
vote
1
answer
499
views
Create normals from triangulated surface
Objective
I have a 3D face mesh triangulated. I have computed the midpoint of each triangle in the mesh, and I have the normal vector (n1, n2,n3) for each triangle. The objective is to create a 2D ...
6
votes
1
answer
931
views
Choosing evenly distributed points from a million points on a sphere
I have \$10^5\$ to \$10^6\$ points on a sphere, and want to choose some points from them which are as close as uniformly distributed as possible. For that reason, I do the following: at each step I ...
3
votes
2
answers
116
views
Cythonized Sutherland-Hogman algorithm
I want to cythonise the python implementation of the Sutherland-Hogman algorithm. This algorithm updates a list of vertices according to pretty simple rules (being inside or outside an edge, etc.) but ...
7
votes
1
answer
3k
views
4-Bar Mechanism Generation
For a school project, I will design and prototype a bicycle brake that uses a four-bar linkage to accomplish its goal.
My Python 3 code does this mechanism generation, and implements methods to ...
4
votes
1
answer
262
views
Calculating the distance squared between all vertex-pairs of a number of 2D polygons
I have implemented my code using Cython. It is the current bottleneck in my computations.
There are two non-numpy functions involved:
calculate_2D_dist_squared ...
2
votes
1
answer
359
views
Neighbours from point connections
I am working with a mesh of triangles (in 3D, although I doubt it makes a difference). The mesh is given as list of lists, each list containing the indices of the three vertices of a triangle in said ...
4
votes
2
answers
5k
views
Calculating if a point is within a polygon, or outside of it
Here is the function (along with its support functions):
...
7
votes
1
answer
4k
views
Calculating "element-wise" the angles between two lists of vectors
Let's say you have two lists of vectors:
v1s = [a, b, c]
v2s = [d, e, f]
I am interested in generating the following result:...
14
votes
1
answer
10k
views
Faster computation of barycentric coordinates for many points
I'm just starting to understand the Python syntax and I created a module that does what I wanted, but really slow.
Here are the stats of cProfile, top 10 ordered by ...