POV-Ray : Newsgroups : povray.tools.general : Do we have a linux-friendly mesh exporter? : Re: Do we have a linux-friendly mesh exporter? Server Time
20 Sep 2021 11:03:46 EDT (-0400)
  Re: Do we have a linux-friendly mesh exporter?  
From: Bald Eagle
Date: 24 Jan 2020 13:50:00
Message: <web.5e2b3b4fa1683a494eec112d0@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "Bald Eagle" <cre### [at] netscapenet> wrote:
> > I usually use Pose-Ray (of course) for things like this,
>
> you can run that on a Linux box?

Not that I'm aware.   It's what I used when I ran Windows.

regarding gts, it seems like Melody might like the Puget Sound and Grand Canyon
models to complement his cool Hawaiian islands animations.   :)
https://www.cc.gatech.edu/projects/large_models/

> > Just as an interesting aside:
> > If anyone understands the file structures well enough, it would be rather
> > interesting to do the conversion completely in SDL,
>
> that does sound, um, a little masochistic.  :-)

I opened STL in text editor, and it's just an issue of syntax.
SDL well and truly sucks for manipulating text, however I wrote a LibreOffice
spreadsheet last night in no time that converts STL to POV-Ray mesh {} format.
Looks like it ought to be just as simple to write something in C, C++, or as a
shell script.
I might continue with my initial efforts in SDL just because it will likely
yield some useful text-handling macros.


STL looks to be just:

solid Mesh

  facet normal -0.296431 -0.955054 -0.000000
    outer loop
      vertex -67.932732 36.474884 24.903671
      vertex -82.486053 40.991966 22.546505
      vertex -67.932732 36.474884 20.042015
    endloop
  endfacet

  ... repeat ...

endsolid Mesh

So I just started with "mesh{", ignored the loop lines, commented out the
normal, consolidated the "vertex" lines into "triangle {<1>, <2>, <3>}", and
closed it with "}"
Done.
[FYI - triangle{} did not like a trailing extra comma after the 3rd vertex]

With regard to the #read directive:
"Undefined identifiers will be turned into global identifiers of the type
determined by the data which is read. Previously defined identifiers remain at
whatever global/local status they had when originally created. Type checking is
performed to insure that the proper type data is read into these identifiers."

It would be SO NICE to have an end-user function in SDL for type-checking data.

> the user ought to have choice of 'mesh' or 'mesh2', imo.

Agreed, but mesh is trivial - my point was only that mesh2 seems to be so
challenging that seeing how to go about coding it would be a valuable tutorial.


Post a reply to this message

Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.