Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
87d2caa4
Commit
87d2caa4
authored
Feb 07, 2014
by
Cirilo Bbernardo
Committed by
jean-pierre charras
Feb 07, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IDF export: fix incorrect rotation of flipped items.
parent
544f987f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
export_idf.cpp
pcbnew/exporters/export_idf.cpp
+3
-1
idf.cpp
pcbnew/exporters/idf.cpp
+27
-5
No files found.
pcbnew/exporters/export_idf.cpp
View file @
87d2caa4
...
...
@@ -334,7 +334,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
refdes
=
aIDFBoard
.
GetRefDes
();
}
double
rotz
=
modfile
->
m_MatRotation
.
z
+
aModule
->
GetOrientation
()
/
10.0
;
double
rotz
=
aModule
->
GetOrientation
()
/
10.0
;
double
locx
=
modfile
->
m_MatPosition
.
x
;
double
locy
=
modfile
->
m_MatPosition
.
y
;
double
locz
=
modfile
->
m_MatPosition
.
z
;
...
...
@@ -343,6 +343,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
if
(
top
)
{
rotz
+=
modfile
->
m_MatRotation
.
z
;
locy
=
-
locy
;
RotatePoint
(
&
locx
,
&
locy
,
aModule
->
GetOrientation
()
);
locy
=
-
locy
;
...
...
@@ -352,6 +353,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
RotatePoint
(
&
locx
,
&
locy
,
aModule
->
GetOrientation
()
);
locy
=
-
locy
;
rotz
-=
modfile
->
m_MatRotation
.
z
;
rotz
=
180.0
-
rotz
;
if
(
rotz
>=
360.0
)
...
...
pcbnew/exporters/idf.cpp
View file @
87d2caa4
...
...
@@ -1055,13 +1055,35 @@ bool IDF_COMP::substituteComponent( FILE* aLibFile )
if
(
parent
->
RegisterOutline
(
"NOGEOM_NOPART"
)
)
return
true
;
// Create a star shape 5mm high with points on 5 and 2.5 mm circles
fprintf
(
aLibFile
,
".ELECTRICAL
\n
"
);
fprintf
(
aLibFile
,
"
\"
NOGEOM
\"
\"
NOPART
\"
MM 5
\n
"
);
// TODO: for now we shall use a simple cylinder; a more intricate
// and readily recognized feature (a stylistic X) would be of
// much greater value.
fprintf
(
aLibFile
,
"0 0 0 0
\n
"
);
fprintf
(
aLibFile
,
"0 2.5 0 360
\n
"
);
double
a
,
da
,
x
,
y
;
da
=
M_PI
/
5.0
;
a
=
da
/
2.0
;
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
if
(
i
&
1
)
{
x
=
2.5
*
cos
(
a
);
y
=
2.5
*
sin
(
a
);
}
else
{
x
=
1.5
*
cos
(
a
);
y
=
1.5
*
sin
(
a
);
}
a
+=
da
;
fprintf
(
aLibFile
,
"0 %.3f %.3f 0
\n
"
,
x
,
y
);
}
a
=
da
/
2.0
;
x
=
1.5
*
cos
(
a
);
y
=
1.5
*
sin
(
a
);
fprintf
(
aLibFile
,
"0 %.3f %.3f 0
\n
"
,
x
,
y
);
fprintf
(
aLibFile
,
".END_ELECTRICAL
\n\n
"
);
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment