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
5e377235
Commit
5e377235
authored
Jan 15, 2011
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pcbnew: Fix wrml export bug when a 3D shape has offset.
parent
73585a85
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
export_vrml.cpp
pcbnew/export_vrml.cpp
+13
-3
No files found.
pcbnew/export_vrml.cpp
View file @
5e377235
...
@@ -1085,10 +1085,20 @@ static void export_vrml_module( BOARD* aPcb, MODULE* aModule,
...
@@ -1085,10 +1085,20 @@ static void export_vrml_module( BOARD* aPcb, MODULE* aModule,
vrmlm
->
m_MatScale
.
x
*
aScalingFactor
,
vrmlm
->
m_MatScale
.
x
*
aScalingFactor
,
vrmlm
->
m_MatScale
.
y
*
aScalingFactor
,
vrmlm
->
m_MatScale
.
y
*
aScalingFactor
,
vrmlm
->
m_MatScale
.
z
*
aScalingFactor
);
vrmlm
->
m_MatScale
.
z
*
aScalingFactor
);
/* adjust 3D shape offset position (offset is given inch) */
#define UNITS_3D_TO_PCB_UNITS PCB_INTERNAL_UNIT
int
offsetx
=
wxRound
(
vrmlm
->
m_MatPosition
.
x
*
UNITS_3D_TO_PCB_UNITS
);
int
offsety
=
wxRound
(
vrmlm
->
m_MatPosition
.
y
*
UNITS_3D_TO_PCB_UNITS
);
double
offsetz
=
vrmlm
->
m_MatPosition
.
z
*
UNITS_3D_TO_PCB_UNITS
;
RotatePoint
(
&
offsetx
,
&
offsety
,
aModule
->
m_Orient
);
if
(
isFlipped
)
NEGATE
(
offsetz
);
fprintf
(
aOutputFile
,
" translation %g %g %g
\n
"
,
fprintf
(
aOutputFile
,
" translation %g %g %g
\n
"
,
vrmlm
->
m_MatPosition
.
x
+
aModule
->
m_Pos
.
x
,
(
double
)
(
offsetx
+
aModule
->
m_Pos
.
x
)
,
-
vrmlm
->
m_MatPosition
.
y
-
aModule
->
m_Pos
.
y
,
-
(
double
)(
offsety
+
aModule
->
m_Pos
.
y
),
// Y axis is reversed in pcbnew
vrmlm
->
m_MatPosition
.
z
+
layer_z
[
aModule
->
GetLayer
()]
);
offset
z
+
layer_z
[
aModule
->
GetLayer
()]
);
fprintf
(
aOutputFile
,
fprintf
(
aOutputFile
,
" children [
\n
Inline {
\n
url
\"
%s
\"\n
} ]
\n
"
,
" children [
\n
Inline {
\n
url
\"
%s
\"\n
} ]
\n
"
,
CONV_TO_UTF8
(
fname
)
);
CONV_TO_UTF8
(
fname
)
);
...
...
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