Re: [Gerbv-devel] gerber file not being included
Brought to you by:
spetm,
thepurlieu
From: Robert v. K. <bo...@en...> - 2013-07-23 07:59:40
|
On 23/07/13 05:51, Dan McMahill wrote: > When you generate the file from Eagle, is there an option to specify the > file type? I am guessing that you have some project setting which is > causing you to get the older format for this project. If you look in > the fab.gbr file, you should see aperture definitions near the top. If > not, then there should be a separate aperture table from Eagle but that > is not really the best way to go. It is far better to find whatever > setting there is to have the aperture definitions as part of the output > file. > > -Dan > > On 7/4/2013 5:19 AM, Robert von Knobloch wrote: >> Using libgerbv to process gerber files from eagle, I get: >> >> WARNING **: Most likely found a RS-274D file...trying to open anyways >> >> and the file is not included in the output png. >> This only occurs with some projects and not others, although all have >> the same file name "fab.gbr". >> Any pointers as to where to look? >> >> Thanks, >> >> Bob > The files from 'good' projects appear identical to those from 'bad' ones (apart from the actual data, that is). Even worse, my gerbv script produces both back and front assembly views and it is only the back view that produce the error (and only on some projects), although the 'fab.gbr' layer is processed for both back & front views. This is confusing me a bit. Here is my gerbv script source (sorry if it's a bit long), the component side bit seems always to work, the solder side gives the problem on some files only: ====================================================== #include "gerbv.h" int main(int argc, char *argv[]) { if (argc != 2) // Right No. of args ? { printf("Usage: %s <path to project>\n", argv[0]); return(1); } if (chdir(argv[1]) != 0) // Change to working directory ok ? { printf("%s: No such path!\n", argv[1]); return(1); } gerbv_project_t *mainProject; GdkColor whiteColor = {0, 65000, 65000, 65000}; // Define colours GdkColor blackColor = {0, 0, 0, 0}; GdkColor greenishColor = {0, 40000, 64000, 40000}; GdkColor greyColor = {0, 50000, 50000, 50000}; GdkColor blueColor = {0, 0, 0, 65000}; GdkColor goldColor = {0, 50000, 50000, 0}; /* ******************************************************************************* Process COMPONENT SIDE PLACEMENT ******************************************************************************* */ mainProject = gerbv_create_project(); // Create a top level libgerbv structure mainProject->background = whiteColor; // Set background = WHITE // Parse Gerber files and store them in the gerbv_project_t struct gerbv_open_layer_from_filename (mainProject, "frontsilk.gbr"); if (mainProject->file[0] == NULL) goto parse_error; gerbv_open_layer_from_filename (mainProject, "frontmask.gbr"); if (mainProject->file[1] == NULL) goto parse_error; gerbv_open_layer_from_filename (mainProject, "front.gbr"); if (mainProject->file[2] == NULL) goto parse_error; gerbv_open_layer_from_filename (mainProject, "fab.gbr"); if (mainProject->file[3] == NULL) goto parse_error; mainProject->file[0]->color = blackColor; mainProject->file[1]->color = greyColor; mainProject->file[2]->color = greenishColor; mainProject->file[3]->color = blackColor; // Export a rendered PNG image of the project, using the autoscale version to automatically center the image gerbv_export_png_file_from_project_autoscaled (mainProject, 2000, 1500, "frontplace.png"); // Destroy the project, which will in turn destroy all child images gerbv_destroy_project (mainProject); /* ******************************************************************************* Process SOLDER SIDE PLACEMENT ******************************************************************************* */ mainProject = gerbv_create_project(); // Create a top level libgerbv structure mainProject->background = whiteColor; // Set background = WHITE // Parse Gerber files and store them in the gerbv_project_t struct gerbv_open_layer_from_filename (mainProject, "backsilk.gbr"); if (mainProject->file[0] == NULL) goto parse_error; gerbv_open_layer_from_filename (mainProject, "backmask.gbr"); if (mainProject->file[1] == NULL) goto parse_error; gerbv_open_layer_from_filename (mainProject, "back.gbr"); if (mainProject->file[2] == NULL) goto parse_error; gerbv_open_layer_from_filename (mainProject, "fab.gbr"); if (mainProject->file[3] == NULL) goto parse_error; // Flip the gerber in the X-axis (affects the origin so don't combine with unflipped layers e.g. fab) mainProject->file[0]->transform.scaleX = -1.0; mainProject->file[1]->transform.scaleX = -1.0; mainProject->file[2]->transform.scaleX = -1.0; mainProject->file[3]->transform.scaleX = -1.0; mainProject->file[0]->color = blackColor; mainProject->file[1]->color = greyColor; mainProject->file[2]->color = greenishColor; mainProject->file[3]->color = blackColor; // Export a rendered PNG image of the project, using the autoscale version to automatically center the image gerbv_export_png_file_from_project_autoscaled (mainProject, 2000, 1500, "backplace.png"); // Destroy the project, which will in turn destroy all child images gerbv_destroy_project (mainProject); return 0; parse_error: g_error ("There was an error parsing the file."); return 1; ========================================================= |