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
d545c698
Commit
d545c698
authored
Apr 10, 2015
by
unknown
Committed by
jean-pierre charras
Apr 10, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3D vrml export: fix for bug #1441734
parent
44d6595c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
28 deletions
+9
-28
3d_read_mesh.cpp
3d-viewer/3d_read_mesh.cpp
+7
-19
export_vrml.cpp
pcbnew/exporters/export_vrml.cpp
+2
-9
No files found.
3d-viewer/3d_read_mesh.cpp
View file @
d545c698
...
...
@@ -54,20 +54,8 @@ S3D_MODEL_PARSER *S3D_MODEL_PARSER::Create( S3D_MASTER* aMaster,
int
S3D_MASTER
::
ReadData
(
S3D_MODEL_PARSER
*
aParser
)
{
if
(
m_Shape3DName
.
IsEmpty
()
)
{
//DBG( printf("m_Shape3DName.IsEmpty") );
return
-
1
;
}
if
(
m_Shape3DFullFilename
.
IsEmpty
()
)
{
//DBG( printf("m_Shape3DFullFilename.IsEmpty") );
return
-
1
;
}
if
(
aParser
==
NULL
)
{
if
(
m_Shape3DFullFilename
.
IsEmpty
()
||
aParser
==
NULL
)
return
-
1
;
wxString
filename
=
m_Shape3DFullFilename
;
...
...
@@ -107,7 +95,7 @@ void S3D_MASTER::Render( bool aIsRenderingJustNonTransparentObjects,
{
if
(
m_parser
==
NULL
)
return
;
double
aVrmlunits_to_3Dunits
=
g_Parm_3D_Visu
.
m_BiuTo3Dunits
*
UNITS3D_TO_UNITSPCB
;
glScalef
(
aVrmlunits_to_3Dunits
,
aVrmlunits_to_3Dunits
,
aVrmlunits_to_3Dunits
);
...
...
@@ -141,7 +129,7 @@ CBBOX &S3D_MASTER::getFastAABBox( )
{
if
(
!
m_fastAABBox
.
IsInitialized
()
)
calcBBox
();
return
m_fastAABBox
;
}
...
...
@@ -152,7 +140,7 @@ void S3D_MASTER::calcBBox()
return
;
bool
firstBBox
=
true
;
for
(
unsigned
int
idx
=
0
;
idx
<
m_parser
->
childs
.
size
();
idx
++
)
if
(
firstBBox
)
{
...
...
@@ -175,7 +163,7 @@ void S3D_MASTER::calcBBox()
fullTransformMatrix
=
glm
::
translate
(
fullTransformMatrix
,
S3D_VERTEX
(
m_MatPosition
.
x
*
SCALE_3D_CONV
,
m_MatPosition
.
y
*
SCALE_3D_CONV
,
m_MatPosition
.
z
*
SCALE_3D_CONV
)
);
if
(
m_MatRotation
.
z
!=
0.0
)
fullTransformMatrix
=
glm
::
rotate
(
fullTransformMatrix
,
glm
::
radians
(
-
(
float
)
m_MatRotation
.
z
),
S3D_VERTEX
(
0.0
f
,
0.0
f
,
1.0
f
)
);
if
(
m_MatRotation
.
y
!=
0.0
)
...
...
@@ -184,7 +172,7 @@ void S3D_MASTER::calcBBox()
fullTransformMatrix
=
glm
::
rotate
(
fullTransformMatrix
,
glm
::
radians
(
-
(
float
)
m_MatRotation
.
x
),
S3D_VERTEX
(
1.0
f
,
0.0
f
,
0.0
f
)
);
fullTransformMatrix
=
glm
::
scale
(
fullTransformMatrix
,
S3D_VERTEX
(
m_MatScale
.
x
,
m_MatScale
.
y
,
m_MatScale
.
z
)
);
// Apply transformation
m_fastAABBox
=
m_BBox
;
m_fastAABBox
.
ApplyTransformationAA
(
fullTransformMatrix
);
...
...
pcbnew/exporters/export_vrml.cpp
View file @
d545c698
...
...
@@ -4,7 +4,7 @@
* Copyright (C) 2009-2013 Lorenzo Mercantonio
* Copyright (C) 2014 Cirilo Bernado
* Copyright (C) 2013 Jean-Pierre Charras jp.charras at wanadoo.fr
* Copyright (C) 2004-201
3
KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2004-201
5
KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
...
...
@@ -893,7 +893,6 @@ static void export_vrml_zones( MODEL_VRML& aModel, BOARD* aPcb )
const
CPOLYGONS_LIST
&
poly
=
zone
->
GetFilledPolysList
();
int
nvert
=
poly
.
GetCornersCount
();
int
i
=
0
;
bool
cutout
=
false
;
while
(
i
<
nvert
)
{
...
...
@@ -916,13 +915,7 @@ static void export_vrml_zones( MODEL_VRML& aModel, BOARD* aPcb )
++
i
;
}
// KiCad ensures that the first polygon is the outline
// and all others are holes
vl
->
EnsureWinding
(
seg
,
cutout
);
if
(
!
cutout
)
cutout
=
true
;
vl
->
EnsureWinding
(
seg
,
false
);
++
i
;
}
}
...
...
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