All Questions
20 questions
1
vote
1
answer
508
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 ...
2
votes
2
answers
104
views
Sampling from k circles with different radii
Description: I would like to sample n_points points from k circles whose radii and centers are given as lists.
Note: This is my ...
1
vote
2
answers
273
views
Read coordinates from many files and calculate polygon areas
My goal with this snippet is to create an array of coordinates which in turn is a tuple of 68 elements, area and modified area array for all 10k elements and assign it to the ...
6
votes
1
answer
944
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 ...
7
votes
0
answers
5k
views
Cubic spline interpolation in Python from scratch
I implemented the cubic spline interpolation explained in
https://en.wikipedia.org/wiki/Spline_interpolation as a Python class. Of course, such an interpolation should exist already in some Python ...
6
votes
1
answer
591
views
Searching extreme points of polyhedron
In my Uni, my scientific professor asked me to make some researches about the extreme points of polyhedrals. And I did them. I found that there is still no code in public for searching extreme points ...
6
votes
1
answer
89
views
Optimal algorithm to move a a rope from one position to another
I'm an engineer working with a deformable membrane that is attached to actuators. The goal is to move the membrane from one shape to another, without ripping the membrane. This imposes "neighbor ...
4
votes
0
answers
718
views
Find the closest parametric values corresponding to a BSpline's control points
On a curve generated by scipy.interpolate.BSpline I want to find the closest
parameters relative to each control point, so that the given parametric range is ...
3
votes
2
answers
120
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 ...
5
votes
1
answer
5k
views
Applying Laplacian smoothing to vertices in a mesh
I'm totally new in Python and I wrote some code. It is a simple algorithm to smooth objects. I need to find adjacent vertices in mesh and sum their coordinates and after that divide by a number of ...
5
votes
1
answer
599
views
Clustering points on a sphere
I have written a short Python program which does the following: loads a large data file (\$10^9+\$ rows) where each row is a point on a sphere. The code then loads a pre-determined triangular grid on ...
14
votes
3
answers
15k
views
Generate sample coordinates inside a Polygon
I have a Polygon named as poly. I attempted to randomly select 5 coordinate points that lies inside the polygon.
...
4
votes
1
answer
266
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
362
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 ...