Library for .3d files

Philip Schuchardt vpicaver at gmail.com
Thu Feb 27 18:07:56 GMT 2025


Awesome! Thanks for taking the time to write this!

I'll probably just make a surveximg library in my cmake fork. Then I don't
need to think about copying the files from time to time.

Phi|ip

On Thu, Feb 27, 2025 at 10:02 AM Olly Betts <olly at survex.com> wrote:

> No need to email both the list and me directly.  I'm definitely
> subscribed to the list.
>
> On Thu, Feb 27, 2025 at 09:24:40AM -0800, Philip Schuchardt wrote:
> > It seem like there's 4 files that make up the .3d library:
> >
> > img.h
> > img.c
> > img_hosted.h
> > img_hosted.c
> >
> > Since img_hosted.c just includes img.c, I can probably make a static
> > library from that.
>
> You just want img.c and img.h - the other two are only useful if you're
> building Survex.  They mostly just hook message translation for img
> errors into Survex's translation machinery, which is not useful outside
> of Survex (they used to do more but I've slowly been eliminating that;
> at some point they may go away entirely).
>
> The expected way to use img is that you copy these two files into your
> source tree, and periodically update them (evolution is usually glacial).
> It's not packaged as a separate library for Debian or anywhere else I'm
> aware of (there's a very low number of applications which link to it and
> the effort to do that seems more usefully directed; we also don't
> guarantee ABI stability, but it should be upwardly API compatible).
>
> See imgtest.c for an example program using img in "unhosted mode" (which
> is how you'd use it outside of Survex).  Also dump3d.c shows how to
> access all the different types of data returned (that's built "hosted"
> but only affects the includes, linking and error reporting).
>
> Cheers,
>     Olly
>


More information about the Survex mailing list