[PATCH] 3D Charting / Modelling

29 views
Skip to first unread message

Mark Liversedge

unread,
Dec 28, 2009, 7:27:26 AM12/28/09
to golden-cheetah-users
Attached a patch and screenshot of a new tab for 3d charting and modelling of data. Big thanks to Greg Steele for the ideas and testing and feedback (and build testing on his Mac).

You will need to download, build and then install the qwtplot3d library (its quite small and is a Qt based lib). It uses OpenGL which is available with Qt for all supported platforms (Linux, Windows, Mac). You can get it here: http://qwtplot3d.sourceforge.net/web/navigation/download_frame.html.

I'm pretty proud of the results, in terms of a 3d charting tool, BUT, the question remains - 'So what?'. I would be really interested to hear of any interesting charts that highlight something meaningful, so we can add them to the 'preset' chart settings you will see at the top of the chart window.

Applies cleanly to head.

I need to get back to internet racing with Justin since he's worked on a server and I've been monkeying around with this and spending time with the kids etc.

Enjoy!

Here is the commit message:
A new tab on the ride analysis view for analysing ride data in three
dimensions. Interval selection is supported and a z-axis slider is
available for helping to identify data in the z-plane.

Coloring and Z axis values are averages for associated values of x/y.
The code requires qwtplot3d to be installed (see gcconfig.pri.in) and
with older Mac dev envs you will need to add -lz to LIBS too. (LIBS += -lz).

On Linux qwt3d_function.h needs a #include <stdio.h> added to compile.

Greg Steele helped design and test.

Regards,
Mark
0001-3D-Modelling.patch
Screenshot-Mark Liversedge.png

Mark Liversedge

unread,
Dec 28, 2009, 7:32:25 AM12/28/09
to golden-cheetah-users
Oh, also - When you install qwtplot3d change the CONFIG to build
static libs since the src.pro setup assumes static libraries.

Dag Gruneau

unread,
Dec 28, 2009, 8:00:59 AM12/28/09
to Mark Liversedge, golden-cheetah-users
Hi,
as I am new to this I have a couple of questions.
Why don't GC link static?
Why don't GC use the "normal" qwt as installed in each distro?
Now with 3D modeling it will be another special build not using a standard distro package.

Just curious ;-)

/dag


On Mon, Dec 28, 2009 at 1:32 PM, Mark Liversedge <liver...@gmail.com> wrote:
Oh, also - When you install qwtplot3d change the CONFIG to build
static libs since the src.pro setup assumes static libraries.

--
_______________________________________________
Golden-Cheetah-Users mailing list
golden-che...@googlegroups.com
http://groups.google.com/group/golden-cheetah-users?hl=en

Mark Liversedge

unread,
Dec 28, 2009, 8:08:03 AM12/28/09
to golden-cheetah-users
On Dec 28, 1:00 pm, Dag Gruneau <dag.grun...@gmail.com> wrote:
> Hi,
> as I am new to this I have a couple of questions.
> Why don't GC link static?
It does. For developer builds its recommended to build dynamic
binaries (speed), for the release binary it is build with static libs
to ensure it isn't dependent on the local installation setup.

> Why don't GC use the "normal" qwt as installed in each distro?

Because the qwt that is distributed with GC has had a multiple axis
patch applied to it. As standard qwt does not support multiple x or y
axis and scales. Ultimately, it is only devs that notice this anyway.

> Now with 3D modeling it will be another special build not using a standard
> distro package.

For developers, yes it will be an extra dependency before build.
That's a one off setup and hopefully not a big issue for most devs?
(And worth it for the new feature it brings?). For end-users its a non-
issue since they will download a staticly built binary.

> Just curious ;-)
Sure.

Dag Gruneau

unread,
Dec 28, 2009, 8:10:17 AM12/28/09
to Mark Liversedge, golden-cheetah-users
Thanks for the background information.

/fag

Dag Gruneau

unread,
Dec 28, 2009, 8:25:47 AM12/28/09
to Mark Liversedge, golden-cheetah-users
Wow, very cool! God work.

Zooming into and turning the plot around, so much to play around with. This can be very useful in analysis.

/dag

Robb Romans

unread,
Dec 28, 2009, 9:01:19 AM12/28/09
to Mark Liversedge, golden-che...@googlegroups.com
Mark,

Good stuff :-)

I got this to compile (and link dynamically) on Ubuntu 9.10 by doing
the following:

# sudo apt-get install libqwtplot3d-qt4 libqwtplot3d-qt4-dev

Add this to gcconfig.pri:
QWT3D_INSTALL = /usr/include/qwtplot3d-qt4

Modify src.pro:
robb@irwin:~/Projects/GoldenCheetah/src$ git diff
diff --git a/src/src.pro b/src/src.pro
index 53caf3d..9db4929 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -25,8 +25,8 @@ LIBS += -lm
}

!isEmpty( QWT3D_INSTALL) {
- INCLUDEPATH += $${QWT3D_INSTALL}/include
- LIBS += $${QWT3D_INSTALL}/lib/libqwtplot3d.a
+ INCLUDEPATH += $${QWT3D_INSTALL}
+ LIBS += /usr/lib/libqwtplot3d-qt4.so
}

macx {


Regards,
Robb

Mark Liversedge

unread,
Dec 28, 2009, 5:00:15 PM12/28/09
to golden-cheetah-users
OK. So I've now tested and built on Windows using mingw and qwtplot3d
compiles without too many issues (you need to comment out a line in the
build.pro for MSVC and it builds without trouble). I built a DLL and a
.a lib. Attached is a screenshot of that. So, it works on Linux, Mac and
Windows.

I've also added a color legend, which was easy once I'd read the source
(open source projects are great aren't they?).

So also attached (my last contribution to this thread before Justin
KILLS me) is a patch that applies cleanly to head and has the same
functionality as the previous one but including that legend.

I'm going into my cave now to write the internet racing client. See you
in 2010. :-)

Cheers,
Mark

Windows.PNG
0001-3D-Modelling.patch

Sean Rhea

unread,
Dec 28, 2009, 5:42:51 PM12/28/09
to Mark Liversedge, golden-cheetah-users
Mark and Greg,

Very, very cool!

I made one change: if the developer doesn't define QWT3D_INSTALL in gcconfig.pri, then the Model*.h|cpp files aren't compiled, qwtplot3d isn't linked in, and the 3D tab is never added in MainWindow.

I think that takes away the concern with adding a dependency to the GC build process, since anyone who doesn't want 3D plotting is free to ignore it.  A modified patch is attached.  Anyone object to me committing it to github?

Also, a small bug report: something about the 3D plot is forcing the GC window to be much wider than before.  Is there a minimum width in there somewhere?

Sean

P.S.  Greg, you're going to teach us how to interpret these plots, right?



Mark

--
_______________________________________________
Golden-Cheetah-Users mailing list
golden-che...@googlegroups.com
http://groups.google.com/group/golden-cheetah-users?hl=en



--
"I refuse to accept the idea that the ‘isness’ of man’s present nature makes him morally incapable of reaching up for the eternal ‘oughtness’ that forever confronts him." --MLK
0001-3D-Modelling.patch

greg steele

unread,
Dec 28, 2009, 5:59:11 PM12/28/09
to Sean Rhea, Mark Liversedge, golden-cheetah-users
Well,

As I told Mark before he did this, I am not even sure what to do with these plot yet...

I was intrigued by them when I first found them in PowerCoach >$1000), but excel doesn't really like making them, and until I found R a little bit ago, I really wasn't able to make them.

I do think there is information to be gleaned from these plots, but learning how to read them is important.

I aslo think that they may be more useful to a coach who did not perform the ride versus an athlete who did.

None the less, the implementation far exceeds my expectation!

g

> http://groups.google.com/group/golden-cheetah-users?hl=en<0001-3D-Modelling.patch>

Mark Liversedge

unread,
Dec 29, 2009, 7:45:36 AM12/29/09
to golden-cheetah-users
On Dec 28, 10:42 pm, Sean Rhea <sean.c.r...@gmail.com> wrote:
> Also, a small bug report: something about the 3D plot is forcing the GC
> window to be much wider than before.  Is there a minimum width in there
> somewhere?

This is because of the layout of the controls in MainWindow.cpp, there
is simply too much stuff on that first line. If the controls were
spread over three lines it would make the widget more 'resizable'.

I would look into this, but I'm knee deep in a widget for racing...
and I keep getting distracted from the stuff I'm doing with Justin.

It should be EASY to fix, just reorganise the controls in there.

In fact, it would be nice to put all the 'instant' settings on one
line (grid/frame/legend/chart style) and separate them from the ones
that need a replot (bin, x/y/z/color/ignore zero).

I doubt I'll get back to this any time soon. To understand why I'm
trying to avoid this and to understand me a little better .... watch
this http://www.youtube.com/watch?v=4P785j15Tzk

Mark

Mark Liversedge

unread,
Dec 30, 2009, 8:48:46 AM12/30/09
to Sean Rhea, golden-cheetah-users
Ok. I needed a little break from racing ;)

Attached a patch which reorganises modelwindow to use less screen real
estate (see screenshot). I based it on the latest patch from Sean (i
just adjusted ModelWindow.cpp).

Regards,
Mark

0001-3D-Modelling.patch
smaller.png

Sean Rhea

unread,
Dec 30, 2009, 9:47:17 AM12/30/09
to Mark Liversedge, golden-cheetah-users
Excellent. Committed along with a small bug fix (a2665bc).

Sean

--

Erik

unread,
Jan 1, 2010, 3:53:43 PM1/1/10
to golden-cheetah-users
Adding a time-based component to PF/PV data?

I might have to re-install my cadence sensor as I don't think my PT's
cadence guesses are going to cut it for what I want to look at.

Mark Liversedge

unread,
Jan 1, 2010, 5:41:56 PM1/1/10
to golden-cheetah-users
Hi Erik,

Its not just power x cadence x time. You can model any available data,
so distance x heartrate x power or speed x altitude x time etc etc

Still don't know if there is anything useful to be gained from this,
but hey, it looks good in screenshots ;-)

Regards,
Mark

Robert Chung

unread,
Jan 1, 2010, 11:58:48 PM1/1/10
to golden-cheetah-users

Do you do either smoothing or binning?

Mark Liversedge

unread,
Jan 2, 2010, 5:15:45 AM1/2/10
to golden-cheetah-users
Binning, but its the same bin size for x and y which is annoying (I
will fix this soon!). The Z-axis and Colors are averages (would be
nice to have a peak/min/rolling avg too).

Was there a particular option you think would be useful?

I'm desperate for this chart to show something useful! (Can you tell?)

Regards,
Mark

Robert Chung

unread,
Jan 2, 2010, 11:27:43 AM1/2/10
to golden-cheetah-users

On Jan 2, 2:15 am, Mark Liversedge <liverse...@gmail.com> wrote:
> Binning, but its the same bin size for x and y which is annoying (I
> will fix this soon!). The Z-axis and Colors are averages (would be
> nice to have a peak/min/rolling avg too).
>
> Was there a particular option you think would be useful?
>
> I'm desperate for this chart to show something useful! (Can you tell?)

Well, I sometimes think if you build it they will come.

That said, I often have some difficulty with 3-D surfaces unless
they're sufficiently smoothed. Sometimes I find co-plots to be a bit
easier to interpret.

Andy Coggan

unread,
Jan 2, 2010, 11:39:11 AM1/2/10
to golden-cheetah-users
On Jan 2, 10:27 am, Robert Chung <rech...@gmail.com> wrote:
> On Jan 2, 2:15 am, Mark Liversedge <liverse...@gmail.com> wrote:
>
> > Binning, but its the same bin size for x and y which is annoying (I
> > will fix this soon!). The Z-axis and Colors are averages (would be
> > nice to have a peak/min/rolling avg too).
>
> > Was there a particular option you think would be useful?
>
> > I'm desperate for this chart to show something useful! (Can you tell?)
>
> Well, I sometimes think if you build it they will come.

As Greg Steele alluded to previously in this thread, Paul Koechli's
PowerCoach software has long relied heavily on 3D graphs. However, as
I told people at the first power-based training conference back in
2001 (and illustrated with an example) I don't really see much need
for/usefulness to such plots. If you're interested in understanding
what impact events had/will have on your physiology (versus simply
describing what you did), the only really logical (and commonly
measured) 3rd variables to plot against any other two are 1) time and
2) heart rate. In general, though, you can ascertain the relationship
of these factors to others without resorting to the complexity of a 3D
surface plot or histogram (as Robert mentioned).

Just my $0.02.

Andy Coggan

Reply all
Reply to author
Forward
0 new messages