[Gerbv-devel] Possible libgerbv image size bug
Brought to you by:
spetm,
thepurlieu
From: Erik W. <er...@ba...> - 2009-01-19 19:42:53
|
Hi All, Not sure who would know would know about this so I'll just ask generally. This may be a bug, or it may be that I am not using libgerbv correctly. I have a little program that attempts to determine the extents of a gerber image - it uses the following code: <code> gerbv_project_t *m_project = gerbv_create_project(); /* parse the Gerber file and store it in the gerbv_project_t struct */ gerbv_open_layer_from_filename (m_project, infile); /* make sure we parsed the file - these functions do not return anything so we just have to check if the file is null ..*/ if (m_project->file[0] == NULL) printf("Error: Unable to open file %s", infile); else { if(verbose) printf("\tFile: %s\n",m_project->file[0]->name); printf("X Max: %f\nY Max: %f\nX Min: %f\nY Min: %f\n", m_project->file[0]->image->info->max_x, m_project->file[0]->image->info->max_y, m_project->file[0]->image->info->min_x, m_project->file[0]->image->info->min_y ); } </code> I am occasionally getting both spurious and incorrect coordinates from this. It will sometimes return a coordinate that is not found in the gerber at all (Y axis seems particularly troublesome ..). I can provide example gerbers if in fact I am not simply misusing something. The error is not frequent - on batchpcb.com I started using this about one month ago and have only gotten a few reports, but I would like to figure it out. BTW, even though this is a trivial implementation I am happy to add it (and gbr2png for creating images) to the code base at any time - assuming I can make it work correctly. Also, you can see gbr2png at work on the site now if you upload a design :). Thanks very much, Erik Winn er...@ba... |