I'm trying to check out the design for a solar concentrator, but alas am unable to figure out how to convert the text file containing the bare-bones measurements to a DXF for viewing in my CAD tool (qcad). The 27k text file can be seen here:
Maybe I'm just dense, but what the &%^$ is that file supposed to be? It looks like mostly a simple coordinate file. Where did that information come from?
Having Dxfed files before I can tell you that "From My experiance" It seems there are alot of "Machine" languages out there and this file might have been placed in the wrong association.... I think we are probably looking at the file in that way....just a guess... Maybe I should go look at the file before I shoot my mouth off huh?.....LOL :) BRB
Cartesian coordinates thay are. Not from a CNC though. No code. The points in this file could be plotted in Autocad but, as there is no indication of start/stop points, it would be quite the trick to connect the points into anything meaningful.
HiHO All; They are Pt.Num X Y Z and when inserted into a autocad drawing they show a solar concentrator with a probe and some point approximatly
6000 feet away. The simulated sun? I sent the drawing, R14, to newbie and hope it helps him. Since the points arn't in order my software wont connect it properly. A mesh dropped on the points could be shaded and displayed as a 3d concentrator.
The first part (until 9999 9999 9999 9999) defines indeed just 406 points. The next part (after the 9999 9999 9999 9999 separator) is a numbered list of connections: connection 1 connects point 1 and 2 with color 2. connection 2 connects point 3 and 4 with color 2 etc... There are thus 697 lines, connecting the 406 points.
3 different colors are used.
I have not tried it out in Autocad so far.
Ben.
"B. W. Salt." schreef in bericht news: snipped-for-privacy@monachorum.compulink.co.uk...
Using ascpoint.lsp (an old LISP from Tony Tanzillo) at first I draw a point at each of the coordinates of the first part. In a 3D view I could see that the points form a solar concentrator (at least nearly) and I thought they must be connected to 3DFACES. But in the second part of the source file (1 2 2, 3 4 2, ...) I could not find any sense. After reading your posting I connected the points in the way you suggested (with a little LISP). But what do we do with this bunch of lines? (I can't attach the result because this ng doesn't allow binary files)
Aha! That is it. The first part of the file is a list of points in space. The second part of the file is a list of triangles made from these points in space.
Maybe.
So the second part are lists of indices into the first part. This is just how meshes are organised in DXF files...
No, that I can't believe. The third value in each line of the second part is only 1 or 2 or 3. It makes no sense, that all triangles should be connected to the point 1 or 2 or 3. I'd agree to Bens interpretation, that the last value in each line of the second part can be a color code (maybe) and the first two values are the numbers of the startpoint and endpoint coordinate of a line..
I wrote the following quick and dirty VBA code to verify my interpretation which seems to be correct: (first part are point definitions, second part are lines connection them) Copy and paste the following two routines in the VBA editor and run subroutine readpoints. It produces a wireframe which looks like a parabolic collector. However, it looks quite poor and it seems to me this dates from the early years of CAD.
kr Ben.
Private Sub ParsePoints(line As String, ByRef posx As Double, ByRef posy As Double, ByRef posz As Double)
i = 2 While Mid(line, i, 1) " " i = i + 1 Wend While Mid(line, i, 1) = " " i = i + 1 Wend sstr = "" While Mid(line, i, 1) " " sstr = sstr + Mid(line, i, 1) i = i + 1 Wend posx = Val(sstr) While Mid(line, i, 1) = " " i = i + 1 Wend sstr = "" While Mid(line, i, 1) " " sstr = sstr + Mid(line, i, 1) i = i + 1 Wend posy = Val(sstr) While Mid(line, i, 1) = " " i = i + 1 Wend sstr = "" While Mid(line, i, 1) " " sstr = sstr + Mid(line, i, 1) i = i + 1 Wend posz = Val(sstr)
End Sub
Private Sub ReadPoints()
Dim TextLine As String Dim x As Double Dim y As Double Dim z As Double
Dim BeginPoint(0 To 2) As Double Dim EndPoint(0 To 2) As Double Dim PointList(0 To 1000, 0 To 2) As Double
'put the correct file location here Open "D:\Documents and Settings\......\matrix.txt" For Input As #1
'to distinguish between the first part of the file (point defs) and the last part(line defs) ImportingPoints = True PointNumber = 1 While Not EOF(1) Line Input #1, TextLine 'Debug.Print TextLine Call ParsePoints(TextLine, x, y, z) If ImportingPoints Then If x 9999 Then PointList(PointNumber, 0) = x PointList(PointNumber, 1) = y PointList(PointNumber, 2) = z PointNumber = PointNumber + 1 Else ImportingPoints = False End If Else If x 9999 Then BeginPoint(0) = PointList(x, 0) BeginPoint(1) = PointList(x, 1) BeginPoint(2) = PointList(x, 2) EndPoint(0) = PointList(y, 0) EndPoint(1) = PointList(y, 1) EndPoint(2) = PointList(y, 2) Set LineObject = ThisDrawing.ModelSpace.AddLine(BeginPoint, EndPoint) LineObject.color = z LineObject.Update End If End If Wend
Close #1
End Sub
"Jürgen Palme" schreef in bericht news: snipped-for-privacy@debitel.net...
I got also the wireframe model of this "object". Because I'm not so familiar with VBA I wrote some lines LISP, but I guess we see the similar results. (If someone is interested I can post the LISP code I used). We interpreted the first two values of each line in the second part as startpoint and endpoint of a line and not - as PR suggested - as "a list of triangles made from these points in space". This was my point. And my other question was: what can we do with this wireframe model, what is it useful for?
I tried ascpoint.lsp by removing the line numbers from part of the txt file and adding the required values to the file. By that I mean converting a 0 into 0.0 and so on. I did that for the first 200 lines.
Unfortunately, I could not get ascpoint.lsp to open the file. Kept giving "can't open the file" error messages!
1.: Maybe you must specify the path where the source file is stored ("C:/DIR1/DIR2/.../textfile.txt"). Use a slash (/) or two backslashes (\\).
2.: In the original source file the columns are separated by tabulators. ASCPOINT.LSP can't read tabs. You must find all tabs and replace them by a space (this can be done in nearly each text program).
I know, Toni wrote "Note that all numeric values must have at least one digit to the left and the right of the decimal point", but you can believe me, in this case it's not necessary to convert all "0" to "0.0". Try it ...
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.