News:

Please note new Forum URL: forum.designcad.com

Main Menu

Line snap to circle failure

Started by Dempsey, December 02, 2013, 04:53:33 PM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Dempsey

I am using V23.0 and also wondering whether my problem has something to do with http://forum.designcad.com/index.php?topic=5306.0 (trim failure)

Basically I do a Line Snap to a circle and end up with a 0.01 to 0.02 gap between the end of the line and the circle. These are my steps:

  • Draw circle with R=75
  • Draw line, starting at circle centre
  • Select an angle from one of the standard angles in the horizontal scroll bar
  • Click Line Snap
  • Move cursor close to circle and Enter upon apparent "snap" to circle
  • Looks good, but on zooming in most of my radial ends show a 0.01 to 0.02 gap with the circle. The up pointing radial has still a gap of 0.0004 with the circle.

Dempsey

minstrel

#1
Well,  I see an issue, too.

It's just different :o -

edit - I must be doing something wrong...tested it in ver23, 22, 20, back to version 17...same results.  Anyone else try previous versions? 

Bob P

The same error occurs in V15.3. (.008 units off).  If I zoom way in, I can extend/trim the line closer, but I didn't check whether it is really on the circle.

Adrian 2.0

When you line snap to a circle, the line trims to a point tangent to the point on the circle where you select it - if you attempt to snap the circle very close to the expected convergence, then  you get very small discrepancies. If you exaggerate the misalignment of the snap the result is clear. (see attached)
I've always tried to avoid line-snap because I've messed up a few drawings in the past. (all versions of DCad I think) 

Bob P

AdrianK is correct.  The best way to accurately trim to the arc is to end the line somewhere near the arc, then trim the line to it.

DrollTroll

Using angle constraints is much like using OrthoLine. In your case, with Angle Contraint on and you LineSnap to the circle, first it processes the LineSnap (finds some point on the circle, probably not exactly on your line). Then from that snapped point it finds the closest perpendicular point on your line at the constrained angle. Of course, if you don't have angle constraint (or ortho mode) on, the line ends up exactly on the circle because the line can go exactly to the snapped point.
This has been a limitation of Angle Constraint mode and Ortho mode as long as I can remember.
25 years with DesignCAD

samdavo

#6
Dempsey,
(edit)
When I go into your drawing, click on the line and use E (set to multiple line trim incidentally), those gaps improve dramatically.  I drew a radius, trimmed it, and it was 75(.000...)  (and I have Q\precision set at 15 dec points.

For me (using V22.1), any line drawn in any radial direction from the centre, (circle drawn radius 50), and then trimmed back or extended forward with "E" appear slightly longer than the radius - WHEN VIEWED in TERTIARY-ULTRA-ZOOM. (i.e. a zoom into a zoom into a zoom into a zoom into a zoom - final zoom about .03x.03x.03x.03x.03 = .0000000024).

However, I set Q\General\Precision to 15 decimal points, and (whether I use U to measure the length of the new radius, or just use Infobox\Length),  I find lines are just LESS than 50, viz :-
49.999999999999993 (vertical using ortho-line)
49.999999999999993  (arbitrary angle about 40 deg)
49.999999999999972 (ditto about 20 deg)

The only radius that is EXACTLY 50 (.000000)  is the horizontal one ( zero deg) which I drew first, and it became the line on which the circle was drawn.  (which I then could have swung to 20 degrees if I was desperate).

IMO It would be unreasonable to fault DCAD on this score (at least on any problem I found - which was a non-problem). In fact I prefer a program that "get's on with the drawing" without telling you "there is an open polygon SOMEWHERE, and I refuse to continue until you
a) find it,
b) correct it, and
c) till my pedantry is fully sated. "

The only thing that is slightly strange (trivia imo) is that the line APPEARS to be longer than the radius, but Infobox gives the length as slightly less.   Again if you zoom in, and manually force it to look right (using extend,  "_"), so that the line ends on the circle, Infobox gives the line as 49.999956******.

The other minor /trivial point is that, at that sort of zoom is that you can't select the circle.   Of course, with Fit to Window, you can select the circle, and the radius is given as 50(.0000).

But am I gonna lose sleep on this one ? :)   As long as I remember to use E (trim) I'm happy.


 

Dempsey

Dempsey

samdavo

#8
Quote from: Dempsey on December 03, 2013, 08:23:33 PM
Ah, well, workaround mode it is :( :( :(
If you don't mind me saying so Dempsey, I don't think you are doing it right, lol.
(as the actress said to the bishop - or was it the other way round?)

Adriank and others are right, you have too many constraints on that line, and it will end opposite the point on the circle that you snap to.  i.e. "Snap mode" only applies to the second point, nothing to do with your line ending on the circle (which you are assuming I suspect).

Just try drawing a short (or long) line at that angle (30 degrees or whatever, selected from the scrollbar perimeter) - and trim it to the circle - that solves your problem yes?

Alternatively, just avoid the predetermined angle constraint, and the line will be exactly 75.00 etc.

ps i ADD JPEG "EXAMPLE".
draw line OA as 75 , draw circle
draw line at 30 deg towards B and trim it to the circle (this line is exactly 75.00)
Next draw line OC at 60 deg and snap to the circle ( as you say in the first post) - but snap near B, 30 degrees away
Your error in the length of this "radius" is much more than 0.01 my friend :) 
in fact it is around (1 - cos 30) 75 = 10.048. (depending on how close to B you snap)
cheers.
 
PS Did I ever thank you for that pushapart macro? :)) - bludy brilliant!!

Dempsey

The errors I reported I actually measured, and I agree that they can be even bigger when my cursor is further away.

The fact is that I ran into "limitations of Angle Constraint mode and Ortho mode" that have always been there according to DT. Now I know that I simply draw all  my angle constraint lines and then do a trim multiple line against the circle; I can live with that.
Dempsey

prl

#10
Generally speaking, I have never trusted DesignCAD to find the intersections of lines to circles, arcs, or curves (splines).  If you really want to ensure you have the proper intersection points, I recommend using pure math and basiccad.

Specifically read the end points of the line followed by the radius and center point of the circle (or partial circle . . . arc) and do the geometry math to locate the true intersection points (limited only by double precision match).  DesignCAD's way of doing things is a mix of ancient single precision routines coupled with separate screen graphic equations, both of which are often off the mark.

Because of this, I gave up and simply did the math to find the proper intersection coordinates.  I'm fairly sure I've posted these basic math equations in the past.  If not here then on Upperspace. 

Dempsey

I am sure that you are right, and many readers should follow your advice. On the other hand, I am expecting that DesingCAD internals should be all double precision by now.

For me however, I only make simple 2D and 3D drawings for my hobby woodworking projects where 1/64", or occasionally 1 mm, accuracy is good enough.
Dempsey

samdavo

#12
Quote from: prl on December 08, 2013, 12:21:43 PM
1. Generally speaking, I have never trusted DesignCAD to find the intersections of lines to circles, arcs, or curves (splines). 

2. If you really want to ensure you have the proper intersection points, I recommend using pure math and basiccad.  Specifically read the end points of the line followed by the radius and center point of the circle (or partial circle . . . arc)

1.  Well, prl ( and/or dempsey) - I'd love to see some examples of significant errors.

2. And I dispute your generalisation. i.e. I just posted a couple of examples of an error in the 17th significant digit,  or worst case 16th). 
Quote49.999 999 999 999 993 (vertical using ortho-line)
49.999 999 999 999 993  (arbitrary angle about 40 deg)
49.999 999 999 999 972 (ditto about 20 deg)
I find that quite acceptable -(don't you?)  When or why would you need better accuracy?
How accurate is a spreadsheet calculation anyway?

3.  I also find the title of this thread unfair, referring as it does to "snap failure" as if it was DCAD's fault, but in fact it was Dempsey's unfamiliarity with "angular constraint".  It should have said "alleged failure", and/or should have been corrected when the facts became clear.

4. Which is why I also challenged Dempsey on his choice of the word "workaround".    Don't get me wrong, there are heaps of instances with DCAD where you have to use "workarounds" - all as evidenced by numerous threads here - many such workarounds pointed out by you two lol.  But that's probably the case with many CAD packages.   And personally workarounds don't put me off DCAD.   

5.  prl, I have no doubt your macros are spot on - but seriously, I would need to see some evidence of inaccuracy of intersection points before I "went there".  I have no problem with 16 significant figures (for example). 

Cheers

PS prl, Of course if you are using a circle as a "line" ( i.e. series of short vectors) there could be errors when that is compared to a true circle - so in that respect I understand what you might be saying.

prl

#13
Quote from: samdavo on December 09, 2013, 12:21:14 AM
And I dispute your generalisation. i.e. I just posted a couple of examples of an error in the 17th significant digit,  or worst case 16th). 

Sam,

Using Dempsey's original post, I simply added letters for the intersections so you can compare the DesignCAD line intersection coordinates and the true intersection points. Definitely not errors in the 17th digit.  Keep in mind DesignCAD most likely uses different routines for line snap, trims, etc.

The dc file with labels at the intersection points is attached below.

Intersection A
-25.032098458199 53.560856701401 0.000000000000 (Dempsey line)
-26.542313873947 54.432779978217 0.000000000000 (Actual intersection using math)

Intersection B
-21.889849506485 -11.096361887072 0.000000000000 (Demsey line)
-21.940432659500 -11.125566084081 0.000000000000 (Actual intesection using math)

Intersection C
-10.009959176652 -26.646997885066 0.000000000000 (Dempsey line)
-10.021535964658 -26.658574673072 0.000000000000 (Actual intesection using math)

Intersection D
80.032560595890 -37.747971402295 0.000000000000 (Dempsey line)
80.511472624333 -38.577471367914 0.000000000000 (Actual intesection using math)

Intersection E
95.805571419030 -26.419664878779 0.000000000000 (Dempsey line)
96.044481213324 -26.658574673073 0.000000000000 (Actual intersection using math)

Intersection F
107.677612300106 -10.960579233343 0.000000000000 (Dempsey line)
107.963377908166 -11.125566084081 0.000000000000 (Actual intersection using math)

Intersetcion G
43.011472624333 101.370442420130 0.000000000000 (Dempsey line)
43.011472624333 101.374433915919 0.000000000000 (Actual intersection using math)


Mind you I'm certain IMSI has been improving and fixing these routines, but not knowing the spaghetti code relationship of the various commands, if what you are doing is really important, it is good to double check a few of the intersections with whatever command you are using.

Rob S

Prl, your post gives the impression that Designcad is terminating these lines imprecisely. 

It should be clearly noted these "errors" are the result of using a particular combination of "Angle constraint mode" and "linesnap" where the program by design snaps to the perpendicular intersection of the line being drawn and the point you snap to. 

It does not snap to the intersection of the circle, as confirmed by DT in his post above.

This is maybe a bit unclear and deceptive, but it is working as designed and is not a precision error.

Using any other means such as trim or intersect or whatever to find the intersection of the line and the circle is reliably precise in my experience
User since forever