carpenter1234 Posted February 7, 2009 Share Posted February 7, 2009 i have to get the following done: i have a vw-drawing with about 4000 circle-like formed polylines, but each of them is a polyline consisting in about 50 single dots. these circles shall be countersank later on, so i have to export them as dxf for the cnc-program. the machine won't accept those polylines, so i need a way to convert them automatically into real circles (see the difference? the polylines have a x and y position and consist of lots of dots, a real circle has a middle and a radius). does anyne know a way to do this? either in vw or in any 3rd-party-program? help urgently appreciated! Quote Link to comment
panta rhei Posted February 7, 2009 Share Posted February 7, 2009 Doable with a script in VW. I know a way. Quote Link to comment
carpenter1234 Posted February 8, 2009 Author Share Posted February 8, 2009 would you tell me? Quote Link to comment
panta rhei Posted February 8, 2009 Share Posted February 8, 2009 If I had an existing script ?close enough? I might, but I don't and I can't really make custom tools for free. Sorry. Maybe someone else will help ? it is certainly doable. Quote Link to comment
carpenter1234 Posted February 8, 2009 Author Share Posted February 8, 2009 could you push me into the right direction, plz? calling the polyline sin vectorscript or what? Quote Link to comment
panta rhei Posted February 8, 2009 Share Posted February 8, 2009 Eg. find the centre, measure the diameter, draw an arc of 360?. Or just find the bounding box and draw the arc inside it. Quote Link to comment
islandmon Posted February 8, 2009 Share Posted February 8, 2009 Are all the poly-arcs the same diameter? What is the grid spacing of the 4000 groups ? 4000x x 50 = 200,000 , when you select all is that how many objects are shown ? Quote Link to comment
carpenter1234 Posted February 8, 2009 Author Share Posted February 8, 2009 the polylines represent a b/w image in dotted raster. so almost any polyline has different diameters. i attached two images (german localization) with parts of the drawing. Quote Link to comment
islandmon Posted February 8, 2009 Share Posted February 8, 2009 Try Modify> convert > convert to polygon Quote Link to comment
islandmon Posted February 8, 2009 Share Posted February 8, 2009 Have you tried re-export >DWG / DXF. In 2004-2008 the polygons convert to polylines and the polylines to polygon. Will closed Polygons be sufficient for the cnc tool ? Quote Link to comment
carpenter1234 Posted February 8, 2009 Author Share Posted February 8, 2009 (edited) thanks for the hints, but both don't work. exporting and reimporting changes nothing, and converting to polygon leaves me with several hundreds single dots for each circle. ->absolutely uncountersinkable. closed polygons are also not ok, i really need circles. now i am trying to do it with vectorscript, but as a beginner it'S quite hard. any hints highly appreciated! Edited February 8, 2009 by carpenter1234 Quote Link to comment
gmm18 Posted February 8, 2009 Share Posted February 8, 2009 Say it took 2 seconds to manually trace each polyline with a new circle. That grueling, but doable, task would take about 2 hours 15 minutes. Based on what has already been discussed on the topic, sounds like writing a vectorscript to do this would take a matter of days. Quote Link to comment
MullinRJ Posted February 9, 2009 Share Posted February 9, 2009 Carpenter1234, Have you solved your problem yet? If not, email me offline and I'll tell you what I've got. Raymond (mullinrj @ aol . com) Quote Link to comment
Pat Stanford Posted February 9, 2009 Share Posted February 9, 2009 Based on the screen shots, it looks like the bounding box for your polylines is coinicdent with the edges of the polyline/circle. If this is so, then the following script may work for you. Copy a few of your polys to a new drawing and try it there first. And GMM18, this took about 30 minutes to come up with, including a lot of playing with bad test polylines. I tried Ovals first, but Arcs are much better if you want to make circles. Procedure PLtoCircles; {Draws a new circle at the center of the bounding box of each} {selected polyline on the active layer} {I recommend creating a new class and making it active to make} {it easy to select the created circles.} {February 8, 2009} {? 2009, Coviana, Inc - Pat Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} Procedure DoIt(H1:Handle); Var X1,Y1,X2,Y2,X3,Y3,X4,Y4 : Real; Begin GetBBox(H1,X1,Y1,X2,Y2); X3:=(X2-X1)/2; Y3:=(Y1-Y2)/2; X4:=X1+X3; Y4:=Y2+Y3; ArcByCenter(X4,Y4,Y3,0,360); End; Begin ForEachObject(DoIt,(((T=POLYLINE) & (SEL=TRUE)))); End; Run(PLtoCircles); Quote Link to comment
gmm18 Posted February 9, 2009 Share Posted February 9, 2009 Cool. 1 click vs. 8000 I am always amazed at how short and "simple" some scripts can be. I am glad there are script writers out there like you who are willing and able to help. Quote Link to comment
mike m oz Posted February 9, 2009 Share Posted February 9, 2009 Carpenter1234 I think you should send Pat a beer or six! Quote Link to comment
MullinRJ Posted February 9, 2009 Share Posted February 9, 2009 One small thing to consider, and I mean very small; if the accuracy of the circle's placement is critical, then the above script is only exact if there are an even number of points on the polyline, and they are equally spaced around the perimeter of the circle. If there are an odd number of points, or the spacing in non-uniform, then the accuracy of the center placement and the radius goes down as the point count goes down. For a large number of points the error is quite small. If the accuracy of the radius is critical, then the above script is only exact when there are polyline points on the 0?, 90?, 180??and 270? points of the circle. With an odd number of evenly spaced poly points, these criteria can never be met exactly. For what you are doing, this is most likely not a consideration, but I state it for others who may want use the script in the future. Raymond Quote Link to comment
carpenter1234 Posted February 9, 2009 Author Share Posted February 9, 2009 @Pat Stanford: you made my day, your script works nice! thsank you so much. would love to send you a bottle of wine or thelike, but CA is a bit far away from germany. once again, thanks a thousand times! Quote Link to comment
islandmon Posted February 9, 2009 Share Posted February 9, 2009 Once again a very clever , efficient and useful script. Mr. Stanford you are amazing ... Quote Link to comment
panta rhei Posted February 9, 2009 Share Posted February 9, 2009 Indeed. I might have checked the distance from the centre of every vertex and procrastinated about what to do if all distances are not equal but some are more equal than others. Move centre? Change radius? Raise the river? Lower the bridge? Mix, match & be confused about inches & millimetres? (Oh yes, that caused some problems in one engineering project a few years ago.) Quote Link to comment
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.