Closed tredecimguttatus closed 1 year ago
What version (or commit) of cavalier contours are you using? I was unable to trigger a debug assert from those inputs using the latest on master (commit: 08200b5b9856eb030266db0a57700830a39b3ff5).
Hello!
Thats interesting, i've checked asserts after using this scripts:
cd C:\
rd C:\cavalier_contours-master /s /q
git clone https://github.com/jbuckmccready/cavalier_contours cavalier_contours-master
cd C:\cavalier_contours-master
cargo build
cargo build --release
cbindgen --crate cavalier_contours_ffi --output cavc_ffi.h
and
xcopy "C:\cavalier_contours-master\target\release\*cavalier_contours*.*" /y
and
xcopy "C:\cavalier_contours-master\target\debug\*cavalier_contours*.*" /y
And expected that latest master will be used (checked manually, yes, i use latest)
Anyway, i took input data from my logs as intermediate result, i will check data separately, also i will check directories and dataflow more carefully tomorrow, thank you!
Here is how I tested inputs: Using web demo app: https://jbuckmccready.github.io/cavalier_contours_web_demo_page/#/pline_boolean
Then I use "COPY TEST CODE" button and run test under debug build in Rust.
Hello! Some intermediate info. In test mode i have same result as you - no assert failure. But in other part of source, same data (bit-wise) cause assert. May be some memory corrupted somehow... I will proceed with investigating, but now i see no difference.
Hello again! I think i got it. Could you please check this data:
{
"name": "source_a",
"isClosed": true,
"Area": 11.3862,
"vertexes": [
[71.4473518027978684585832525, 41.0152087808049046202540922, 0.0000000000000000000000000],
[75.0043418027978674444966600, 45.4614487808049076988936577, 1.0000000000000000000000000],
[74.0126381972021221145041636, 46.2548112191950977489796060, 0.0000000000000000000000000],
[70.4556481972021231285907561, 41.8085712191950946703400405, -0.2275911525975401472621229],
[68.9692099374071290185383987, 41.0950099999999949318407744, 0.9999999999999998889776975],
[68.9692100625928787849261425, 39.8250099999999989108800946, 0.2276528214201760380586137]
]
}
{
"name": "source_b",
"isClosed": true,
"Area": 9.39377,
"vertexes": [
[62.5700009923099855768668931, 39.8250000000007773337529215, 0.0000000000000000000000000],
[68.9692109923099962998094270, 39.8250100000007734024620731, 1.0000000000000000000000000],
[68.9692090076900115036551142, 41.0950099999992204402587959, 0.0000000000000000000000000],
[62.5699990076900149915672955, 41.0949999999992243715496443, 1.0000000000000000000000000]
]
}
Looks like i gave you wrong vector. sorry(
Best regards, Andrei Rodionov
And another assert with this dataset:
{
"name": "source_a",
"isClosed": true,
"Area": 1.52688,
"vertexes": [
[15.4607448447991053797068162, 20.4413532936729609446047107, 0.2839154127006927041954043],
[14.5489900000002716495828281, 18.9650995449645272117322747, 0.9999999999999998889776975],
[15.3109899999997285391373225, 18.9651004550354720379345963, -0.2839154127006926486842531],
[15.8019351552008942007887526, 19.7600067063270401490626682, 0.9999999999999998889776975]
]
}
{
"name": "source_b",
"isClosed": true,
"Area": 1.11524,
"vertexes": [
[14.5489900000254550604950055, 18.9650955958848683735595841, 0.0000000000000000000000000],
[14.5490000000254546819178358, 18.0999955958848701698116201, 1.0000000000000000000000000],
[15.3109999999745447496479756, 18.1000044041151326723593229, 0.0000000000000000000000000],
[15.3109899999745451282251452, 18.9651044041151308761072869, 1.0000000000000000000000000]
]
}
Assert:
thread '<unnamed>' panicked at 'point does not lie on the line defined by p0 to p1 (based on distance)', C:\cavalier_contours-master\cavalier_contours\src\core\math\base_math.rs:272:5
stack backtrace:
0: 0x7ffd5898efcf - std::backtrace_rs::backtrace::dbghelp::trace
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\..\..\backtrace\src\backtrace\dbghelp.rs:98
1: 0x7ffd5898efcf - std::backtrace_rs::backtrace::trace_unsynchronized
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\..\..\backtrace\src\backtrace\mod.rs:66
2: 0x7ffd5898efcf - std::sys_common::backtrace::_print_fmt
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\sys_common\backtrace.rs:66
3: 0x7ffd5898efcf - std::sys_common::backtrace::_print::impl$0::fmt
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\sys_common\backtrace.rs:45
4: 0x7ffd589a196a - core::fmt::write
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\core\src\fmt\mod.rs:1196
5: 0x7ffd5898d889 - std::io::Write::write_fmt<std::sys::windows::stdio::Stderr>
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\io\mod.rs:1654
6: 0x7ffd58990c1b - std::sys_common::backtrace::_print
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\sys_common\backtrace.rs:48
7: 0x7ffd58990c1b - std::sys_common::backtrace::print
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\sys_common\backtrace.rs:35
8: 0x7ffd58990c1b - std::panicking::default_hook::closure$1
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\panicking.rs:295
9: 0x7ffd5899080e - std::panicking::default_hook
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\panicking.rs:314
10: 0x7ffd58991211 - std::panicking::rust_panic_with_hook
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\panicking.rs:698
11: 0x7ffd58991092 - std::panicking::begin_panic_handler::closure$0
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\panicking.rs:586
12: 0x7ffd5898f8d7 - std::sys_common::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\sys_common\backtrace.rs:138
13: 0x7ffd58990da9 - std::panicking::begin_panic_handler
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\std\src\panicking.rs:584
14: 0x7ffd589a7fe5 - core::panicking::panic_fmt
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3/library\core\src\panicking.rs:142
15: 0x7ffd588d6598 - cavalier_contours::core::math::base_math::parametric_from_point<f64>
at C:\cavalier_contours-master\cavalier_contours\src\core\math\base_math.rs:272
16: 0x7ffd588d59a0 - cavalier_contours::core::math::line_circle_intersect::line_circle_intr<f64>
at C:\cavalier_contours-master\cavalier_contours\src\core\math\line_circle_intersect.rs:155
17: 0x7ffd588d0065 - cavalier_contours::polyline::pline_seg_intersect::pline_seg_intr::closure$0<f64>
at C:\cavalier_contours-master\cavalier_contours\src\polyline\pline_seg_intersect.rs:147
18: 0x7ffd588cd5ee - cavalier_contours::polyline::pline_seg_intersect::pline_seg_intr<f64>
at C:\cavalier_contours-master\cavalier_contours\src\polyline\pline_seg_intersect.rs:236
19: 0x7ffd58921789 - cavalier_contours::polyline::internal::pline_intersects::find_intersects::closure$0<cavalier_contours::polyline::pline::Polyline<f64>,cavalier_contours::polyline::pline::Polyline<f64>,f64>
at C:\cavalier_contours-master\cavalier_contours\src\polyline\internal\pline_intersects.rs:358
20: 0x7ffd589258dd - static_aabb2d_index::core::impl$8::visit<f64,tuple$<>,cavalier_contours::polyline::internal::pline_intersects::find_intersects::closure_env$0<cavalier_contours::polyline::pline::Polyline<f64>,cavalier_contours::polyline::pline::Polyline<f64>,f64> >
at C:\Users\KarakurT\.cargo\registry\src\github.com-1ecc6299db9ec823\static_aabb2d_index-1.0.0\src\core.rs:267
21: 0x7ffd588c8484 - static_aabb2d_index::static_aabb2d_index::StaticAABB2DIndex<f64>::visit_query_with_stack_impl<f64,cavalier_contours::polyline::internal::pline_intersects::find_intersects::closure_env$0<cavalier_contours::polyline::pline::Polyline<f64>,cavalier_contours::
at C:\Users\KarakurT\.cargo\registry\src\github.com-1ecc6299db9ec823\static_aabb2d_index-1.0.0\src\static_aabb2d_index.rs:1050
22: 0x7ffd588c6c61 - static_aabb2d_index::static_aabb2d_index::StaticAABB2DIndex<f64>::visit_query_with_stack<f64,cavalier_contours::polyline::internal::pline_intersects::find_intersects::closure_env$0<cavalier_contours::polyline::pline::Polyline<f64>,cavalier_contours::polyl
at C:\Users\KarakurT\.cargo\registry\src\github.com-1ecc6299db9ec823\static_aabb2d_index-1.0.0\src\static_aabb2d_index.rs:1012
23: 0x7ffd58920f2e - cavalier_contours::polyline::internal::pline_intersects::find_intersects<cavalier_contours::polyline::pline::Polyline<f64>,cavalier_contours::polyline::pline::Polyline<f64>,f64>
at C:\cavalier_contours-master\cavalier_contours\src\polyline\internal\pline_intersects.rs:402
24: 0x7ffd58902bdb - cavalier_contours::polyline::internal::pline_boolean::process_for_boolean<cavalier_contours::polyline::pline::Polyline<f64>,cavalier_contours::polyline::pline::Polyline<f64>,f64>
at C:\cavalier_contours-master\cavalier_contours\src\polyline\internal\pline_boolean.rs:55
25: 0x7ffd58900774 - cavalier_contours::polyline::internal::pline_boolean::polyline_boolean<cavalier_contours::polyline::pline::Polyline<f64>,cavalier_contours::polyline::pline::Polyline<f64>,cavalier_contours::polyline::pline::Polyline<f64>,f64>
at C:\cavalier_contours-master\cavalier_contours\src\polyline\internal\pline_boolean.rs:744
26: 0x7ffd5891908a - cavalier_contours::polyline::traits::PlineSource::boolean_opt<cavalier_contours::polyline::pline::Polyline<f64>,cavalier_contours::polyline::pline::Polyline<f64> >
at C:\cavalier_contours-master\cavalier_contours\src\polyline\traits.rs:1465
27: 0x7ffd5891697c - cavalier_contours_ffi::cavc_pline_boolean::closure$0
at C:\cavalier_contours-master\cavalier_contours_ffi\src\lib.rs:965
28: 0x7ffd5895cee0 - std::panicking::try::do_call<cavalier_contours_ffi::cavc_pline_boolean::closure_env$0,i32>
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3\library\std\src\panicking.rs:492
29: 0x7ffd5895ef53 - std::panicking::try::do_catch<cavalier_contours_ffi::cavc_plinelist_pop::closure_env$0,i32>
30: 0x7ffd5895c44c - std::panicking::try<i32,cavalier_contours_ffi::cavc_pline_boolean::closure_env$0>
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3\library\std\src\panicking.rs:456
31: 0x7ffd588f1d0d - std::panic::catch_unwind<cavalier_contours_ffi::cavc_pline_boolean::closure_env$0,i32>
at /rustc/e092d0b6b43f2de967af0887873151bb1c0b18d3\library\std\src\panic.rs:137
32: 0x7ffd589819d1 - cavalier_contours_ffi::cavc_pline_boolean
at C:\cavalier_contours-master\cavalier_contours_ffi\src\lib.rs:949
I am able to reproduce both those cases, I looked into them briefly, they both just affect accuracy at the epsilon thresholds. The first one (assert in pline_boolean) I think indicates the code can be changed to improve accuracy in certain cases, and the other one (assert in point_from_parametric) I think is just too strict a debug assert but I need to dig into it further.
I'll work on these more and fix them when I find some time in next few days.
For case number 2 I've tracked the issue down to line_circle_intr
not applying the right epsilon in one of the branches, leading to loss of precision, I will commit a change to fix this right now.
For case number 1 I'm realizing the slice_join_eps
epsilon value used now for stitching slices together (for both boolean ops and parallel offset) is maybe not required and actually leads to loss in precision (which it does for this case 2). I added the slice_join_eps
a long time ago in the C++ code to fix issues that were arising but I'm starting to think those issues were purely due to precision/epsilon problems in the intersect code which has been fixed due to all the feed back and test cases you've provided.
The slice end points that are joined together are always at intersect points and therefore I think should be within the pos_equal_eps
used for processing the intersects.
What's happening in case 1 is there is more than 1 candidate slice to join to when using slice_join_eps = 1e-4
and pos_equal_eps = 1e-5
and the code currently picks arbitrarily between them when it should pick the nearest point. I could change the code to sort and pick the nearest point but the problem is also fixed by having slice_join_eps = pos_equal_eps
. All my test cases pass when just using the same value for both epsilons but I'm still thinking about why it would or wouldn't be required to have a larger epsilon value for the slice joining.
OK I removed the slice_join_eps
from the pline boolean options (breaking change, if interacted with options directly instead of using defaults), see merge commit for details.
Both cases you reported should be fixed and I added them as test cases. Thanks for the bug report. Closing this issue, please make a new issue if you find more problem cases.
Hello
I still have a problem when running my code in debug mode.
cavalier_contours = "0.3.0"
Polyline { vertex_data: [PlineVertex { x: 45.05580172313815, y: 21.126841631294923, bulge: 0.0 }, PlineVertex { x: 45.29628023875526, y: 21.978451356233762, bulge: 0.0 }, PlineVertex { x: 45.3785556294714, y: 22.31438601188941, bulge: 0.0 }, PlineVertex { x: 45.48890719195993, y: 24.066170448686535, bulge: 0.0 }, PlineVertex { x: 45.36683687946474, y: 26.21141480787847, bulge: 0.0 }, PlineVertex { x: 45.1854403950129, y: 27.913470684423913, bulge: 0.0 }, PlineVertex { x: 45.08583102001116, y: 28.62530354769791, bulge: 0.0 }, PlineVertex { x: 44.89833101991689, y: 29.52359223762525, bulge: 0.0 }, PlineVertex { x: 44.546768519851305, y: 30.562747757060407, bulge: 0.0 }, PlineVertex { x: 44.50770601983725, y: 31.156495331535297, bulge: 0.0 }, PlineVertex { x: 44.75770601992233, y: 31.570510944402656, bulge: 0.0 }, PlineVertex { x: 45.37489352008594, y: 31.984152120408453, bulge: 0.0 }, PlineVertex { x: 49.85145602108028, y: 34.1405290965634, bulge: 0.0 }, PlineVertex { x: 50.63246188070403, y: 34.437585093193064, bulge: 0.0 }, PlineVertex { x: 51.507706021500816, y: 34.6173131181892, bulge: 0.0 }, PlineVertex { x: 55.398331022406154, y: 35.367610650243165, bulge: 0.0 }, PlineVertex { x: 56.882706022745346, y: 35.617584708988886, bulge: 0.0 }, PlineVertex { x: 57.89833102298897, y: 35.898945306152, bulge: 0.0 }, PlineVertex { x: 59.07801852331356, y: 36.437751715665826, bulge: 0.0 }, PlineVertex { x: 59.96864352349027, y: 36.93732347214541, bulge: 0.0 }, PlineVertex { x: 60.67176852364582, y: 37.75001257927289, bulge: 0.0 }, PlineVertex { x: 61.35926852381279, y: 38.57054530057064, bulge: 0.0 }, PlineVertex { x: 62.12489352398351, y: 39.67990367306723, bulge: 0.0 }, PlineVertex { x: 62.890518524142045, y: 41.375129985092315, bulge: 0.0 }, PlineVertex { x: 63.14051852422713, y: 42.42992258604514, bulge: 0.0 }, PlineVertex { x: 63.247696258608414, y: 43.42530141100045, bulge: 0.0 }, PlineVertex { x: 63.10170016485827, y: 45.05361789236676, bulge: 0.0 }, PlineVertex { x: 63.15980563360115, y: 47.433299718476064, bulge: 0.0 }, PlineVertex { x: 63.10170016485827, y: 48.837408300659774, bulge: 0.0 }, PlineVertex { x: 62.916397430473246, y: 50.251222275592795, bulge: 0.0 }, PlineVertex { x: 62.35487399280774, y: 52.950670129473934, bulge: 0.0 }, PlineVertex { x: 62.34950289906433, y: 53.26899730323143, bulge: 0.0 }, PlineVertex { x: 62.235733367811164, y: 53.66391664410099, bulge: 0.0 }, PlineVertex { x: 62.237198211560475, y: 54.249755952534656, bulge: 0.0 }, PlineVertex { x: 62.45961032093204, y: 54.79561630515508, bulge: 0.0 }, PlineVertex { x: 62.891250946016704, y: 55.164379515744116, bulge: 0.0 }, PlineVertex { x: 63.3956454774348, y: 55.36239800628553, bulge: 0.0 }, PlineVertex { x: 64.30360446197021, y: 55.276839095450896, bulge: 0.0 }, PlineVertex { x: 65.3380282903462, y: 55.046315576115376, bulge: 0.0 }, PlineVertex { x: 66.19349704060043, y: 54.8434397351225, bulge: 0.0 }, PlineVertex { x: 66.93910250951029, y: 54.804583199059834, bulge: 0.0 }, PlineVertex { x: 68.66468844742654, y: 54.83596732479015, bulge: 0.0 }, PlineVertex { x: 70.2245029008795, y: 55.08928189054234, bulge: 0.0 }, PlineVertex { x: 71.87001071380104, y: 55.474483865584915, bulge: 0.0 }, PlineVertex { x: 73.01698337030172, y: 55.87537715595661, bulge: 0.0 }, PlineVertex { x: 73.98866305804172, y: 56.34277372506159, bulge: 0.0 }, PlineVertex { x: 75.45155368337075, y: 57.32576039830752, bulge: 0.0 }, PlineVertex { x: 76.54603610550495, y: 58.194790196311516, bulge: 0.0 }, PlineVertex { x: 77.8936923558315, y: 59.685508312162256, bulge: 0.0 }, PlineVertex { x: 78.35926852778326, y: 60.299352466161565, bulge: 0.0 }, PlineVertex { x: 79.26893649678628, y: 61.828911656715036, bulge: 0.0 }, PlineVertex { x: 79.66395602812602, y: 62.74313017067405, bulge: 0.0 }, PlineVertex { x: 80.30946384078032, y: 65.04453800751986, bulge: 0.0 }, PlineVertex { x: 81.00257907532372, y: 66.45600644854366, bulge: 0.0 }, PlineVertex { x: 81.62928805987002, y: 67.1019613313853, bulge: 0.0 }, PlineVertex { x: 83.462540013397, y: 68.77941774667417, bulge: 0.0 }, PlineVertex { x: 84.23304782606948, y: 69.68613553299747, bulge: 0.0 }, PlineVertex { x: 86.28089938906514, y: 72.26990585506496, bulge: 0.0 }, PlineVertex { x: 86.79774509227926, y: 73.1870697909057, bulge: 0.0 }, PlineVertex { x: 87.92884860823148, y: 75.32212299335848, bulge: 0.0 }, PlineVertex { x: 88.57240329589482, y: 76.73651430741478, bulge: 0.0 }, PlineVertex { x: 88.83558688965057, y: 77.80944324041889, bulge: 0.0 }, PlineVertex { x: 89.05043063972789, y: 78.96941102167264, bulge: 0.0 }, PlineVertex { x: 88.99183688973118, y: 80.26647565810416, bulge: 0.0 }, PlineVertex { x: 88.87464938965245, y: 81.09544240697952, bulge: 0.0 }, PlineVertex { x: 88.45545993643692, y: 82.684629072804, bulge: 0.0 }, PlineVertex { x: 87.91908298324014, y: 83.80609335231964, bulge: 0.0 }, PlineVertex { x: 87.4412997799426, y: 84.3813926011504, bulge: 0.0 }, PlineVertex { x: 86.24183688906326, y: 85.72736283680987, bulge: 0.0 }, PlineVertex { x: 84.66200290427633, y: 87.0243877186962, bulge: 0.0 }, PlineVertex { x: 84.10633884169336, y: 87.5705404984065, bulge: 0.0 }, PlineVertex { x: 83.64784274785514, y: 88.27246811037534, bulge: 0.0 }, PlineVertex { x: 83.44618259153378, y: 88.87278441776232, bulge: 0.0 }, PlineVertex { x: 83.30677829465553, y: 89.15034143608858, bulge: 0.0 }, PlineVertex { x: 83.26771579456837, y: 89.77418971736074, bulge: 0.0 }, PlineVertex { x: 83.462540013397, y: 90.60125292125997, bulge: 0.0 }, PlineVertex { x: 83.87220798222984, y: 91.14926463620009, bulge: 0.0 }, PlineVertex { x: 84.7811435293582, y: 92.30467955587085, bulge: 0.0 }, PlineVertex { x: 85.99208102961119, y: 93.42983045778416, bulge: 0.0 }, PlineVertex { x: 87.09364352985892, y: 94.28937912095296, bulge: 0.0 }, PlineVertex { x: 88.07801853010105, y: 94.92217812506576, bulge: 0.0 }, PlineVertex { x: 88.89833103027439, y: 95.2815354285107, bulge: 0.0 }, PlineVertex { x: 89.87489353051615, y: 95.62482943658316, bulge: 0.0 }, PlineVertex { x: 90.61708103068574, y: 95.91433158510733, bulge: 0.0 }, PlineVertex { x: 91.09364353084261, y: 96.18777068476939, bulge: 0.0 }, PlineVertex { x: 91.46083103093332, y: 96.50790318869772, bulge: 0.0 }, PlineVertex { x: 91.80458103101071, y: 96.945329697712, bulge: 0.0 }, PlineVertex { x: 91.97596774976512, y: 97.38051404840274, bulge: 0.0 }, PlineVertex { x: 91.95643649977028, y: 97.85828197306651, bulge: 0.0 }, PlineVertex { x: 91.67347751530137, y: 99.7794290176758, bulge: 0.0 }, PlineVertex { x: 91.6930087653084, y: 100.27661600854856, bulge: 0.0 }, PlineVertex { x: 92.52919040617643, y: 103.10656358561175, bulge: 0.0 }, PlineVertex { x: 92.7247470468066, y: 103.83234814306317, bulge: 0.0 }, PlineVertex { x: 92.75648532806193, y: 104.04489087832732, bulge: 0.0 }, PlineVertex { x: 92.74598728118376, y: 104.17973774470099, bulge: 0.0 }, PlineVertex { x: 92.6092685311833, y: 104.4143188005811, bulge: 0.0 }, PlineVertex { x: 90.29676853059729, y: 105.76576976822639, bulge: 0.0 }, PlineVertex { x: 89.10926853035761, y: 106.31262319562435, bulge: 0.0 }, PlineVertex { x: 87.82777438939515, y: 106.65627356254817, bulge: 0.0 }, PlineVertex { x: 85.92176852960782, y: 106.84378690650144, bulge: 0.0 }, PlineVertex { x: 84.04652438856816, y: 107.21918664775583, bulge: 0.0 }, PlineVertex { x: 82.18739352869778, y: 107.48476757134821, bulge: 0.0 }, PlineVertex { x: 80.68739352837002, y: 107.9692371521717, bulge: 0.0 }, PlineVertex { x: 79.31849704366631, y: 108.59489983926983, bulge: 0.0 }, PlineVertex { x: 78.59657321536622, y: 109.32589572701403, bulge: 0.0 }, PlineVertex { x: 78.00184665270825, y: 110.11590644258766, bulge: 0.0 }, PlineVertex { x: 76.2857821992478, y: 112.68276805683445, bulge: 0.0 }, PlineVertex { x: 75.68324313657729, y: 113.56241180820831, bulge: 0.0 }, PlineVertex { x: 74.98304782392036, y: 114.22951933693327, bulge: 0.0 }, PlineVertex { x: 74.13636813617418, y: 114.99373970325098, bulge: 0.0 }, PlineVertex { x: 73.13832126099537, y: 115.59062160748468, bulge: 0.0 }, PlineVertex { x: 71.68934665121166, y: 116.01419013904402, bulge: 0.0 }, PlineVertex { x: 70.23207126025905, y: 116.19534574408073, bulge: 0.0 }, PlineVertex { x: 68.60926852554927, y: 116.31038881379791, bulge: 0.0 }, PlineVertex { x: 65.75087008739597, y: 116.42580533994004, bulge: 0.0 }, PlineVertex { x: 63.63246188376392, y: 116.24240882526342, bulge: 0.0 }, PlineVertex { x: 61.813370086390904, y: 115.92417255621697, bulge: 0.0 }, PlineVertex { x: 59.9730380547382, y: 115.49537460346372, bulge: 0.0 }, PlineVertex { x: 57.524551726026374, y: 114.95601432216807, bulge: 0.0 }, PlineVertex { x: 56.90736422586277, y: 114.74647025575152, bulge: 0.0 }, PlineVertex { x: 53.76332125636277, y: 113.6628889390822, bulge: 0.0 }, PlineVertex { x: 52.895645474957725, y: 113.67260048089508, bulge: 0.0 }, PlineVertex { x: 52.09584078728689, y: 113.78988599082902, bulge: 0.0 }, PlineVertex { x: 51.32582125586824, y: 114.09206397546663, bulge: 0.0 }, PlineVertex { x: 50.84779391194988, y: 114.44317260927696, bulge: 0.0 }, PlineVertex { x: 50.584610318121015, y: 114.77485769885067, bulge: 0.0 }, PlineVertex { x: 50.49671969312594, y: 115.26229940815927, bulge: 0.0 }, PlineVertex { x: 50.45790133374489, y: 117.93443198001816, bulge: 0.0 }, PlineVertex { x: 50.63343844319951, y: 118.45137421334312, bulge: 0.0 }, PlineVertex { x: 51.05262789641504, y: 119.0848509045909, bulge: 0.0 }, PlineVertex { x: 51.67665133407136, y: 119.53343795617454, bulge: 0.0 }, PlineVertex { x: 53.080948209403665, y: 120.02124265693956, bulge: 0.0 }, PlineVertex { x: 53.987686490822774, y: 120.25505984151516, bulge: 0.0 }, PlineVertex { x: 55.08998141294517, y: 120.40147558797531, bulge: 0.0 }, PlineVertex { x: 56.50379977266017, y: 120.4504053183633, bulge: 0.0 }, PlineVertex { x: 57.566543913526864, y: 120.57665144264575, bulge: 0.0 }, PlineVertex { x: 59.00013766386972, y: 120.89898959217302, bulge: 0.0 }, PlineVertex { x: 61.25257907068534, y: 121.79615540198267, bulge: 0.0 }, PlineVertex { x: 68.88832126001188, y: 125.11137924455767, bulge: 0.0 }, PlineVertex { x: 69.36586032259112, y: 125.4919768994454, bulge: 0.0 }, PlineVertex { x: 70.46083102596698, y: 126.80520184150222, bulge: 0.0 }, PlineVertex { x: 71.88197360441633, y: 127.98806869392493, bulge: 0.0 }, PlineVertex { x: 72.44764743270895, y: 128.70966291264614, bulge: 0.0 }, PlineVertex { x: 72.88636813591933, y: 129.52911021301796, bulge: 0.0 }, PlineVertex { x: 73.19813571413275, y: 130.41615661585388, bulge: 0.0 }, PlineVertex { x: 73.45179782357893, y: 131.64494342220598, bulge: 0.0 }, PlineVertex { x: 73.45179782357893, y: 133.4003412680716, bulge: 0.0 }, PlineVertex { x: 73.57093844858768, y: 133.99194454281155, bulge: 0.0 }, PlineVertex { x: 73.84974704241729, y: 134.6018470149387, bulge: 0.0 }, PlineVertex { x: 74.14979587053878, y: 134.73854262259852, bulge: 0.0 }, PlineVertex { x: 74.74696383946589, y: 134.8315404054187, bulge: 0.0 }, PlineVertex { x: 75.6656650115734, y: 134.82407070533557, bulge: 0.0 }, PlineVertex { x: 77.12831149629379, y: 134.24852956062432, bulge: 0.0 }, PlineVertex { x: 79.18739352803009, y: 133.06233489667295, bulge: 0.0 }, PlineVertex { x: 80.74989352836084, y: 132.01581906748552, bulge: 0.0 }, PlineVertex { x: 81.6873935286129, y: 131.45334276888252, bulge: 0.0 }, PlineVertex { x: 82.76551852887171, y: 130.92186484177438, bulge: 0.0 }, PlineVertex { x: 83.62489352902254, y: 130.68768547513747, bulge: 0.0 }, PlineVertex { x: 84.32801852919027, y: 130.51587908310617, bulge: 0.0 }, PlineVertex { x: 86.1405185296914, y: 130.1095190839123, bulge: 0.0 }, PlineVertex { x: 88.24989353018239, y: 129.594098154734, bulge: 0.0 }, PlineVertex { x: 89.85389743677199, y: 128.99239872004748, bulge: 0.0 }, PlineVertex { x: 90.57582126505991, y: 128.70966291264614, bulge: 0.0 }, PlineVertex { x: 91.53114353093669, y: 128.28126331717692, bulge: 0.0 }, PlineVertex { x: 92.43812595304972, y: 127.63698162591973, bulge: 0.0 }, PlineVertex { x: 93.21864353134653, y: 126.96916766021798, bulge: 0.0 }, PlineVertex { x: 93.78114353143441, y: 126.64048890314666, bulge: 0.0 }, PlineVertex { x: 94.42176853159914, y: 126.32824363014859, bulge: 0.0 }, PlineVertex { x: 95.06239353176387, y: 126.12505986581033, bulge: 0.0 }, PlineVertex { x: 95.7340243912971, y: 126.14074685431751, bulge: 0.0 }, PlineVertex { x: 96.37489353208265, y: 126.12505986581033, bulge: 0.0 }, PlineVertex { x: 96.81239353217671, y: 126.2191817799418, bulge: 0.0 }, PlineVertex { x: 97.29676853226086, y: 126.43767892566834, bulge: 0.0 }, PlineVertex { x: 97.64051853233825, y: 126.84367219264303, bulge: 0.0 }, PlineVertex { x: 97.96839939179408, y: 127.54696878758836, bulge: 0.0 }, PlineVertex { x: 98.74989353267166, y: 131.00029806695, bulge: 0.0 }, PlineVertex { x: 98.9840243920377, y: 131.84401371015923, bulge: 0.0 }, PlineVertex { x: 99.3592685327496, y: 132.3751159255749, bulge: 0.0 }, PlineVertex { x: 99.99989353291433, y: 133.1564538499997, bulge: 0.0 }, PlineVertex { x: 100.64051853307906, y: 133.76561165925654, bulge: 0.0 }, PlineVertex { x: 101.24989353325448, y: 134.26570991509777, bulge: 0.0 }, PlineVertex { x: 101.93739353340926, y: 134.57831743468455, bulge: 0.0 }, PlineVertex { x: 102.85926853358748, y: 134.57831743468455, bulge: 0.0 }, PlineVertex { x: 103.60926853374527, y: 134.62537659268287, bulge: 0.0 }, PlineVertex { x: 104.49989353399508, y: 135.00035555749247, bulge: 0.0 }, PlineVertex { x: 105.53114353425164, y: 135.5004510131409, bulge: 0.0 }, PlineVertex { x: 106.87489353457191, y: 135.87505500676377, bulge: 0.0 }, PlineVertex { x: 107.87489353474167, y: 136.37514847877884, bulge: 0.0 }, PlineVertex { x: 108.98426853507509, y: 136.93761222380104, bulge: 0.0 }, PlineVertex { x: 109.7808993946143, y: 137.23452975757215, bulge: 0.0 }, PlineVertex { x: 110.93739353548548, y: 137.45338947016074, bulge: 0.0 }, PlineVertex { x: 113.14051853598096, y: 137.60987776603753, bulge: 0.0 }, PlineVertex { x: 114.56239353640245, y: 137.88812040474076, bulge: 0.0 }, PlineVertex { x: 115.78529392727073, y: 138.42854503673664, bulge: 0.0 }, PlineVertex { x: 116.10536228672618, y: 138.71687055996605, bulge: 0.0 }, PlineVertex { x: 115.96107517734617, y: 139.3237721455785, bulge: 0.0 }, PlineVertex { x: 115.47865330219207, y: 140.28958254812287, bulge: 0.0 }, PlineVertex { x: 114.70619236451645, y: 140.9924627881164, bulge: 0.0 }, PlineVertex { x: 113.2496493954385, y: 142.04715242060576, bulge: 0.0 }, PlineVertex { x: 111.6405185356532, y: 143.06262255182082, bulge: 0.0 }, PlineVertex { x: 107.49354587841172, y: 146.2471872281218, bulge: 0.0 }, PlineVertex { x: 104.40443454962046, y: 148.78449832597602, bulge: 0.0 }, PlineVertex { x: 103.63221775250474, y: 149.1426474824807, bulge: 0.0 }, PlineVertex { x: 102.1566318146614, y: 149.65354120593997, bulge: 0.0 }, PlineVertex { x: 100.14320407978668, y: 150.19132279411076, bulge: 0.0 }, PlineVertex { x: 99.50868259533748, y: 150.39784551392194, bulge: 0.0 }, PlineVertex { x: 98.92958103266808, y: 150.77055691271136, bulge: 0.0 }, PlineVertex { x: 98.65394626695792, y: 151.2668820362535, bulge: 0.0 }, PlineVertex { x: 98.61244236071126, y: 151.99773648651757, bulge: 0.0 }, PlineVertex { x: 98.80555759516976, y: 152.9354823125724, bulge: 0.0 }, PlineVertex { x: 99.31556736087897, y: 154.16264983963532, bulge: 0.0 }, PlineVertex { x: 99.9085849391668, y: 155.08694223603348, bulge: 0.0 }, PlineVertex { x: 100.65565525183816, y: 155.92122950110632, bulge: 0.0 }, PlineVertex { x: 102.56239353350014, y: 157.17190758674838, bulge: 0.0 }, PlineVertex { x: 106.12489353441413, y: 158.81245485955128, bulge: 0.0 }, PlineVertex { x: 107.48426853466204, y: 159.85959042137893, bulge: 0.0 }, PlineVertex { x: 108.68714939436693, y: 161.062819225808, bulge: 0.0 }, PlineVertex { x: 109.28651462890582, y: 161.69243913090037, bulge: 0.0 }, PlineVertex { x: 109.9347079883648, y: 163.00283446303018, bulge: 0.0 }, PlineVertex { x: 110.1966708790652, y: 164.3677435227064, bulge: 0.0 }, PlineVertex { x: 110.55506931664786, y: 167.05683238850838, bulge: 0.0 }, PlineVertex { x: 110.81727634799343, y: 167.4847832375029, bulge: 0.0 }, PlineVertex { x: 111.21717869182275, y: 167.78800794362263, bulge: 0.0 }, PlineVertex { x: 111.6239169731448, y: 168.34815100900244, bulge: 0.0 }, PlineVertex { x: 111.53431736377959, y: 168.60170863558898, bulge: 0.0 }, PlineVertex { x: 111.36903416057014, y: 169.0016494538204, bulge: 0.0 }, PlineVertex { x: 110.88612400423531, y: 169.44303987927725, bulge: 0.0 }, PlineVertex { x: 110.10023533219508, y: 169.99458995606685, bulge: 0.0 }, PlineVertex { x: 109.64491306648848, y: 170.4217882553708, bulge: 0.0 }, PlineVertex { x: 109.39686619140654, y: 171.00096924338874, bulge: 0.0 }, PlineVertex { x: 109.20375095694804, y: 171.63541527250982, bulge: 0.0 }, PlineVertex { x: 109.09339939444732, y: 172.20114989231058, bulge: 0.0 }, PlineVertex { x: 109.16224705068919, y: 173.028650854576, bulge: 0.0 }, PlineVertex { x: 109.43812595703237, y: 173.86959179231133, bulge: 0.0 }, PlineVertex { x: 109.98988376969437, y: 174.7799851610679, bulge: 0.0 }, PlineVertex { x: 111.02406345735207, y: 175.8972470308879, bulge: 0.0 }, PlineVertex { x: 114.15467869247529, y: 178.68290872953634, bulge: 0.0 }, PlineVertex { x: 114.63734470827457, y: 179.09627402939472, bulge: 0.0 }, PlineVertex { x: 114.857803692643, y: 179.593282230524, bulge: 0.0 }, PlineVertex { x: 114.99598728647807, y: 180.213514034556, bulge: 0.0 }, PlineVertex { x: 114.96815525522901, y: 180.90319780346687, bulge: 0.0 }, PlineVertex { x: 114.84413181764539, y: 181.67540208474838, bulge: 0.0 }, PlineVertex { x: 114.62342869264396, y: 182.5301260115692, bulge: 0.0 }, PlineVertex { x: 113.71351658302012, y: 183.85421341856977, bulge: 0.0 }, PlineVertex { x: 113.42372166105851, y: 184.69585988292863, bulge: 0.0 }, PlineVertex { x: 113.20301853606925, y: 185.75743511552213, bulge: 0.0 }, PlineVertex { x: 113.16175877044341, y: 186.6812217159674, bulge: 0.0 }, PlineVertex { x: 113.27186619231112, y: 188.17107150126697, bulge: 0.0 }, PlineVertex { x: 113.83754002051845, y: 191.12236326768482, bulge: 0.0 }, PlineVertex { x: 114.04432712998674, y: 191.97705058657385, bulge: 0.0 }, PlineVertex { x: 114.03895603623116, y: 192.3440909132986, bulge: 0.0 }, PlineVertex { x: 113.92396580186168, y: 192.79924994100395, bulge: 0.0 }, PlineVertex { x: 113.49012791106777, y: 193.3436472820834, bulge: 0.0 }, PlineVertex { x: 112.8719638484818, y: 193.75623833614844, bulge: 0.0 }, PlineVertex { x: 112.55482517652497, y: 193.92948901024667, bulge: 0.0 }, PlineVertex { x: 111.32753025432348, y: 194.60046070316025, bulge: 0.0 }, PlineVertex { x: 108.80482517561418, y: 195.36477599894076, bulge: 0.0 }, PlineVertex { x: 106.88075290958133, y: 195.85689358124893, bulge: 0.0 }, PlineVertex { x: 106.45399509690095, y: 195.96629438179318, bulge: 0.0 }, PlineVertex { x: 106.12513767503495, y: 196.05030519848913, bulge: 0.0 }, PlineVertex { x: 103.44032322124782, y: 196.12759512171468, bulge: 0.0 }, PlineVertex { x: 101.57557712708633, y: 195.51450232969196, bulge: 0.0 }, PlineVertex { x: 99.20912204838454, y: 194.47388356185542, bulge: 0.0 }, PlineVertex { x: 96.89393650093291, y: 193.1640485820539, bulge: 0.0 }, PlineVertex { x: 95.92616306317483, y: 192.91387967113477, bulge: 0.0 }, PlineVertex { x: 94.39003025034381, y: 192.73801449075614, bulge: 0.0 }, PlineVertex { x: 87.99330173322542, y: 192.80746445141037, bulge: 0.0 }, PlineVertex { x: 86.33143649844065, y: 192.60247498852476, bulge: 0.0 }, PlineVertex { x: 84.70741306060238, y: 192.40682002290774, bulge: 0.0 }, PlineVertex { x: 84.35829196678158, y: 192.42884988455867, bulge: 0.0 }, PlineVertex { x: 84.0335849354452, y: 192.4613345917962, bulge: 0.0 }, PlineVertex { x: 83.68202243535525, y: 192.69918224512512, bulge: 0.0 }, PlineVertex { x: 82.89393649761796, y: 193.0117069506868, bulge: 0.0 }, PlineVertex { x: 81.54286227861206, y: 193.7532512542619, bulge: 0.0 }], is_closed: false }
Calling polyline.parallel_offset(-3.0)
.
thread 'OxHTTP server thread 0' panicked at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/core/math/base_math.rs:272:5:
point does not lie on the line defined by p0 to p1 (based on distance)
stack backtrace:
0: std::panicking::begin_panic
at /rustc/82e1608dfa6e0b5569232559e3d385fea5a93112/library/std/src/panicking.rs:686:12
1: cavalier_contours::core::math::base_math::parametric_from_point
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/core/math/base_math.rs:272:5
2: cavalier_contours::core::math::line_circle_intersect::line_circle_intr
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/core/math/line_circle_intersect.rs:155:16
3: cavalier_contours::polyline::pline_seg_intersect::pline_seg_intr::{{closure}}
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/polyline/pline_seg_intersect.rs:147:27
4: cavalier_contours::polyline::pline_seg_intersect::pline_seg_intr
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/polyline/pline_seg_intersect.rs:241:16
5: cavalier_contours::polyline::internal::pline_intersects::visit_global_self_intersects::{{closure}}
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/polyline/internal/pline_intersects.rs:175:19
6: <F as static_aabb2d_index::core::QueryVisitor<T,C>>::visit
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/static_aabb2d_index-0.7.1/src/core.rs:267:9
7: static_aabb2d_index::static_aabb2d_index::StaticAABB2DIndex<T>::visit_query_with_stack
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/static_aabb2d_index-0.7.1/src/static_aabb2d_index.rs:997:34
8: cavalier_contours::polyline::internal::pline_intersects::visit_global_self_intersects
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/polyline/internal/pline_intersects.rs:216:9
9: cavalier_contours::polyline::internal::pline_intersects::all_self_intersects_as_basic
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/polyline/internal/pline_intersects.rs:285:5
10: cavalier_contours::polyline::internal::pline_offset::slices_from_dual_raw_offsets
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/polyline/internal/pline_offset.rs:1045:9
11: cavalier_contours::polyline::internal::pline_offset::parallel_offset
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/polyline/internal/pline_offset.rs:1511:22
12: cavalier_contours::polyline::traits::PlineSource::parallel_offset_opt
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/polyline/traits.rs:1387:9
13: cavalier_contours::polyline::traits::PlineSource::parallel_offset
at /home/martin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cavalier_contours-0.3.0/src/polyline/traits.rs:1351:9
14: maprender::draw::draw_line_off
at ./src/draw.rs:113:15
@zdila Can you make a new issue and also try using the latest on master branch?
@jbuckmccready I apologize, with cavalier_contours = { git = "https://github.com/jbuckmccready/cavalier_contours.git", rev = "78ca697770ea2d97e54122bf67de303c277a662b" }
it works. Thank you.
@zdila I made a new release, 0.4.0
with all the latest changes/fixes on master branch.
Hello! I've continued investigations from topic https://github.com/jbuckmccready/cavalier_contours/issues/23
Got several new results.
Input vectors:
In debug mode i see assert failure:
C Code:
Assert fails in debug mode only. Could you please check it.
There are several additional similar troubles. Could you please clarify, do you need input vectors data for this type of issues? Im asking because i can copy-paste Rust backtrace in one minute, but grabbing faulty vectors takes time.
For example:
Best regards, Andrei Rodionov