Questions tagged [geometry]
Data structures and algorithms related to geometry.
12,175
questions
0
votes
1
answer
24
views
How to delete duplicate rows in Oracle with the same geometry
There is a table that includes points and their geometry, and I want to delete duplicate rows based on the geometry column. Here is the code:
DELETE FROM NODE
WHERE rowid not in
(SELECT MIN(rowid)
...
0
votes
2
answers
30
views
Draw a circular arrow with rounded ends in CSS
How can I draw a circular arrow with rounded ends in CSS?
Inside the circular arrow some dynamic text will be placed, but the issue is to draw the arrow.
Something like this:
Till now the only idea ...
0
votes
1
answer
30
views
Scale intersecting circles fixed at pivots so that they have only one point in common
Given two points, A and B; Given two circles, having 2 points in common, I1 and I2:
one circle at center C1, with radius r1, with the point A on to it
and another circle at center C2, with radius r2, ...
0
votes
0
answers
9
views
Convert MultiLineString Geometry to LineString in Pandas dataframe
I have a dataframe in which geormtry column is MultiLineString. I need to convert it to LineString to use it in networkx. I used the following code from this question to work with shapefile. But I do ...
0
votes
0
answers
9
views
How can you use RD coordinates instead of gps coordinates to plot traffic routes in a folium plot?
In want to show traffic routes on a folium map. These routes are in the Netherlands and the coordinates are in RD (EPSG:28992). I tried to map the routes using the following code:
my_map = folium.Map(...
0
votes
0
answers
16
views
Filling a matrix with a colour gradient pattern according to diamond geometry
Context
Suppose I have a square ABCD within which I have the geometry EFGH, where the lines EF and GH are on the sides AB and CD:
And I would like to add a colour pattern like near vertical beam ...
0
votes
0
answers
11
views
Python: Pixel to 3D point projection unexplained offset
I am trying to project two points from a 2D image into 3D points to create a bounding box and I have used the methods described in this article:
https://towardsdatascience.com/inverse-projection-...
1
vote
1
answer
28
views
how to create an arc path from 3 points(x, y, z) in plane?
I want to create an arc trajectory cross over n=3 points P(n)=(x, y, z), I decided to draw a circle over 3 points in plane. so I have center, radius, theta (angle in x, y plane) and phi(angle around z ...
0
votes
1
answer
32
views
Subdivide lagrange interpolated curve
I'm looking for a way to subdivide a curve, generated by Lagrange interpolation.
Let's say I have a curve defined by c1,c2,c3 control points, and I want to divide it somewhere between c1 and c2 with ...
0
votes
1
answer
40
views
find best size for rectangles to fit into square [duplicate]
I have n 19:10 rectangles, which I can resize. I want to fit all n into a 8000x8000 square.
What's the largest size the rectangles can have? And how should they be distributed?
For example, n = 2 ...
1
vote
2
answers
38
views
Optimized algorithm to check if a line segment is covered by a list of polygons
This problem was solved using the sympy library, however, I believe my solution is not optimal and I am looking for a better algorithm. Answers that utilize better data structures than the ones I have ...
0
votes
0
answers
13
views
How to calculate distance between two lat/long coordinates in Java using JTS?
I have two coordinates with latitude and longitude, and I want to calculated the distance between them in meters/miles. Does the vividsolutions JTS library have the functionality to do this? If there ...
0
votes
0
answers
18
views
How to create a curved line vector plot of a triangle in Python?
Question
Suppose one has 3 random coordinates with 3 random functions that describe the continuous lines between them*, how would one create a vector plot in Python that allows for smooth lines after ...
0
votes
0
answers
27
views
Python - Find fewest number of rectangles that enclose a list of rectanges (while avoiding others)
I have lists of coordinates for "good" rectangles and "bad" rectangles. Rectangles may or may not be adjacent to others from either list, but will never overlap. I need to generate ...
0
votes
1
answer
18
views
How is it possible to create a circle in CSS that always keeps the same size?
I have the problem that I have a circle that adjusts according to the content of the text. However, I would like the font size to adjust to the circle and not have the circle change size.
How is it ...
0
votes
0
answers
8
views
Convert a set of overlapping cuiboids to a minumum set of non-overlapping cuiboids
I am trying to decompose an overlapping set of cuboids to non-overlapping ones, the fewer non-overlapping cuboids used the better.
For example, in the case below:
There are three overlapping cuboids, ...
1
vote
2
answers
19
views
How to draw circles of defined radius around multiple points and export to kml file
I have a set of points saved with their respective latitude and longitude in a data frame like this:
points = data.frame(point_id = 1:3,
lat = c("51.7505","51.7502",...
0
votes
0
answers
19
views
Is there a cleaner / simpler way to calculate the edge in a geometry that a line crosses?
In the code below it is fairly simple to check does the line cross into the geometry or not - it's also trivial to work out the coordinate that the line crosses into the geometry at. However (and I'...
0
votes
2
answers
28
views
Count number of polygons within a polyline
I have a collection of vertices that have been drawn sequentially by a user and I need to count how many enclosed areas there are within this shape.
I have managed to find the intersecting points of ...
2
votes
1
answer
42
views
center of mass in each cell of N-dimensional rectilinear grid
I have an n-Dimensional rectilinear grid, such that the edges in each dimension i are given by x_i = {x[i, 0], x[i,1], ..., x[i, Ni-1], x[i, Ni]}, with N_i edges in that dimension. I then have some ...
0
votes
0
answers
6
views
How the browser parses the geometry in the mapillary.js detection request?
Mapillary (V4) API provides two surfaces for interacting with the data: vector tiles and entity endpoints. I want to parse the geometry in the detection request into a readable format.
I have ...
0
votes
0
answers
20
views
Printing multiple circles in a bitmap using canvas in android studio
I am trying to make a seven segment display OCR that detects its number
Im going to connect this app to esp32cam i have a webview where I am trying to get the picture from the esp32cam
I then get a ...
0
votes
1
answer
20
views
How do I model circular motion around a point using only force vectors
I'm trying to mod a game, and the physics engine only allows me to apply a force to an object along a vector (It'd be hard to change the velocity or position directly). My goal is to have objects ...
2
votes
0
answers
24
views
Calculate LatLong of point at distance x,y metres from origin LatLong using Boost Geomtry
I'm using boost geometry (v1.75) to do forward and reverse coordinate transforms, this works Ok.
namespace bg = boost::geometry;
namespace bm = bg::model::d2;
bg::srs::projection<bg::srs::...
0
votes
0
answers
14
views
Finding 3D world coordinates from a single camera view. Have control points and assumes all points lie in a single plane (floor)
I'm needing to solve a problem where I have a plane in known 3D space (a court), and I know the coordinates of its corners (and other line intersections). I then have a 2D image of the court that I ...
-2
votes
0
answers
33
views
Performance problems using python for computational geometry
for my PhD studies I have to geometrically nest irregular polygons in irregular containers.
I use a No-Fit Polygon approach derived from the paper:
"Complete and robust no-fit polygon generation ...
-2
votes
1
answer
42
views
Need to know if a sphere intersects with cube using python code...?
I am developing a code in python to check whether a sphere having a center at (x, y, z) coordinates and with radius R, intersects the cube of dimension one, i.e., l = 1, b = 1, h = 1. As mentioned ...
1
vote
1
answer
51
views
Check if a point is inside an arbitrary hexahedron
I am working on a 3D finite element code, where i face the following problem:
If I take an arbitrary point (say x), how do I figure out, which element it is in?
This can be simplified to: How do I ...
1
vote
1
answer
40
views
Test for coplanar points, and comparing best planar fit of many sets of points?
Perhaps best asked in three parts:
Given five not necessarily coplanar points (in 3 dimensions), what is a good measure of how close to coplanar they are?
Given another set of five not necessarily ...
1
vote
2
answers
68
views
How to make a wavy, symmetric circle in WebGL?
I'm trying to develop a shader where I can modulate the the number of curves on a circle, but I'm having an issue in that it is not symmetric. That is, while I can increase the waviness of the circle, ...
0
votes
0
answers
15
views
The circle animation is not displayed with the following code in anaconda spyder. Why?
The circle animation is not displayed with the following code in anaconda spyder. Why?
The code is given below.
from matplotlib import pyplot as plt
from matplotlib import animation
def create_circle(...
0
votes
0
answers
11
views
Change output to degrees from radians [duplicate]
I'm currently creating a calculator that finds the side lengths and angles of a triangle. But Python is calculating it in radians (not just angles). For example, the below is an excerpt of code that ...
2
votes
1
answer
48
views
Finding closest pair of points in the plane with non-distinct x-coordinates in O(nlogn)
Most of the implementations of the algorithm to find the closest pair of points in the plane that I've seen online have one of two deficiencies: either they fail to meet an O(nlogn) runtime, or they ...
0
votes
1
answer
28
views
Multi-part geometries: Get line & part number when extracting parts (via SDO_UTIL.EXTRACT_ALL)
I have multi-part SDO_GEOMETRIES in Oracle 18c.
I can extract the parts as individual rows using the SDO_UTIL.EXTRACT_ALL() function:
with cte as (
--Each part is wrapped in brackets and separated by ...
1
vote
0
answers
51
views
How to prevent WebGL from clipping outside bounds when drawing a wavy circle?
I have a shader that draws a bunch of instanced circles, and it works great! It works by basically drawing a bunch of rectangles at every given location, and then in the fragment shader it effectively ...
0
votes
1
answer
47
views
get 16 equidistant points along the circumference of ellipse
I am trying to get the 16 equidistant point on ellipse (equal arc length along the ellipse).
Using some research, I am able to get the angle from which I can get those point by drawing a straight line ...
1
vote
2
answers
83
views
How to find nearest points between two contours in OpenCV
For two contours c1 and c2, How do I find the nearest points between the contours.
A solution could be to iterate over all the points, get euclidian distance and go with the minimum euclidian distance ...
-1
votes
0
answers
28
views
Get polygon points in percentages using javascript
I need to create a javascript function that will return me the points of a convex polygon of the amount of sides I give it. The problem is that I want the value in percentages. For example:
If I ...
0
votes
1
answer
39
views
Is there a similarity measure to compare two segmented linear segments?
I am searching for a way to evaluate the similarity between two segmented linear segments.
To make things clear, consider the illustration below:
Scanline 1 is very similar to the Template (in fact ...
0
votes
0
answers
19
views
Epipolar plane images from a light field image using Python
I am trying to extract 2 epipolar plane images (horizontal and vertical) with Python, from a light field camera image, also known as a plenoptic image. The plenoptic image has 11x11 directional ...
0
votes
0
answers
23
views
How to output valid lat-long GeoJSON from WKB using django.gis.geos.GEOSGeomety?
I have a database that has geometry attributes in the WKB format:
010400000001000000010100000035553113AC38F64062B44D0A97951A41
I am using django.gis.geos GEOSGeometry in order to get the MultiPoint ...
0
votes
0
answers
24
views
Isolation of points inside two different polygons by time (looking at activity from one polygon to the next)
I have a series of points and have been able to isolate the points that are visible in two polygons ignoring all the points outside of these two polygons. However what I now need to achieve is to ...
0
votes
0
answers
41
views
Rotating from one quarternion to another
Ok so this question might be a little complicated
Basically I have an imu off which I am able to read quartenions, I want to be able to set a quarternion as home, and then from any other quarternion i ...
5
votes
3
answers
157
views
How to stretch a line to fit image with Python OpenCV?
I have an image with the size of W * H, I want to draw a line on this and the line should be automatically fit to the image,
for example if I draw it:
I want this:
How can I do this in Python and ...
0
votes
1
answer
25
views
How to show a part of the circle using custom painter?
So I have this card widget to create
how can I create the golden part of the circle using custom painter?.I can create a full circle but how can I just display that small part of the circle and hide ...
0
votes
0
answers
54
views
Trying to export sf dataframe to .csv file in R with st_write
I have a sf dataframe which has geometry column looking like this:
geometry
list(list(c(53252.151421, 421516.3252...
list(list(c(53252.151421, 421516.3252...
list(list(c(53252.151421, 421516....
0
votes
0
answers
17
views
algorithm for filling shape A with shape B
I have been asked for giving an efficient algorithm for filling shape A with shape(s) B. For example, given a triangle, suggest an efficient algorithm for filling it with circles, so that we will get ...
0
votes
0
answers
20
views
Mysql how to insert polygon
I need to keep data about certain polygons in my MySql db. This is what I've tried:
SET @g = 'POLYGON((-74.13591384887695 40.93750722242824,-74.13522720336914
40.929726129575016,-74.15102005004883 40....
0
votes
0
answers
52
views
Using python to calculate 3d points in a plane from a 2D image, having some known locations on the 2D image (homography?)
I'm needing to solve a problem where I have a plane in known 3D space (a court), and I know the coordinates of its corners (and other line intersections). I then have a 2D image of the court that I ...
0
votes
2
answers
46
views
Algorithm for drawing profiles using long thin rectangles
I want to draw profiles similar to the ones at https://steeldoor.org like:
programmatically. (Probably in FreeSCAD, but possibly Python).
I want to define a global thickness and then specify the ...