panda-lite Posted March 30, 2017 Posted March 30, 2017 I should have said: "It should do it for now" instead of "it should be it for now", excuse the typo please. Quote
Jeremiah D Posted March 30, 2017 Posted March 30, 2017 Maybe this will help. I got the deviation to range from 1-5 mm. arc_best_fit.dwg Quote
Jeremiah D Posted March 30, 2017 Posted March 30, 2017 Whoops, sorry I didn't notice that this thread had two other pages. It looks like you already have a solution. Quote
jarekw90 Posted March 31, 2017 Posted March 31, 2017 Panda-lite, thanks a lot;). It solve me all problems about best fit circle for now. One extra question for You. Have you a simple lisp what give a average coordinates from selected points? Just select, average, removed old points and put in new average point. It would be great for situation when have measurment the same points from diffrent station, without number. Quote
jarekw90 Posted April 1, 2017 Posted April 1, 2017 However I have one extra problem with best fit circle. It would be useful to add function when the radius is known, just to find the centre. Now in bad configuration of points, calculated radius have a big different from nominal. Quote
panda-lite Posted April 4, 2017 Posted April 4, 2017 Jare, on regular Autocad points, and Land Desktop COGO points no problems for the routine. Civil Design type of points are still a problem for me, and to be able to read the object coordinates I read that needs to be done with API application type of code. Run command TT from DXF3-2.lsp and compare your points to the listing on Point-type.txt. If dissimilar to those, most likely is the the type of C3D. I will like to see the DXF listing of yours in order to do something. worst case scenario, you may snap a regular Autocad point to those entities and still get the average. DXF3-2.LSP Point-Type.txt Quote
panda-lite Posted April 4, 2017 Posted April 4, 2017 Yes, the radius is floating. The mathematical model should have a constrain for the radius. I will have to look into that. Civil 3D has a menu of fitting lines and curves where you can fix desired points (I will have to check on the radius). You may check for a package like Survey or Express Tools with your Autocad Dealer for your Autocad Version. I am looking into Microsurvey Software, like StarNet, at least. MicroSurvey Releases embeddedCAD 2017 and inCAD 2017 http://helpdesk.microsurvey.com/index.php?/News/NewsItem/View/238/microsurvey-embeddedcad-2017 Quote
jarekw90 Posted April 4, 2017 Posted April 4, 2017 Jare, on regular Autocad points, and Land Desktop COGO points no problems for the routine. Civil Design type of points are still a problem for me, and to be able to read the object coordinates I read that needs to be done with API application type of code.Run command TT from DXF3-2.lsp and compare your points to the listing on Point-type.txt. If dissimilar to those, most likely is the the type of C3D. I will like to see the DXF listing of yours in order to do something. worst case scenario, you may snap a regular Autocad point to those entities and still get the average. In attachments dxf list from my motherland language and english language pack Autocad. I always paste points as a regular Autocad points. Point-Type2.txt Quote
panda-lite Posted April 4, 2017 Posted April 4, 2017 Jare, that will be easy. I will look for one of my routines. Now I have to go to bed, it is 22:50 in Southern California and I have to be up tomorrow at 6:00. Must be the morning there..!! Quote
jarekw90 Posted May 31, 2017 Posted May 31, 2017 I've modifided your lisp fitcircle. I've changed (setq pt-ab (getpoint "\nAprox cen: ")) for (ser pt-ab pkt2); pkt2 is just calculeted average point from selected points. Additionaly I've changed (command "_circle" .. .. ) for function (entmake ...). I'm still thinking about solution when the radius is knowed... fitcir5.lsp Quote
panda-lite Posted June 1, 2017 Posted June 1, 2017 (edited) Thank you Jare for the modifications and for remind me of the upgrade, sorry for the delay. The average of points ensure that you pick a point inside the circle/arc. If you activate line 46, (command ".circle" pt-ab 1.234) you can see how the routine approaches the center. On a small portion of arc, picking a point outside of it may give you an undesirable result and it is not protected against it. use c:selcirc from filters.lsp to select the circles that mark the trail. entmake is the way to go, thanks. The original routine did calculate an optimal radius, on this one you give the radius. I have been trying it just today and seems to work well. Use it with caution. You may check it against known part of your drawings. I will keep checking on it, but so far seems to be working right. Attached there is a drawing where I was checking it. I just added line 25, (setq acum-rad (getreal "\nRadius: ")) and deactivated line 30, ;(setq acum-rad 0) and line 106 ;(setq acum-rad (+ acum-rad (/ dist top))) If you read the PDF items 2) and 3) radius is a multiplier, line 106 will not calculate item 1) since you are providing it. In the future, I will like to calculate the fitted radius and the difference with the one provided, as a check. I have been thinking how to do it, like in the case of raster images they use Hough Transform, but since we have the points and the routine is very strong, instead of calc the radius, we fix it. You may check your own circles by the use of commands difer, difer2 and diferat, but you will have to deactivate line 63, (command ".erase" "si" ss) because the routine uses the same selection set and needs to read the points. difer2 will give the residuals summation. Please let me know of any anomaly and any feedback will be very appreciated. Jorge. Fitcir4-radius-1.dwg Fitcir4-Radius.lsp filters.lsp Least_Squares_Circle.pdf Edited June 1, 2017 by panda-lite Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.