-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minkowski_sum has fatal bug for some special linestring and polygon #8551
Comments
Use an exact construction kernel.
____ _ ____ _
/_____/_) o /__________ __ //
(____ ( ( ( (_/ (_/-(-'_(/
_/
…On Wed, 16 Oct 2024 at 07:06, Garbage123King ***@***.***> wrote:
Issue Details
./main
CGAL version: 6.0.0
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: sl_iter != m_statusLine.end()
File:
/usr/local/include/CGAL/Surface_sweep_2/No_intersection_surface_sweep_2_impl.h
Line: 547
adopted
Source Code
// main.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/minkowski_sum_2.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/Polygon_with_holes_2.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Polygon_2 Polygon_2;
typedef CGAL::Polygon_with_holes_2 Polygon_with_holes_2;
int main() {
std::cout << "CGAL version: "
<< CGAL_VERSION_MAJOR << "."
<< CGAL_VERSION_MINOR << "."
<< CGAL_VERSION_PATCH << std::endl;
// Define a simple polygon (first geometry)
Polygon_2 P;
P.push_back(K::Point_2(824, 627));
P.push_back(K::Point_2(689, 555));
// Define another simple polygon (second geometry)
Polygon_2 Q;
Q.push_back(K::Point_2(130, 150));
Q.push_back(K::Point_2(20, 40));
Q.push_back(K::Point_2(50, 60));
Q.push_back(K::Point_2(125, 100));
// Compute Minkowski sum (correct type)
Polygon_with_holes_2 sum = CGAL::minkowski_sum_by_full_convolution_2(P, Q);
// Output result (just an example)
std::cout << "Minkowski sum computed successfully." << std::endl;
return 0;
}
Environment
- Operating system (Windows/Mac/Linux, 32/64 bits): Linux 64bits
- Compiler: g++ or MSVC
- Release or debug mode: debug mode raise error, release mode crush
- Specific flags used (if any):
- CGAL version: 6.0, or 5.6, or 5.0 all have problem
- Boost version: 1.71 or 1.73
- Other libraries versions if used (Eigen, TBB, etc.):
—
Reply to this email directly, view it on GitHub
<#8551>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVBNOFFN7ZZQWS26J3KCQTZ3XQ27AVCNFSM6AAAAABQAQRRNOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4TANJUGU4TINQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
it's the same after the changes
terminate called after throwing an instance of 'CGAL::Assertion_exception' |
P contains only 2 points so it's not a valid polygon. |
I don't know, but it's how SFCGAL use to calculate the minkowski_sum of linestring and polygon, it makes sense on math, and it works well with other linestrings and polygons. SFCGAL-v1.5.0/src/algorithm/minkowskiSum.cpp:
|
I believe I find it has problem with _convolution_cycle() in Minkowski_sum_conv_2.h before:
after:
|
fix issue CGAL#8551
Issue Details
./main
CGAL version: 6.0.0
terminate called after throwing an instance of 'CGAL::Assertion_exception'
what(): CGAL ERROR: assertion violation!
Expr: sl_iter != m_statusLine.end()
File: /usr/local/include/CGAL/Surface_sweep_2/No_intersection_surface_sweep_2_impl.h
Line: 547
adopted
Source Code
Environment
The text was updated successfully, but these errors were encountered: