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
6bd572f5
Commit
6bd572f5
authored
Aug 29, 2008
by
dickelbeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix case where first edge segment is an arc
parent
9536bdce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
63 deletions
+64
-63
specctra_export.cpp
pcbnew/specctra_export.cpp
+64
-63
No files found.
pcbnew/specctra_export.cpp
View file @
6bd572f5
...
@@ -748,91 +748,92 @@ void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IOErr
...
@@ -748,91 +748,92 @@ void SPECCTRA_DB::fillBOUNDARY( BOARD* aBoard, BOUNDARY* boundary ) throw( IOErr
items
.
Remove
(
0
);
items
.
Remove
(
0
);
prevPt
=
graphic
->
GetEnd
();
prevPt
=
graphic
->
GetEnd
();
path
->
AppendPoint
(
mapPt
(
graphic
->
GetStart
()
)
);
path
->
AppendPoint
(
mapPt
(
graphic
->
GetEnd
()
)
);
path
->
AppendPoint
(
mapPt
(
graphic
->
GetEnd
()
)
);
while
(
items
.
GetCount
()
)
// do not append the other end point yet, this first edge item might be an arc
for
(;;)
{
{
graphic
=
findPoint
(
prevPt
,
&
items
);
switch
(
graphic
->
m_Shape
)
if
(
graphic
)
{
{
switch
(
graphic
->
m_Shape
)
case
S_ARC
:
// freerouter does not yet understand arcs, so approximate
// an arc with a series of short lines and put those
// line segments into the !same! PATH.
{
{
case
S_ARC
:
const
int
STEPS
=
9
;
// in an arc of 90 degrees
// freerouter does not yet understand arcs, so approximate
// an arc with a series of short lines and put those
wxPoint
start
=
graphic
->
GetStart
();
// line segments into the !same! PATH.
wxPoint
end
=
graphic
->
GetEnd
();
wxPoint
center
=
graphic
->
m_Start
;
int
angle
=
-
graphic
->
m_Angle
;
if
(
prevPt
!=
start
)
{
{
const
int
STEPS
=
9
;
// in an arc of 90 degrees
wxASSERT
(
prevPt
==
graphic
->
GetEnd
()
);
wxPoint
start
=
graphic
->
GetStart
();
angle
=
-
angle
;
wxPoint
end
=
graphic
->
GetEnd
();
EXCHG
(
start
,
end
);
wxPoint
center
=
graphic
->
m_Start
;
}
int
angle
=
-
graphic
->
m_Angle
;
if
(
prevPt
!=
start
)
wxPoint
nextPt
;
{
wxASSERT
(
prevPt
==
graphic
->
GetEnd
()
);
angle
=
-
angle
;
for
(
int
step
=
1
;
step
<=
STEPS
;
++
step
)
EXCHG
(
start
,
end
);
{
}
int
rotation
=
(
angle
*
step
)
/
STEPS
;
wxPoint
nextP
t
;
nextPt
=
star
t
;
for
(
int
step
=
1
;
step
<=
STEPS
;
++
step
)
RotatePoint
(
&
nextPt
.
x
,
&
nextPt
.
y
,
center
.
x
,
center
.
y
,
rotation
);
{
int
rotation
=
(
angle
*
step
)
/
STEPS
;
nextPt
=
start
;
path
->
AppendPoint
(
mapPt
(
nextPt
)
);
}
RotatePoint
(
&
nextPt
.
x
,
&
nextPt
.
y
,
center
.
x
,
center
.
y
,
rotation
);
prevPt
=
nextPt
;
}
break
;
path
->
AppendPoint
(
mapPt
(
nextPt
)
);
case
S_CIRCLE
:
}
// do not output a circle, freerouter does not understand it.
// this might be a mounting hole or something, ignore it without error
break
;
prevPt
=
nextPt
;
default
:
}
{
break
;
wxString
error
;
case
S_CIRCLE
:
error
.
Printf
(
_
(
"Unsupported DRAWSEGMENT type %s"
),
// do not output a circle, freerouter does not understand it.
BOARD_ITEM
::
ShowShape
(
(
Track_Shapes
)
graphic
->
m_Shape
).
GetData
()
);
// this might be a mounting hole or something, ignore it without error
break
;
default
:
ThrowIOError
(
error
);
{
}
wxString
error
;
break
;
error
.
Printf
(
_
(
"Unsupported DRAWSEGMENT type %s"
),
case
S_SEGMENT
:
BOARD_ITEM
::
ShowShape
(
(
Track_Shapes
)
graphic
->
m_Shape
).
GetData
()
);
{
POINT
nextPt
;
ThrowIOError
(
error
);
if
(
prevPt
!=
graphic
->
GetStart
()
)
{
wxASSERT
(
prevPt
==
graphic
->
GetEnd
()
);
nextPt
=
mapPt
(
graphic
->
GetStart
()
);
prevPt
=
graphic
->
GetStart
();
}
}
break
;
else
case
S_SEGMENT
:
{
{
POINT
nextPt
;
nextPt
=
mapPt
(
graphic
->
GetStart
()
);
prevPt
=
graphic
->
GetEnd
();
if
(
prevPt
!=
graphic
->
GetStart
()
)
}
{
wxASSERT
(
prevPt
==
graphic
->
GetEnd
()
);
path
->
AppendPoint
(
nextPt
);
nextPt
=
mapPt
(
graphic
->
GetStart
()
);
}
prevPt
=
graphic
->
GetStart
();
}
else
{
nextPt
=
mapPt
(
graphic
->
GetStart
()
);
prevPt
=
graphic
->
GetEnd
();
}
path
->
AppendPoint
(
nextPt
);
}
}
}
}
else
if
(
items
.
GetCount
()
==
0
)
break
;
graphic
=
findPoint
(
prevPt
,
&
items
);
if
(
!
graphic
)
{
{
wxString
error
;
wxString
error
;
...
...
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