Welcome to MSDN Blogs Sign in | Join | Help

Bezier Curves and Car Manufacturers

Michael has asked me if it was possible to add Bezier curves to Live Geometry. So I went ahead and added a Bezier tool (and it took me about 30 minutes to do so!):

image

This draws a cubic Bezier curve using four points:

image

There is something beautiful and elegant about these curves. No wonder industrial designers use it a lot. I actually felt so inspired that I went ahead and used the tool to design a car :) Here's the live view (you need Silverlight 3 to see this), and you can drag the points around:

This is so fascinating. Maybe if I'm tired of programming I should just design cars? ;) Any recruiters from Subaru reading this?
 
I also built in a possibility to pass arguments to Live Geometry using initParams:
<object data="data:application/x-silverlight-2," 
type="application/x-silverlight-2" width="100%" height="100%">
  <param name="source" value="LiveGeometry.xap"/>
  <param name="initParams" 
         value="LoadFile=http://guilabs.de/geometry/drawings/fun/car.lgf,ShowToolbar=false" />
...

That's how I was able to embed Live Geometry into this page so that it doesn't show the toolbar and it automatically loads the car.lgf drawing.

Finally, here are some important things to know if you want to host a .xap file from another domain:

  • That domain must have crossdomain.xml at its root (so http://livegeometry.com/crossdomain.xml should be accessible)
  • If you're testing this by loading an .html file from a local filesystem, it will just display a white background and won't load the app. Put the .html on a webserver, then it will work
Published Sunday, November 01, 2009 4:52 PM by Kirill Osenkov

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# re: Bezier Curves and Car Manufacturers

Wednesday, November 04, 2009 1:58 AM by Shankar Nanivadekar

I was looking out for a decent Silverlight app to do some diagramming and stumbled upon Livegeometry.

It has been a wonderful experience since then.

I would like to create a simple structure of a few textboxes (with borders) stacked one after another. How can have this simple functionality out of LG?

please place me in your regular mailing list: gattoo@live.co.uk

# re: Bezier Curves and Car Manufacturers

Wednesday, November 04, 2009 7:36 PM by Kirill Osenkov

Hi Shankar,

thanks for your comment!

I haven't thought a lot about adding the usual UI controls to the drawing (such as textboxes, buttons, etc). Right now you can just add labels and hyperlinks. But I'll definitely think about adding more UI controls.

For now, you can take a look at the implementation of the PropertyGrid (download the source code and search for PropertyGrid).

Thanks,

Kirill

# re: Bezier Curves and Car Manufacturers

Tuesday, December 08, 2009 3:40 AM by Stephen

The concept of Bezier curves in geometry looks like an interesting concept to me. I would like to learn this concept in order to apply it to normal manufacturing practices.

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker