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
24a6c34a
Commit
24a6c34a
authored
Mar 11, 2008
by
peud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ARC and CIRCLE shapes to 3d-viewer when used at module edge or pcb edge.
parent
07a0e142
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
16 deletions
+37
-16
3d_draw.cpp
3d-viewer/3d_draw.cpp
+30
-16
change_log.txt
change_log.txt
+7
-0
No files found.
3d-viewer/3d_draw.cpp
View file @
24a6c34a
...
@@ -325,7 +325,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawSegment( DRAWSEGMENT* segment )
...
@@ -325,7 +325,7 @@ void Pcb3D_GLCanvas::Draw3D_DrawSegment( DRAWSEGMENT* segment )
{
{
glNormal3f
(
0.0
,
0.0
,
(
layer
==
COPPER_LAYER_N
)
?
-
1.0
:
1.0
);
glNormal3f
(
0.0
,
0.0
,
(
layer
==
COPPER_LAYER_N
)
?
-
1.0
:
1.0
);
zpos
=
g_Parm_3D_Visu
.
m_LayerZcoord
[
layer
];
zpos
=
g_Parm_3D_Visu
.
m_LayerZcoord
[
layer
];
switch
(
segment
->
m_Shape
)
switch
(
segment
->
m_Shape
)
{
{
case
S_ARC
:
case
S_ARC
:
Draw3D_ArcSegment
(
x
,
-
y
,
xf
,
-
yf
,
w
,
zpos
);
Draw3D_ArcSegment
(
x
,
-
y
,
xf
,
-
yf
,
w
,
zpos
);
...
@@ -430,7 +430,8 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
...
@@ -430,7 +430,8 @@ void MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
void
EDGE_MODULE
::
Draw3D
(
Pcb3D_GLCanvas
*
glcanvas
)
void
EDGE_MODULE
::
Draw3D
(
Pcb3D_GLCanvas
*
glcanvas
)
/***************************************************/
/***************************************************/
{
{
int
ux0
,
uy0
,
dx
,
dy
,
rayon
,
StAngle
,
EndAngle
;
wxString
s
;
int
dx
,
dy
;
double
scale
,
x
,
y
,
fx
,
fy
,
w
,
zpos
;
double
scale
,
x
,
y
,
fx
,
fy
,
w
,
zpos
;
int
color
=
g_Parm_3D_Visu
.
m_BoardSettings
->
m_LayerColor
[
m_Layer
];
int
color
=
g_Parm_3D_Visu
.
m_BoardSettings
->
m_LayerColor
[
m_Layer
];
...
@@ -441,34 +442,47 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
...
@@ -441,34 +442,47 @@ void EDGE_MODULE::Draw3D( Pcb3D_GLCanvas* glcanvas )
glNormal3f
(
0.0
,
0.0
,
(
m_Layer
==
COPPER_LAYER_N
)
?
-
1.0
:
1.0
);
glNormal3f
(
0.0
,
0.0
,
(
m_Layer
==
COPPER_LAYER_N
)
?
-
1.0
:
1.0
);
scale
=
g_Parm_3D_Visu
.
m_BoardScale
;
scale
=
g_Parm_3D_Visu
.
m_BoardScale
;
ux0
=
m_Start
.
x
;
uy0
=
m_Start
.
y
;
dx
=
m_End
.
x
;
dx
=
m_End
.
x
;
dy
=
m_End
.
y
;
dy
=
m_End
.
y
;
zpos
=
g_Parm_3D_Visu
.
m_LayerZcoord
[
m_Layer
];
zpos
=
g_Parm_3D_Visu
.
m_LayerZcoord
[
m_Layer
];
w
=
m_Width
*
g_Parm_3D_Visu
.
m_BoardScale
;
w
=
m_Width
*
g_Parm_3D_Visu
.
m_BoardScale
;
x
=
m_Start
.
x
*
g_Parm_3D_Visu
.
m_BoardScale
;
y
=
m_Start
.
y
*
g_Parm_3D_Visu
.
m_BoardScale
;
fx
=
dx
*
g_Parm_3D_Visu
.
m_BoardScale
;
fy
=
dy
*
g_Parm_3D_Visu
.
m_BoardScale
;
switch
(
m_Shape
)
switch
(
m_Shape
)
{
{
case
S_SEGMENT
:
case
S_SEGMENT
:
x
=
m_Start
.
x
*
g_Parm_3D_Visu
.
m_BoardScale
;
y
=
m_Start
.
y
*
g_Parm_3D_Visu
.
m_BoardScale
;
fx
=
dx
*
g_Parm_3D_Visu
.
m_BoardScale
;
fy
=
dy
*
g_Parm_3D_Visu
.
m_BoardScale
;
Draw3D_FilledSegment
(
x
,
-
y
,
fx
,
-
fy
,
w
,
zpos
);
Draw3D_FilledSegment
(
x
,
-
y
,
fx
,
-
fy
,
w
,
zpos
);
#if 0
s.Printf("Draw FilledSegment: %g, %g, %g, %g, %g, %g\n",x,-y,fx,-fy,w,zpos);
printf( CONV_TO_UTF8( s ) );
#endif
break
;
break
;
case
S_CIRCLE
:
case
S_CIRCLE
:
rayon
=
(
int
)
hypot
(
(
double
)
(
dx
-
ux0
),
(
double
)
(
dy
-
uy0
)
);
Draw3D_CircleSegment
(
x
,
-
y
,
fx
,
-
fy
,
w
,
zpos
);
/* TO DO */
#if 0
s.Printf("Draw Circle: %g, %g, %g, %g, %g, %g\n",x,-y,fx,-fy,w,zpos);
printf( CONV_TO_UTF8( s ) );
#endif
break
;
break
;
case
S_ARC
:
case
S_ARC
:
rayon
=
(
int
)
hypot
(
(
double
)
(
dx
-
ux0
),
(
double
)
(
dy
-
uy0
)
);
Draw3D_ArcSegment
(
x
,
-
y
,
fx
,
-
fy
,
w
,
zpos
);
StAngle
=
(
int
)
ArcTangente
(
dy
-
uy0
,
dx
-
ux0
);
#if 0
EndAngle
=
StAngle
+
m_Angle
;
s.Printf("Draw Arc: %g, %g, %g, %g, %g, %g\n",x,-y,fx,-fy,w,zpos);
/* TO DO */
printf( CONV_TO_UTF8( s ) );
break
;
#endif
break
;
default
:
s
.
Printf
(
wxT
(
"Error: Shape nr %d not implemented!
\n
"
),
m_Shape
);
printf
(
CONV_TO_UTF8
(
s
)
);
break
;
}
}
}
}
...
...
change_log.txt
View file @
24a6c34a
...
@@ -5,6 +5,13 @@ Started 2007-June-11
...
@@ -5,6 +5,13 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with
Please add newer entries at the top, list the date and your name with
email address.
email address.
2008-Mar-11 UPDATE Per Uddén <p.udden@telia.com>
================================================================================
+3d-viewer
* Fix TODO: Add S_ARC and S_CIRCLE shape render to board edge and module edge.
Ex. Now is a board with arcs at corners showing correctly.
2008-Mar-10 UPDATE Dick Hollenbeck <dick@softplc.com>
2008-Mar-10 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
================================================================================
+pcbnew
+pcbnew
...
...
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