Ask Your Question

rudolfninja's profile - activity

2020-06-29 18:18:44 -0600 received badge  Popular Question (source)
2017-08-31 09:38:08 -0600 marked best answer Drawing an arc

Hi guys, I have arc parameters from Autocad file and I need to draw it using opencv. However, using corresponding parameters in cv::ellipse function the arc is absolutely not the same as in Autocad. Here is my code:

cv::ellipse(image, center, cv::Size(radius, radius), angle, start_angle, end_angle, cv::Scalar(255, 255, 255));

The picture should be like image description

but in fact I've got image description

Here is parameters for every arc:

1) center.x = 495.419403
    center.y = 527.065674
    start angle = 0.0000
    end abgle = 56.88228
    full angle = 56.88228
    start.x = 501.41940
    start.y = 527.06567
    end.x = 498.69757
    end.y = 532.090979
    arc_center.x = 500.695245
    arc_center.y = 529.92321
    radius = 6.00000

2) center.x = 495.4194
    center.y = 486.31543
    start angle = 270.0000
    end abgle = 0.0000
    full angle = 90.0000
    start.x = 495.41940
    start.y = 480.31543
    end.x = 501.4194
    end.y = 486.31543
    arc_center.x = 499.6620
    arc_center.y = 482.07279
    radius = 6.00000

3) center.x = 454.6691
    center.y = 486.31543
    start angle = 213.11771
    end abgle = 270.000
    full angle = 56.88228
    start.x = 449.64386
    start.y = 483.03727
    end.x = 454.66916
    end.y = 480.31543
    arc_center.x = 451.8116
    arc_center.y = 481.03959
    radius = 6.00000

4) center.x = 419.4194
    center.y = 562.31543
    start angle = 56.88228
    end abgle = 213.1177
    full angle = 156.2354
    start.x = 429.2539
    start.y = 577.3913
    end.x = 404.3435
    end.y = 552.4809415
    arc_center.x = 406.69148
    arc_center.y = 575.04336
    radius = 18.00000

How can I draw correct arcs? I've got start and end points of the arc, radius, and center points (arc center and center from where radius goes)

2017-08-31 09:38:08 -0600 received badge  Scholar (source)
2017-08-31 06:54:22 -0600 commented answer Drawing an arc

flipping change the position of the other points. But actually, it is not so importatnt for me.I still don't understand

2017-08-31 06:50:05 -0600 received badge  Supporter (source)
2017-08-31 06:49:10 -0600 received badge  Student (source)
2017-08-31 05:03:06 -0600 commented answer Drawing an arc

I've added additional check: end_angle = end_angle == 0.0 ? 360.0 : end_angle; and it solved the problem with red arc an

2017-08-31 04:47:11 -0600 commented answer Drawing an arc

You've got end_angle and start angle. So you can calc full_angle. That waht I do. But looks like when use 0, it looks al

2017-08-31 04:40:12 -0600 commented answer Drawing an arc

Why do you use angle with 0.0 value but not full angle (end angle - start angle)? This is the difference in my code

2017-08-31 03:50:34 -0600 commented question Drawing an arc

Degrees. I can't provide full code because it uses 3rd partylibraries to work with autocad file. So you won't be able to

2017-08-31 02:35:42 -0600 commented question Drawing an arc

I updated my post with required info. Looks like the problem might be somewhere in that, that autocad coordinates start

2017-08-31 02:35:24 -0600 commented question Drawing an arc

I updated my post with required info. Looks like the problem might be somewhere in that, that autocad coordinates start

2017-08-31 00:47:32 -0600 commented question Drawing an arc

I updated my post with required info

2017-08-31 00:47:13 -0600 received badge  Editor (source)
2017-08-31 00:47:13 -0600 edited question Drawing an arc

Drawing an arc Hi guys, I have arc parameters from Autocad file and I need to draw it using opencv. However, using corre

2017-08-30 17:09:54 -0600 asked a question Drawing an arc

Drawing an arc Hi guys, I have arc parameters from Autocad file and I need to draw it using opencv. However, using corre