Translating a grid into an acad file

Hello,

I would like to translate a grid with dimensions m X n consisting of equally spaced cartesian coordinates in x and y, but varying heights in z, into a 3D acad file or 3D acad readable format. The file format is as follows:

x1 y1 z
x1 y2 z
x1 y3 z
...
x1 yn z
x2 y1 z
x2 y2 z
x2 y3 z
...
x2 yn z
...
xm y1 z
xm y2 z
xm y3 z
..
xm yn z

where z is a variable with different real positve values indicating variable different heights. This set could come from a radiance mesh primitive, but this is not important here. It is just topography, such as the geometry of a landscape. How would you approach this problem? Intermediate steps using the obj or other formats might possibly help.

Thanks

Martin

Martin.

Creating a DXF file from scratch might be tricky.
The reference states that an application can savely
skip anything (or nearly anything) it doesn't know
about but I guess that's not true for applications
that write DXF.

If you realy want to use DXF I'd crate a small file
with two 3DFace triangles and look at the DXF file
that produces. It should be possible to copy the
lines of the 3DFace definition and change the values
of the x,y and z coordinates. There are some binary
issues you have to be aware of, though.

You can find DXF specs here:

You might have more luck creating an *.obj file
(which has been discussed in the last months at least
once) or a *.3ds/*.vrml/*.whatever _simple_ format and
check if your ACAD installation has an importer for it.

Thomas

···

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On
Behalf Of Martin Moeck
Sent: 04 September 2006 18:53
To: Radiance general discussion
Subject: Translating a grid into an acad file

Hello,

I would like to translate a grid with dimensions m X n
consisting of equally spaced cartesian coordinates in x and
y, but varying heights in z, into a 3D acad file or 3D acad
readable format. The file format is as follows:

x1 y1 z
x1 y2 z
x1 y3 z
...
x1 yn z
x2 y1 z
x2 y2 z
x2 y3 z
...
x2 yn z
...
xm y1 z
xm y2 z
xm y3 z
..
xm yn z

where z is a variable with different real positve values
indicating variable different heights. This set could come
from a radiance mesh primitive, but this is not important
here. It is just topography, such as the geometry of a
landscape. How would you approach this problem? Intermediate
steps using the obj or other formats might possibly help.

Thanks

Martin

***********************************************************************************
This e-mail, (and any attachments) is confidential and may be privileged. It may be read, copied and used by the intended addressee only. If you have received this in error please contact BDP immediately.

If you have any queries, please contact the sender.
***********************************************************************************
Building Design Partnership
Registered in England No 2207415:
Registered Office: Building Design Partnership Ltd, Sunlight House, PO Box 85, Quay Street, Manchester, M60 3JA, http://www.bdp.co.uk
***********************************************************************************

It seems to me that AutoCAD has an MxN mesh operation (3dmesh?) that might be useful here; you could simply create a .scr file and feed it to AutoCAD. If that doesn't work, the "sdxf.py" <http://www.stani.be/python/sdxf> script Python library might be of some use.

Randolph

Bleicher, Thomas wrote:

···

Martin.

Creating a DXF file from scratch might be tricky.
The reference states that an application can savely
skip anything (or nearly anything) it doesn't know
about but I guess that's not true for applications
that write DXF.

If you realy want to use DXF I'd crate a small file
with two 3DFace triangles and look at the DXF file
that produces. It should be possible to copy the
lines of the 3DFace definition and change the values
of the x,y and z coordinates. There are some binary
issues you have to be aware of, though.

You can find DXF specs here:

http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=5129239

You might have more luck creating an *.obj file
(which has been discussed in the last months at least
once) or a *.3ds/*.vrml/*.whatever _simple_ format and
check if your ACAD installation has an importer for it.

Thomas

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Martin Moeck
Sent: 04 September 2006 18:53
To: Radiance general discussion
Subject: Translating a grid into an acad file

Hello,

I would like to translate a grid with dimensions m X n consisting of equally spaced cartesian coordinates in x and y, but varying heights in z, into a 3D acad file or 3D acad readable format. The file format is as follows:

x1 y1 z
x1 y2 z
x1 y3 z
...
x1 yn z
x2 y1 z
x2 y2 z
x2 y3 z
...
x2 yn z
...
xm y1 z
xm y2 z
xm y3 z
..
xm yn z

where z is a variable with different real positve values indicating variable different heights. This set could come from a radiance mesh primitive, but this is not important here. It is just topography, such as the geometry of a landscape. How would you approach this problem? Intermediate steps using the obj or other formats might possibly help.

Thanks

Martin

***********************************************************************************
This e-mail, (and any attachments) is confidential and may be privileged. It may be read, copied and used by the intended addressee only. If you have received this in error please contact BDP immediately.

If you have any queries, please contact the sender.
***********************************************************************************
Building Design Partnership
Registered in England No 2207415:
Registered Office: Building Design Partnership Ltd, Sunlight House, PO Box 85, Quay Street, Manchester, M60 3JA, http://www.bdp.co.uk
***********************************************************************************

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Given a well formated data file such as Martin originally posted, one could write an autolisp routine to read in the data file and do something with it in Autocad. This could be simple such as calling the "3dmesh" command and feeding it points as part of a script. The lisp routine could ask for the MxN resolution of the mesh and feed this to 3dmesh (or these could be written in as the first lines to the data file). Then the data file could be opened and successive calls to get coordinates to pass to the running 3dmesh command. Alternatively, with a little poking about you could determine the underlying format for the mesh data structure in Autocad and just build it directly...

-Jack

Randolph Fritz wrote:

···

It seems to me that AutoCAD has an MxN mesh operation (3dmesh?) that might be useful here; you could simply create a .scr file and feed it to AutoCAD. If that doesn't work, the "sdxf.py" <http://www.stani.be/python/sdxf> script Python library might be of some use.

Randolph

Bleicher, Thomas wrote:

Martin.

Creating a DXF file from scratch might be tricky.
The reference states that an application can savely
skip anything (or nearly anything) it doesn't know
about but I guess that's not true for applications
that write DXF.

If you realy want to use DXF I'd crate a small file
with two 3DFace triangles and look at the DXF file
that produces. It should be possible to copy the
lines of the 3DFace definition and change the values
of the x,y and z coordinates. There are some binary
issues you have to be aware of, though.

You can find DXF specs here:

http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=5129239

You might have more luck creating an *.obj file
(which has been discussed in the last months at least
once) or a *.3ds/*.vrml/*.whatever _simple_ format and
check if your ACAD installation has an importer for it.

Thomas

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Martin Moeck
Sent: 04 September 2006 18:53
To: Radiance general discussion
Subject: Translating a grid into an acad file

Hello,

I would like to translate a grid with dimensions m X n consisting of equally spaced cartesian coordinates in x and y, but varying heights in z, into a 3D acad file or 3D acad readable format. The file format is as follows:

x1 y1 z
x1 y2 z
x1 y3 z
...
x1 yn z
x2 y1 z
x2 y2 z
x2 y3 z
...
x2 yn z
...
xm y1 z
xm y2 z
xm y3 z
..
xm yn z

where z is a variable with different real positve values indicating variable different heights. This set could come from a radiance mesh primitive, but this is not important here. It is just topography, such as the geometry of a landscape. How would you approach this problem? Intermediate steps using the obj or other formats might possibly help.
Thanks

Martin

***********************************************************************************

This e-mail, (and any attachments) is confidential and may be privileged. It may be read, copied and used by the intended addressee only. If you have received this in error please contact BDP immediately.
If you have any queries, please contact the sender.
***********************************************************************************

Building Design Partnership
Registered in England No 2207415:
Registered Office: Building Design Partnership Ltd, Sunlight House, PO Box 85, Quay Street, Manchester, M60 3JA, http://www.bdp.co.uk
***********************************************************************************

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

--
# Jack de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction

You don't need AutoLISP; a bit of reformatting will do. Just create a
text file that looks like this:

3dmesh
<m> <n>
<vertex 1,1>
<vertex 1,2>
...
<vertex 1,n>
<vertex 2,1>
<vertex 2,2>
...
...
...
<vertex m,n>

Name the file mesh.scr, use the "script" command to read it in, and
Bob's your uncle.

Of course, this assumes you have a copy of AutoCAD. If you don't, I
think it would be fairly simple to hack sdxf.py to generate the
appropriate DXF.

Randolph

···

On Tue, Sep 05, 2006 at 01:51:46PM -0400, Jack de Valpine wrote:

Given a well formated data file such as Martin originally posted, one
could write an autolisp routine to read in the data file and do
something with it in Autocad. This could be simple such as calling the
"3dmesh" command and feeding it points as part of a script.

Well, Bob's my Uncle, that would be a lot easier wouldn't it!

Randolph Fritz wrote:

···

On Tue, Sep 05, 2006 at 01:51:46PM -0400, Jack de Valpine wrote:
  

Given a well formated data file such as Martin originally posted, one could write an autolisp routine to read in the data file and do something with it in Autocad. This could be simple such as calling the "3dmesh" command and feeding it points as part of a script.
    
You don't need AutoLISP; a bit of reformatting will do. Just create a
text file that looks like this:

3dmesh
<m> <n>
<vertex 1,1>
<vertex 1,2>
...
<vertex 1,n>
<vertex 2,1>
<vertex 2,2>
...
<vertex m,n>

Name the file mesh.scr, use the "script" command to read it in, and
Bob's your uncle.

Of course, this assumes you have a copy of AutoCAD. If you don't, I
think it would be fairly simple to hack sdxf.py to generate the
appropriate DXF.

Randolph

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

--
# Jack de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction

Thanks to everybody for your help!

Martin

···

-----Original Message-----
From: [email protected] on behalf of Jack de Valpine
Sent: Tue 9/5/2006 2:58 PM
To: Radiance general discussion
Subject: Re: [Radiance-general] RE: Translating a grid into an acad file

Well, Bob's my Uncle, that would be a lot easier wouldn't it!

Randolph Fritz wrote:

On Tue, Sep 05, 2006 at 01:51:46PM -0400, Jack de Valpine wrote:
  

Given a well formated data file such as Martin originally posted, one
could write an autolisp routine to read in the data file and do
something with it in Autocad. This could be simple such as calling the
"3dmesh" command and feeding it points as part of a script.
    
You don't need AutoLISP; a bit of reformatting will do. Just create a
text file that looks like this:

3dmesh
<m> <n>
<vertex 1,1>
<vertex 1,2>
...
<vertex 1,n>
<vertex 2,1>
<vertex 2,2>
...
...
...
<vertex m,n>

Name the file mesh.scr, use the "script" command to read it in, and
Bob's your uncle.

Of course, this assumes you have a copy of AutoCAD. If you don't, I
think it would be fairly simple to hack sdxf.py to generate the
appropriate DXF.

Randolph

_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

--
# Jack de Valpine
# president
#
# visarc incorporated
# http://www.visarc.com
#
# channeling technology for superior design and construction