Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cream-dxf.ulpの外形カットをDimensionレイヤの線分を使うように変更 #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions cream-dxf.ulp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Copyright (c) 2012 Yoshihiro TSUBOI
// Copyright (c) 2013 Yuuki Uno, NYAMFG.
// Copyright (c) 2015 Junichi Akita (akita11), added board outline cut
// Copyright (c) 2018 Junichi Akita (akita11), board outline as DIMENSION wires

// Configuration
real SHRINK_WIDTH = 0.00; // unit: mm
Expand Down Expand Up @@ -109,6 +110,7 @@ processLayer(UL_BOARD B, int layer) {
int count = 0;
int cream = (layer == LAYER_TOP ? LAYER_TCREAM : LAYER_BCREAM);
printf("%s", HEADER);

B.elements(E) {
E.package.contacts(C) {
if (!C.smd)
Expand Down Expand Up @@ -202,29 +204,26 @@ processLayer(UL_BOARD B, int layer) {
}
// board outline
if (OUTLINE){
real x = (B.area.x1+B.area.x2)/2 / 10000.0;
real y = (B.area.y1+B.area.y2)/2 / 10000.0;
real w = (B.area.x2-B.area.x1) / 10000.0 / 2;
real h = (B.area.y2-B.area.y1) / 10000.0 / 2;
if (EAGLE6 == 1) {
x = x / E6_SCALE;
y = y / E6_SCALE;
w = w / E6_SCALE;
h = h / E6_SCALE;
}
real wc = w;
real hs = 0;
real ws = 0;
real hc = h;
printf(POLYLINE, 4*CUTTIMES + 1, 1); // 1: closed
printf(POLYLINE_POINT, x + wc, y + ws); // ( w, 0)
for (int i = 0; i < CUTTIMES; i++) {
printf(POLYLINE_POINT, x + wc - hs, y + ws + hc); // ( w, h)
printf(POLYLINE_POINT, x - wc - hs, y - ws + hc); // (-w, h)
printf(POLYLINE_POINT, x - wc + hs, y - ws - hc); // (-w, -h)
printf(POLYLINE_POINT, x + wc + hs, y + ws - hc); // ( w, -h)
B.wires(W){
if (W.layer == LAYER_DIMENSION){
real x1 = W.x1 / 10000.0;
real y1 = W.y1 / 10000.0;
real x2 = W.x2 / 10000.0;
real y2 = W.y2 / 10000.0;
if (EAGLE6 == 1) {
x1 = x1 / E6_SCALE;
y1 = y1 / E6_SCALE;
x2 = x2 / E6_SCALE;
y2 = y2 / E6_SCALE;
}
printf(POLYLINE, 2*CUTTIMES + 1, 1);
for (int i = 0; i < CUTTIMES; i++) {
printf(POLYLINE_POINT, x1, y1);
printf(POLYLINE_POINT, x2, y2);
}
count++;
}
}
count++;
}
printf("%s", TRAILER);
return count;
Expand Down Expand Up @@ -283,3 +282,4 @@ board(B) {
}

}