You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using CPML's cpml.intersect.segment_segment for finding road intersections in my Minetest mod and I noticed that CPML fails to find intersections for some of them. I compared CPML output with mlib's mlib.segment.getIntersection for the data and mlib finds them correctly.
Data for which CPML fails but mlib works:
Case 1
Seg1: {
{
y = -32,
z = 97,
x = 448
},
{
y = -32,
z = 13,
x = 532
}
}
Seg2: {
{
y = -32,
z = -12,
x = 524
},
{
y = -32,
z = 208,
x = 524
}
}
mlib: {
y = -32,
z = 21,
x = 524
}
CPML: nil
Case 2
Seg1: {
{
y = -32,
z = 290,
x = 688
},
{
y = -32,
z = 353,
x = 625
}
}
Seg2: {
{
y = -32,
z = 208,
x = 524
},
{
y = -32,
z = 331,
x = 647
}
}
mlib: {
y = -32,
z = 331,
x = 647
}
CPML: nil
Case 3
Seg1: {
{
y = -32,
z = 290,
x = 688
},
{
y = -32,
z = 353,
x = 625
}
}
Seg2: {
{
y = -32,
z = 331,
x = 647
},
{
y = -32,
z = 448,
x = 647
}
}
mlib: {
y = -32,
z = 331,
x = 647
}
CPML: nil
Case 4
Seg1: {
{
y = -32,
z = 928,
x = 489
},
{
y = -32,
z = 805,
x = 612
}
}
Seg2: {
{
y = -32,
z = 810,
x = 621
},
{
y = -32,
z = 810,
x = 448
}
}
mlib: {
y = -32,
z = 810,
x = 607
}
CPML: nil
The text was updated successfully, but these errors were encountered:
Okay, I did more tests and looks like cpml.intersect.line_line finds the intersection correctly but cpml.intersect.segment_segment fails. The reason behind this is that the latter function expects these segments to be component-wise min and max, which is totally weird because then cpml.intersect.line_line gets not the points of the segments but points with mixed components. Which is 1. incorrect 2. not documented anywhere.
I'll make a PR that fixes this soon, but I guess there are no buses in Gensokyo after all.
I'm using CPML's
cpml.intersect.segment_segment
for finding road intersections in my Minetest mod and I noticed that CPML fails to find intersections for some of them. I compared CPML output with mlib'smlib.segment.getIntersection
for the data and mlib finds them correctly.Data for which CPML fails but mlib works:
Case 1
Case 2
Case 3
Case 4
The text was updated successfully, but these errors were encountered: