POV-Ray : Newsgroups : povray.general : Reading mesh2 data from file : Re: Reading mesh2 data from file Server Time
18 Apr 2024 00:28:28 EDT (-0400)
  Re: Reading mesh2 data from file  
From: Kima
Date: 5 Jul 2021 03:50:00
Message: <web.60e2b882c54a2bf0e75ac487d427f3e5@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:

> odd, yes. :-)  I gather that the "script in C" is your own, so what I do not
> understand is, why not keep everything in RAM until all calculations are done,
> and do the "fprintf()"s after?  (my own effort too is in C, make use of it if
> you wish
>
<https://news.povray.org/povray.text.scene-files/message/%3Cweb.5e2ec3f92af4d0a48c662f470%40news.povray.org%3E/#%3Cwe
b.
> 5e2ec3f92af4d0a48c662f470%40news.povray.org%3E>)
>
>
> regards, jr.

Thanks for sharing your script. It's quite sophisticated. Mine is messy :)

For two reasons, I directly use fprintf():

1. The mesh may get large, and surely I will have stack overflow. Thus, I have
to allocate the memory dynamically to keep all the data in memory. The memory
footprint is trivial for the modern machines, but I considered to be safer to
directly write them to the files.

2. When saving the data in raw forms (vectors), I can easily create other mesh
formats from the separate files. It is unlikely, as I only use POV-Ray, but it's
not a bad idea to keep the system flexible for future expansion.


Post a reply to this message

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