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
53cd19a6
Commit
53cd19a6
authored
Jun 08, 2014
by
unknown
Committed by
jean-pierre charras
Jun 08, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VRML export rewritten
parent
bd174ebf
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
328 additions
and
2143 deletions
+328
-2143
CMakeLists.txt
pcbnew/CMakeLists.txt
+0
-1
export_idf.cpp
pcbnew/exporters/export_idf.cpp
+1
-1
export_vrml.cpp
pcbnew/exporters/export_vrml.cpp
+287
-223
vrml_board.cpp
pcbnew/exporters/vrml_board.cpp
+0
-1501
vrml_board.h
pcbnew/exporters/vrml_board.h
+0
-379
idf_outlines.cpp
utils/idftools/idf_outlines.cpp
+9
-9
idf_parser.cpp
utils/idftools/idf_parser.cpp
+7
-7
vrml_layer.cpp
utils/idftools/vrml_layer.cpp
+23
-22
vrml_layer.h
utils/idftools/vrml_layer.h
+1
-0
No files found.
pcbnew/CMakeLists.txt
View file @
53cd19a6
...
...
@@ -140,7 +140,6 @@ set( PCBNEW_EXPORTERS
exporters/gen_drill_report_files.cpp
exporters/gen_modules_placefile.cpp
exporters/gendrill_Excellon_writer.cpp
exporters/vrml_board.cpp
)
set
(
PCBNEW_AUTOROUTER_SRCS
...
...
pcbnew/exporters/export_idf.cpp
View file @
53cd19a6
...
...
@@ -568,7 +568,7 @@ bool Export_IDF3( BOARD* aPcb, const wxString& aFullFileName, bool aUseThou )
ok
=
false
;
}
catch
(
std
::
exception
&
e
)
catch
(
const
std
::
exception
&
e
)
{
wxString
msg
;
msg
<<
_
(
"IDF Export Failed:
\n
"
)
<<
FROM_UTF8
(
e
.
what
()
);
...
...
pcbnew/exporters/export_vrml.cpp
View file @
53cd19a6
This diff is collapsed.
Click to expand it.
pcbnew/exporters/vrml_board.cpp
deleted
100644 → 0
View file @
bd174ebf
This diff is collapsed.
Click to expand it.
pcbnew/exporters/vrml_board.h
deleted
100644 → 0
View file @
bd174ebf
This diff is collapsed.
Click to expand it.
utils/idftools/idf_outlines.cpp
View file @
53cd19a6
...
...
@@ -775,7 +775,7 @@ void BOARD_OUTLINE::writeOutline( std::ofstream& aBoardFile, IDF_OUTLINE* aOutli
aBoardFile
<<
aIndex
<<
" "
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
5
)
<<
aOutline
->
front
()
->
startPoint
.
x
<<
" "
<<
aOutline
->
front
()
->
startPoint
.
y
<<
" "
<<
setprecision
(
5
)
<<
-
aOutline
->
front
()
->
angle
<<
"
\n
"
;
<<
setprecision
(
2
)
<<
-
aOutline
->
front
()
->
angle
<<
"
\n
"
;
}
}
else
...
...
@@ -799,7 +799,7 @@ void BOARD_OUTLINE::writeOutline( std::ofstream& aBoardFile, IDF_OUTLINE* aOutli
aBoardFile
<<
aIndex
<<
" "
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
1
)
<<
(
aOutline
->
front
()
->
startPoint
.
x
/
IDF_THOU_TO_MM
)
<<
" "
<<
(
aOutline
->
front
()
->
startPoint
.
y
/
IDF_THOU_TO_MM
)
<<
" "
<<
setprecision
(
5
)
<<
-
aOutline
->
front
()
->
angle
<<
"
\n
"
;
<<
setprecision
(
2
)
<<
-
aOutline
->
front
()
->
angle
<<
"
\n
"
;
}
}
...
...
@@ -819,7 +819,7 @@ void BOARD_OUTLINE::writeOutline( std::ofstream& aBoardFile, IDF_OUTLINE* aOutli
aBoardFile
<<
aIndex
<<
" "
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
5
)
<<
(
*
bo
)
->
startPoint
.
x
<<
" "
<<
(
*
bo
)
->
startPoint
.
y
<<
" "
<<
setprecision
(
5
)
<<
-
(
*
bo
)
->
angle
<<
"
\n
"
;
<<
setprecision
(
2
)
<<
-
(
*
bo
)
->
angle
<<
"
\n
"
;
}
}
else
...
...
@@ -835,7 +835,7 @@ void BOARD_OUTLINE::writeOutline( std::ofstream& aBoardFile, IDF_OUTLINE* aOutli
aBoardFile
<<
aIndex
<<
" "
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
1
)
<<
((
*
bo
)
->
startPoint
.
x
/
IDF_THOU_TO_MM
)
<<
" "
<<
((
*
bo
)
->
startPoint
.
y
/
IDF_THOU_TO_MM
)
<<
" "
<<
setprecision
(
5
)
<<
-
(
*
bo
)
->
angle
<<
"
\n
"
;
<<
setprecision
(
2
)
<<
-
(
*
bo
)
->
angle
<<
"
\n
"
;
}
}
...
...
@@ -869,7 +869,7 @@ void BOARD_OUTLINE::writeOutline( std::ofstream& aBoardFile, IDF_OUTLINE* aOutli
aBoardFile
<<
aIndex
<<
" "
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
5
)
<<
(
*
bo
)
->
endPoint
.
x
<<
" "
<<
(
*
bo
)
->
endPoint
.
y
<<
" "
<<
setprecision
(
5
)
<<
(
*
bo
)
->
angle
<<
"
\n
"
;
<<
setprecision
(
2
)
<<
(
*
bo
)
->
angle
<<
"
\n
"
;
}
}
else
...
...
@@ -893,7 +893,7 @@ void BOARD_OUTLINE::writeOutline( std::ofstream& aBoardFile, IDF_OUTLINE* aOutli
aBoardFile
<<
aIndex
<<
" "
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
1
)
<<
((
*
bo
)
->
endPoint
.
x
/
IDF_THOU_TO_MM
)
<<
" "
<<
((
*
bo
)
->
endPoint
.
y
/
IDF_THOU_TO_MM
)
<<
" "
<<
setprecision
(
5
)
<<
(
*
bo
)
->
angle
<<
"
\n
"
;
<<
setprecision
(
2
)
<<
(
*
bo
)
->
angle
<<
"
\n
"
;
}
}
...
...
@@ -915,7 +915,7 @@ void BOARD_OUTLINE::writeOutline( std::ofstream& aBoardFile, IDF_OUTLINE* aOutli
aBoardFile
<<
aIndex
<<
" "
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
5
)
<<
(
*
bo
)
->
endPoint
.
x
<<
" "
<<
(
*
bo
)
->
endPoint
.
y
<<
" "
<<
setprecision
(
5
)
<<
(
*
bo
)
->
angle
<<
"
\n
"
;
<<
setprecision
(
2
)
<<
(
*
bo
)
->
angle
<<
"
\n
"
;
}
}
else
...
...
@@ -931,7 +931,7 @@ void BOARD_OUTLINE::writeOutline( std::ofstream& aBoardFile, IDF_OUTLINE* aOutli
aBoardFile
<<
aIndex
<<
" "
<<
setiosflags
(
ios
::
fixed
)
<<
setprecision
(
1
)
<<
((
*
bo
)
->
endPoint
.
x
/
IDF_THOU_TO_MM
)
<<
" "
<<
((
*
bo
)
->
endPoint
.
y
/
IDF_THOU_TO_MM
)
<<
" "
<<
setprecision
(
5
)
<<
(
*
bo
)
->
angle
<<
"
\n
"
;
<<
setprecision
(
2
)
<<
(
*
bo
)
->
angle
<<
"
\n
"
;
}
}
...
...
@@ -1281,7 +1281,7 @@ bool BOARD_OUTLINE::addOutline( IDF_OUTLINE* aOutline )
outlines
.
push_back
(
aOutline
);
}
catch
(
std
::
exception
&
e
)
catch
(
const
std
::
exception
&
e
)
{
errormsg
=
e
.
what
();
...
...
utils/idftools/idf_parser.cpp
View file @
53cd19a6
...
...
@@ -2382,7 +2382,7 @@ void IDF3_BOARD::readBoardFile( const std::string& aFileName, bool aNoSubstitute
}
}
}
catch
(
std
::
exception
&
e
)
catch
(
const
std
::
exception
&
e
)
{
brd
.
exceptions
(
std
::
ios_base
::
goodbit
);
...
...
@@ -2689,7 +2689,7 @@ void IDF3_BOARD::readLibFile( const std::string& aFileName )
while
(
lib
.
good
()
)
readLibSection
(
lib
,
state
,
this
);
}
catch
(
std
::
exception
&
e
)
catch
(
const
std
::
exception
&
e
)
{
lib
.
exceptions
(
std
::
ios_base
::
goodbit
);
...
...
@@ -2773,7 +2773,7 @@ bool IDF3_BOARD::ReadFile( const wxString& aFullFileName, bool aNoSubstituteOutl
// read the board file
readBoardFile
(
bfname
,
aNoSubstituteOutlines
);
}
catch
(
std
::
exception
&
e
)
catch
(
const
std
::
exception
&
e
)
{
Clear
();
errormsg
=
e
.
what
();
...
...
@@ -2821,7 +2821,7 @@ bool IDF3_BOARD::writeLibFile( const std::string& aFileName )
}
}
catch
(
std
::
exception
&
e
)
catch
(
const
std
::
exception
&
e
)
{
lib
.
exceptions
(
std
::
ios_base
::
goodbit
);
...
...
@@ -3065,7 +3065,7 @@ void IDF3_BOARD::writeBoardFile( const std::string& aFileName )
}
}
catch
(
std
::
exception
&
e
)
catch
(
const
std
::
exception
&
e
)
{
brd
.
exceptions
(
std
::
ios_base
::
goodbit
);
...
...
@@ -3137,7 +3137,7 @@ bool IDF3_BOARD::WriteFile( const wxString& aFullFileName, bool aUnitMM, bool aF
writeBoardFile
(
bfname
);
}
catch
(
std
::
exception
&
e
)
catch
(
const
std
::
exception
&
e
)
{
errormsg
=
e
.
what
();
...
...
@@ -3901,7 +3901,7 @@ IDF3_COMP_OUTLINE* IDF3_BOARD::GetComponentOutline( wxString aFullFileName )
}
}
// while( true )
}
catch
(
std
::
exception
&
e
)
catch
(
const
std
::
exception
&
e
)
{
delete
cp
;
...
...
utils/idftools/vrml_layer.cpp
View file @
53cd19a6
...
...
@@ -230,8 +230,7 @@ void VRML_LAYER::Clear( void )
contours
.
pop_back
();
}
while
(
!
areas
.
empty
()
)
areas
.
pop_back
();
areas
.
clear
();
for
(
i
=
vertices
.
size
();
i
>
0
;
--
i
)
{
...
...
@@ -254,8 +253,7 @@ void VRML_LAYER::clearTmp( void )
ord
=
0
;
glcmd
=
0
;
while
(
!
triplets
.
empty
()
)
triplets
.
pop_back
();
triplets
.
clear
();
for
(
i
=
outline
.
size
();
i
>
0
;
--
i
)
{
...
...
@@ -263,8 +261,7 @@ void VRML_LAYER::clearTmp( void )
outline
.
pop_back
();
}
for
(
i
=
ordmap
.
size
();
i
>
0
;
--
i
)
ordmap
.
pop_back
();
ordmap
.
clear
();
for
(
i
=
extra_verts
.
size
();
i
>
0
;
--
i
)
{
...
...
@@ -274,8 +271,7 @@ void VRML_LAYER::clearTmp( void )
// note: unlike outline and extra_verts,
// vlist is not responsible for memory management
for
(
i
=
vlist
.
size
();
i
>
0
;
--
i
)
vlist
.
pop_back
();
vlist
.
clear
();
// go through the vertex list and reset ephemeral parameters
for
(
i
=
0
;
i
<
vertices
.
size
();
++
i
)
...
...
@@ -743,6 +739,7 @@ bool VRML_LAYER::Tesselate( VRML_LAYER* holes )
// open the polygon
gluTessBeginPolygon
(
tess
,
this
);
// add solid outlines
pushVertices
(
false
);
// close the polygon
...
...
@@ -751,8 +748,10 @@ bool VRML_LAYER::Tesselate( VRML_LAYER* holes )
if
(
Fault
)
return
false
;
// push the (solid) outline to the tesselator
if
(
!
pushOutline
(
holes
)
)
// at this point we have a solid outline; add it to the tesselator
gluTessBeginPolygon
(
tess
,
this
);
if
(
!
pushOutline
(
NULL
)
)
return
false
;
// add the holes contained by this object
...
...
@@ -772,14 +771,14 @@ bool VRML_LAYER::Tesselate( VRML_LAYER* holes )
// erase the previous outline data and vertex order
// but preserve the extra vertices
for
(
int
i
=
outline
.
size
();
i
>
0
;
--
i
)
while
(
!
outline
.
empty
()
)
{
delete
outline
.
back
();
outline
.
pop_back
();
}
for
(
unsigned
int
i
=
ordmap
.
size
();
i
>
0
;
--
i
)
ordmap
.
pop_back
()
;
ordmap
.
clear
();
ord
=
0
;
// go through the vertex lists and reset ephemeral parameters
for
(
unsigned
int
i
=
0
;
i
<
vertices
.
size
();
++
i
)
...
...
@@ -792,14 +791,16 @@ bool VRML_LAYER::Tesselate( VRML_LAYER* holes )
extra_verts
[
i
]
->
o
=
-
1
;
}
ord
=
0
;
// close the polygon; we now have all the data necessary for the tesselation
// close the polygon; this creates the outline points
// and the point ordering list 'ordmap'
gluTessEndPolygon
(
tess
);
// request a tesselated surface
// repeat the last operation but request a tesselated surface
// rather than an outline; this creates the triangles list.
gluTessProperty
(
tess
,
GLU_TESS_BOUNDARY_ONLY
,
GL_FALSE
);
gluTessBeginPolygon
(
tess
,
this
);
if
(
!
pushOutline
(
holes
)
)
return
false
;
...
...
@@ -821,8 +822,6 @@ bool VRML_LAYER::pushOutline( VRML_LAYER* holes )
return
false
;
}
gluTessBeginPolygon
(
tess
,
this
);
std
::
list
<
std
::
list
<
int
>*>::
const_iterator
obeg
=
outline
.
begin
();
std
::
list
<
std
::
list
<
int
>*>::
const_iterator
oend
=
outline
.
end
();
...
...
@@ -851,6 +850,7 @@ bool VRML_LAYER::pushOutline( VRML_LAYER* holes )
if
(
pi
<
0
||
(
unsigned
int
)
pi
>
ordmap
.
size
()
)
{
gluTessEndContour
(
tess
);
error
=
"pushOutline():BUG: *outline.begin() is not a valid index to ordmap"
;
return
false
;
}
...
...
@@ -862,6 +862,7 @@ bool VRML_LAYER::pushOutline( VRML_LAYER* holes )
if
(
!
vp
)
{
gluTessEndContour
(
tess
);
error
=
"pushOutline():: BUG: ordmap[n] is not a valid index to vertices[]"
;
return
false
;
}
...
...
@@ -1194,9 +1195,9 @@ bool VRML_LAYER::addTriplet( VERTEX_3D* p0, VERTEX_3D* p1, VERTEX_3D* p2 )
double
dy0
=
p1
->
y
-
p0
->
y
;
double
dy1
=
p2
->
y
-
p0
->
y
;
// this number is chosen because we shall only write
6
decimal places
// on the VRML output
double
err
=
0.000001
;
// this number is chosen because we shall only write
9
decimal places
//
at most
on the VRML output
double
err
=
0.00000
000
1
;
// test if the triangles are degenerate (parallel sides)
...
...
utils/idftools/vrml_layer.h
View file @
53cd19a6
...
...
@@ -96,6 +96,7 @@ private:
bool
fix
;
// when true, no more vertices may be added by the user
int
idx
;
// vertex index (number of contained vertices)
int
ord
;
// vertex order (number of ordered vertices)
unsigned
int
idxout
;
// outline index to first point in 3D outline
std
::
vector
<
VERTEX_3D
*>
vertices
;
// vertices of all contours
std
::
vector
<
std
::
list
<
int
>*>
contours
;
// lists of vertices for each contour
std
::
vector
<
double
>
areas
;
// area of the contours (positive if winding is CCW)
...
...
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