Questions tagged [line-segment]
90 questions
1
vote
3 answers
Merging multiple line segments
My program uses PyOpenGL (so it's Python) with psyco.
I have around 21,000 line segments which I need to render in each frame of my render (unless the user zooms in, in which case line segments are culled and not sent to the card at all). This is…

Matthew Iselin
- 10,400
- 4
- 51
- 62
1
vote
2 answers
Gaps Between Rectangles Connected at the Center
I'm experimenting with a vector based graphics style with objects represented as series of line segments with a given width(it would probably be easier to think of these as rectangles). The problem is that these segments are connected at the center…

Henry Conklin
- 33
- 4
1
vote
3 answers
How can I find the middle points of x, y of a line segment in a binary image?
I have some damaged line segments in a binary image and I need to fix them (make them straight and at their original thick). In order to do that I have to find the middle points of the segment, so when I check the neighborhood to find the thickness…

Aris Malidis
- 11
- 2
1
vote
1 answer
Find the slice cut by a line segment, an origin point on a 3D polygon
I have an array of triangle vertices (faces of the polygon), something like
[[[a, b, c], [d, e, f], [g, h, i]], ...]
I have a line segment, represented by 2 3D vertices, let's say [[j, k, l], [m, n, o]].
And I have a point [p, q, r].
What I want to…

Dogbert
- 212,659
- 41
- 396
- 397
1
vote
1 answer
Speeding up segment/set of segment intersection
Suppose you have a set of segments in R^2 (call it S). Every segment is contained in a box of dimension WxH (so, the set S has four additional segments, one for each side of the box) and a segment s to be addedd to S. The segment s starts from point…

Marco Masci
- 818
- 10
- 22
0
votes
2 answers
Identifying Rectangles from a Large Set of Line Segments in Python
Hello StackOverflow community!
I am currently facing a challenge in detecting rotated rectangles that can be formed from a given set of line segments. With a total of approximately 5000 line segments, the performance becomes a significant…

Nguyễn Anh Bình
- 158
- 4
0
votes
0 answers
BinaryDescriptor in Python/OpenCV
My goal is to implement the tutorial as below.
https://docs.opencv.org/4.7.0/df/dfa/tutorial_line_descriptor_main.html
I found BinaryDescriptor in OpenCV/Python.
https://docs.opencv.org/4.x/dc/ddd/group__line__descriptor.html
I tried to use it, but…

Yuri Soeda
- 1
- 3
0
votes
1 answer
How to realize the conversion animation of two LineSegments in Three.js
I have a model, which is composed of LineSegments. Then this model has two states. I know the coordinates of the points of these two states. How can I realize the animation of these two state transitions in Three.js?
any demo or guidece both are…

Neil
- 25
- 4
0
votes
2 answers
How to move the end points of a line to keep its length but make it parallel to another line (C# preferably!)
I have a line segment whose end points I know
Line1 (X1,Y1) (X2,Y2)
I have a second line
Line2 (X3,Y3) (X4,Y4)
I want to calculate new end points for line 1 such that the resulting line is parallel to Line2, and Line1's centre point remains at the…

Maxxx
- 3,575
- 1
- 19
- 18
0
votes
1 answer
Find closest point to each line segment and expand/shrink the network graph - Python
I have two separate lists of points and line segments. Each point represents a weather station in a geographical region (e.g., in a state) given by its longitude and latitude. Example data…

bsha
- 1
- 3
0
votes
0 answers
How to enable tooltip for line segment in Line Chart with Chart.js
I am able to configure the line chart tooltip when I hover over the datapoint. However, I would also like to show some data if hover is over the line segment between two data points.
Code I am using is as follows :
callbacks: {
…

hardik
- 23
- 4
0
votes
0 answers
How to attribute intersection points between poly and lineseg to poly
I'm trying to plot an animal's trajectory from a set of coordinates as a line segment. I want to see how many coordinates are plotted inside a circular zone vs outside. I think that coordinates which intersect with the circle are being counted as…

lara202
- 11
- 1
0
votes
1 answer
Is there an efficient way to find the nearest line segment to a point in 3 dimensions in python?
I have a point in 3D
p = [0,1,0]
and a list of line segments defined by their starting and ending co-ordinates.
line_starts = [[1,1,1], [2,2,2], [3,3,3]]
line_ends = [[5,1,3], [3,2,1], [3, 1, 1]]
I tried adapting the first two algorithms…

Realhermit
- 415
- 3
- 9
0
votes
1 answer
How to find where two line segments intersect programmatically
Suppose you have the following positive coordinate region below:
In this region we have a rectangle that represents a computer window. As you can see there are also line segments covering the region. I am attempting to try and solve a problem in…

ParkerHarrelson123
- 49
- 1
- 7
0
votes
1 answer
How do you find the location of loops in a polyline?
I would like to detect the location (i.e. the polygon) that describes loops in a polyline. For example the following polyline has 3 loops.
I had code to determine if two line-segments intersect but would like to find the region that corresponds to…

nickponline
- 25,354
- 32
- 99
- 167