Post by Sergey AlyoshinI have done panelization with "RS-274X Merge (Gerber)..." which use
merge_images().
I have been using it now in order to produce a large panel.
It's indeed a very nice option, thank you!
I have one suggestion: when merging the copper layers, gerbv suddenly
told me about being unable to rotate rectangular and oval shapes,
claiming the rotation angle would be non-multiple of 90 degrees (which
is basically impossible here).
This is due to the comparison of the double value trans->rotation
against absolute numbers. Such comparison is valid for absolute
0.0 (which always has a well-defined binary represantation), but
it's error-prone for values like M_PI etc.
The following patch makes it work as intended:
diff --git a/src/gerb_image.c b/src/gerb_image.c
index 257f055..1436702 100644
--- a/src/gerb_image.c
+++ b/src/gerb_image.c
@@ -590,20 +590,16 @@ gerbv_image_copy_all_nets (gerbv_image_t *sourceImage,
case GERBV_APTYPE_OVAL:
if (trans->scaleX == trans->scaleY
&& trans->scaleX == 1.0
- && (fabs(trans->rotation) == M_PI
- || fabs(trans->rotation) == DEG2RAD(180)))
- break; /* DEG2RAD for calc error */
+ && (fabs(trans->rotation - M_PI) < 1E-6))
+ break;
aper = gerbv_image_duplicate_aperture (
destImage->aperture[newNet->aperture]);
aper->parameter[0] *= trans->scaleX;
aper->parameter[1] *= trans->scaleY;
- if (fabs(trans->rotation) == M_PI_2
- || fabs(trans->rotation) == DEG2RAD(90)
- || fabs(trans->rotation) == (M_PI+M_PI_2)
- || fabs(trans->rotation) == DEG2RAD(270)) {
- /* DEG2RAD for calc error */
+ if (fabs(trans->rotation - M_PI_2) < 1E-6
+ || fabs(trans->rotation - (M_PI+M_PI_2)) < 1E-6) {
double t = aper->parameter[0];
aper->parameter[0] = aper->parameter[1];
aper->parameter[1] = t;
--
cheers, Joerg .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/
Never trust an operating system you don't have sources for. ;-)