![](/i/fill.gif) |
![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
HI all.
One of my interests is export shapes during my work with IntelliCAD (but Autocad
is the same), using the lisp language at runtime.
I write *.pov, *.inc and *.stl also.
Unfortunately from cad i can only write STL with the heavy ASCII format, because
I have a problem with the lisp.
Autocad uses double precision float numbers. STL binary want single precision
floats. But the AutoLISP (seems that) does not allow me this conversion.
Allow me to ask here, maybe some experienced 3D programmer knows a solution?
Thanks in advanced!
G.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
hi,
"GioSeregni" <gms### [at] hotmail com> wrote:
> HI all.
> One of my interests is export shapes during my work with IntelliCAD (but Autocad
> is the same), using the lisp language at runtime.
> I write *.pov, *.inc and *.stl also.
> Unfortunately from cad i can only write STL with the heavy ASCII format, because
> I have a problem with the lisp.
> Autocad uses double precision float numbers. STL binary want single precision
> floats. But the AutoLISP (seems that) does not allow me this conversion.
> Allow me to ask here, maybe some experienced 3D programmer knows a solution?
> Thanks in advanced!
> G.
STL to POV-Ray conversion has been discussed before, people seem to use various
utilities:
<http://news.povray.org/povray.general/thread/%3C59799a41%241%40news.povray.org%3E/?ttop=419996&toff=50&mtop=417481>
not being an "experienced 3D programmer" (but interested in file format
conversion(s)), I'd be tempted to output ASCII as now, then use a small (Tcl[*])
script to convert to binary STL.
regards, jr.
[*] guessing that, coming from LISP, you'll appreciate Tcl's list handling.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"GioSeregni" <gms### [at] hotmail com> wrote:
> HI all.
> One of my interests is export shapes during my work with IntelliCAD (but Autocad
> is the same), using the lisp language at runtime.
> I write *.pov, *.inc and *.stl also.
> Unfortunately from cad i can only write STL with the heavy ASCII format, because
> I have a problem with the lisp.
> Autocad uses double precision float numbers. STL binary want single precision
> floats. But the AutoLISP (seems that) does not allow me this conversion.
> Allow me to ask here, maybe some experienced 3D programmer knows a solution?
> Thanks in advanced!
> G.
Maybe you can post a question to another forum to get an answer that will let
you do exactly what you want?
https://stackoverflow.com/questions/21353376/how-to-use-double-float
If all else fails, in the meantime maybe try https://www.cadmesh.com/ ?
It would be nice if POV-Ray gets a READ binary command in the future. :)
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Bald Eagle" <cre### [at] netscape net> wrote:
> "GioSeregni" <gms### [at] hotmail com> wrote:
> > HI all.
> > One of my interests is export shapes during my work with IntelliCAD (but Autocad
> > is the same), using the lisp language at runtime.
> > I write *.pov, *.inc and *.stl also.
> > Unfortunately from cad i can only write STL with the heavy ASCII format, because
> > I have a problem with the lisp.
> > Autocad uses double precision float numbers. STL binary want single precision
> > floats. But the AutoLISP (seems that) does not allow me this conversion.
> > Allow me to ask here, maybe some experienced 3D programmer knows a solution?
> > Thanks in advanced!
> > G.
>
> Maybe you can post a question to another forum to get an answer that will let
> you do exactly what you want?
> https://stackoverflow.com/questions/21353376/how-to-use-double-float
>
> If all else fails, in the meantime maybe try https://www.cadmesh.com/ ?
>
> It would be nice if POV-Ray gets a READ binary command in the future. :)
Thanks!
Interesting discussion, but unfortunately AutoLISP is a reduced version of the
LISP language, and does not have all the commands covered.
Unfortunately, I haven't been able to find them.
Regards! :)
G.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"jr" <cre### [at] gmail com> wrote:
> hi,
>
> "GioSeregni" <gms### [at] hotmail com> wrote:
> > HI all.
> > One of my interests is export shapes during my work with IntelliCAD (but Autocad
> > is the same), using the lisp language at runtime.
> > I write *.pov, *.inc and *.stl also.
> > Unfortunately from cad i can only write STL with the heavy ASCII format, because
> > I have a problem with the lisp.
> > Autocad uses double precision float numbers. STL binary want single precision
> > floats. But the AutoLISP (seems that) does not allow me this conversion.
> > Allow me to ask here, maybe some experienced 3D programmer knows a solution?
> > Thanks in advanced!
> > G.
>
> STL to POV-Ray conversion has been discussed before, people seem to use various
> utilities:
>
<http://news.povray.org/povray.general/thread/%3C59799a41%241%40news.povray.org%3E/?ttop=419996&toff=50&mtop=417481>
>
> not being an "experienced 3D programmer" (but interested in file format
> conversion(s)), I'd be tempted to output ASCII as now, then use a small (Tcl[*])
> script to convert to binary STL.
>
>
> regards, jr.
>
> [*] guessing that, coming from LISP, you'll appreciate Tcl's list handling.
Thanks! If you are interested, this is my small Autolisp program.
I dont know if it works on your specific CAD without adjustments, I'm afraid
not, but the concept is this. 3DFACE ---> STL faces
WARNING all is working in a folder ... C:\CADEXT... and at the end It calls
Meshlab.
I put it only as a guide to the code, but it will certainly have to be adapted.
A minimum of experience is needed.
Regards!
G.
Post a reply to this message
Attachments:
Download 'cad2stl.zip' (3 KB)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
Otherwise the conversion to POV from Autocad needs (for me) another system.
STLs are geometry, architectural designs are something else.
Using LISP from my CAD I solved so.
FACES:
3Dfaces become mesh, simple, and the texture is chosen according to the name of
the CAD Layer.
Complex objects:
they are very simplified CAD blocks (dwg). Then my converter chooses much more
sophisticated objects (* .inc), specially written for POV.
The converter scales them if necessary, positions them, and loads the necessary
finishes.
This is a quick render ...
Post a reply to this message
Attachments:
Download 'cad2pov.jpg' (383 KB)
Preview of image 'cad2pov.jpg'
![cad2pov.jpg](/povray.off-topic/attachment/%3Cweb.5e669669517dbb512c923fbd0%40news.povray.org%3E/cad2pov.jpg?ttop=443812&toff=50&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
I forgot, the converter uses not only blocks and 3DFACE, but also 3DLINE and
Arcs. They become pipes (soften connected or not by small spheres [declared in
CAD]) with the diameter declared in CAD linetype scale.
The chosen layer defines color or texture.
This is a really quick system.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
hi,
"GioSeregni" <gms### [at] hotmail com> wrote:
> "jr" <cre### [at] gmail com> wrote:
> > ...
> Thanks! If you are interested, this is my small Autolisp program.
> I dont know if it works on your specific CAD without adjustments, I'm afraid
> not, but the concept is this. 3DFACE ---> STL faces
thanks. sorry, no CAD s/ware here.
had a v quick look at '2STL.lsp' (although I don't "speak" LISP), but the ASCII
format output is clear.
now thinking that if you were to write each face as as line of comma-separated
values instead (ie nx,ny,...,v3z), converting that CSV to binary STL would be
(famous last words.. :-)) trivial.
> ...
regards, jr.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"jr" <cre### [at] gmail com> wrote:
> now thinking that if you were to write each face as as line of comma-separated
> values instead (ie nx,ny,...,v3z), converting that CSV to binary STL would be
> (famous last words.. :-)) trivial.
I believe jr is correct.
POV-RAY can read in the ASCII STL file, and write out the data to a binary STL.
As I have investigated doing this not long ago, the real PITA here is trying to
parse and process the ASCII in POV-RAY.
What _I_ wound up doing was just using a LibreOffice spreadsheet to go from
ASCII STL to a POV-RAY mesh object. If that initial pre-processing step in the
workflow isn't a big deal, then you could do the same to format your ASCII STL
data, and then use POV-RAY to read in and write out a binary STL file.
Post a reply to this message
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
"Bald Eagle" <cre### [at] netscape net> wrote:
> POV-RAY can read in the ASCII STL file, and write out the data to a binary STL.
>
> As I have investigated doing this not long ago, the real PITA here is trying to
> parse and process the ASCII in POV-RAY.
>
> What _I_ wound up doing was just using a LibreOffice spreadsheet to go from
> ASCII STL to a POV-RAY mesh object. If that initial pre-processing step in the
> workflow isn't a big deal, then you could do the same to format your ASCII STL
> data, and then use POV-RAY to read in and write out a binary STL file.
Thanks! I have my import export for generale purpose, a lot of work in many
years, this problem is solved ...
The goal for export bin stl WHILE I am working on the CAD dwg, is for to view a
runtime quickly step by step the design, and without I have to save the dwg (or
DXF).
I am able to export in ASCII file from CAD immediately, it works fine but the
ascii is big and slow to write and to read...
I should understand how to write an AutoLISP function that reads a double float
but writes a single (as bin STL needs).
In the real LISP it is possible without trick, but in the reduct set of the
functions of AutoLISP does not have this option.
I saw on internet but to write a trick is over my capacity.
There is a need to build a binary string by manipulating the individual bits
:(
Post a reply to this message
Attachments:
Download 'clipboard01.jpg' (55 KB)
Preview of image 'clipboard01.jpg'
![clipboard01.jpg](/povray.off-topic/attachment/%3Cweb.5e66f0eb517dbb512c923fbd0%40news.povray.org%3E/clipboard01.jpg?ttop=443812&toff=50&preview=1)
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |
|
![](/i/fill.gif) |
| ![](/i/fill.gif) |
|
![](/i/fill.gif) |