The Code Behind Project Butterfly and a Word About Flexibility

I’m sure some of you are interested in knowing a bit more about the insides of Project Butterfly. Some users have asked me how do we keep up the fast release rate. This post will try to answer both questions by providing background details of the technology behind the project with emphasis on how the system might be extended in the future.

Beginning at the top – the first thing a user sees when entering the system using the Try Now button is one of our sample drawings. The drawing is streamed to the client directly from the cloud (Amazon S3), and then rendered by the user’s computer. This is made possible by the data structures used by butterfly which are specially designed to stream vector data from the cloud service directly to the client front end. There are different types of online CAD editing tools in the market where in most cases, the user views server rendered images that are streamed to the client. In Butterfly, the rendering is done by the user’s computer (like it does when you use AutoCAD or other CAD software), allowing for a smoother navigation experience and client side editing.

When uploading a drawing, the system uses RealDWG to prepare the drawing for streaming. RealDWG provides exact information of the DWG file, which is an important part in the process of calculating the streaming method. The drawing is then stored securely on Amazon S3. Meeting user demands for DXF support a couple a weeks ago was rather smooth thanks to the flexibility of the  streaming module.

This architecture also answers a lot of scalability issues as it requires almost no server-side processing for the purpose of editing a file. In fact, the only server-side processing performed when opening a drawing is security related – making sure the drawing is delivered only to authenticated users that have access to the drawing.

We chose Adobe Flash as the client runtime environment. We can write a lot about Flash issues we had to overcame: memory usage, performance and so on, but that’s a topic for a different post. Flash is deployed on 99% of internet connected computers, allowing Butterfly to run on almost any Internet-connected machine. It was surprising to see a remarkable amount of Linux users logging in to the system. Although we’re currently pleased with our choice of Flash, it is worth mentioning that the dependency between Butterfly and Flash is intentionally modest.

The Flash application is built out of decoupled modules which are streamed to the client as the application loads. Different modules interact through a set of interfaces designed to provide support for manipulating and editing the drawing model. We recently used these interfaces to create the new Match Properties tool that was published a couple of weeks ago. The ribbon component has an interface that allows adding new buttons and tabs onto it, making adding a new feature to the UI a simple task. The underlying idea is to enable integration of 3rd party enhancements and tools in the future, as we also have the ability to load modules while the application is running.

The Project Butterfly development team is always on the look for new technologies and new features to develop especially those coming from users feedbacks. Keeping our code flexible and extensible makes it easier deploying these features.

Jonathan Seroussi

Control at Your Hands

Permissions are what makes Project Butterfly’s collaboration flexible and fit for any task. There are two kinds of permissions in Butterfly:

  • Edit – Your collaborator can edit the drawing, draw new objects, and edit annotations.
  • Download – Your collaborator can save the DWG file to his computer, and save a copy of the drawing to his own Butterfly account.

You can set permissions to shares, co-edit sessions and reviews. Permissions are set per recipient, and you can change them at any time.

When to use permissions?

If you’re collaborating with a person you totally trust, there’s no problem leaving the default permissions – allow edit and allow download. However, if you’re collaborating with a colleague or someone less experienced, consider setting permissions.

Let’s say you want to show your client some progress on a particular design. The best choice is to start a co-edit session with your client. Seeing as the client does not have previous CAD experience, you might want to restrict him from editing the drawing. This way the co-edit session goes on smoothly and with no damage to the drawing.

Another common scenario is when professionals from different firms and fields collaborate. Let’s say you’re sharing or reviewing the drawing with an engineer from a different firm. You probably want to protect your intellectual property from being copied. You can easily restrict your collaborator from downloading the drawing – even if you granted him editing permissions. That’s an advantage Project Butterfly has over sending DWG files over e-mail – your collaborator does not retain a copy of the drawing after the collaboration has ended.

These days we are considering to add markup ability to the read-only permission, so that your collaborators can always add their input without messing with your geometry.

What do you think? Vote in the poll:

Web-Based Applications for Daily Use

This post will not be about Butterfly, but rather on the way our team works with different applications. We want to share with you our passion towards Web-based applications.

We love using cloud computing, Web-based applications, SaaS. Call it however you like.

The Internet provides us with some powerful applications and services.

A few years ago, some of the most obvious services were unthinkable. Looking up any music video on YouTube, have two people work on a document at the same time, share calendars, upload photos to the Internet instantly from anywhere, and the list goes on.

The Web offers a unique advantage over desktop applications. The Web allows users to share and collaborate, together or separately on the same item or information. With desktop applications, that would require a lot of setting up to get a connection. The Web, however, makes that as easy as a click. Another advantage is that you always use the newest version of the service, without installing or updating anything.

The idea for Project Butterfly was inspired by services like Google Docs, and as a team that develops a Web-based application for CAD editing – we have a strong belief in Web applications. When we started out we decided that for the first month we would use nothing but a Web browser – no desktop applications what-so-ever. We wanted to see what issues come up when you use nothing but Web-based applications.

Like in any company, we needed to make use of E-Mail, documents, storage and more. The Internet provided us with next-to-free solutions for our needs – and they serve us loyally to this day. We do use some desktop software, though. Apart from the development workspace and vector graphics design there’s still no online tool that can totally replace its desktop equivalent.

I will admit that there are some setbacks for using Web-based applications, mostly the missing features in the application. For example, we are having a hard time creating rich graphs in Google Spreadsheets, and it’s almost impossible to create print-ready documents.

The Web allows people all over the world share their photos, music, videos, blog posts and documents. We hope that with Project Butterfly, professionals around the globe will work and collaborate on CAD drawings within their Web browser.

Here are some of the Web-based applications that we’re making use of:

  • Gmail, Google docs, Google calendar – For all our communication needs, meetings and documents in the office.
  • Bugzilla – Our software development and bug-tracking tool. While this is not exactly SaaS (because we installed it on a server of our own), it’s still an important tool for us.
  • WordPress.com – Running this blog. We could install a WordPress application of our own, but why do that when we can host it on dedicated, stable servers?
  • DropBox – Backing up files and synchronizing our home and office computers.
  • Remember The Milk – Managing and sharing work tasks as well as personal tasks.
  • Grooveshark – Our way of listening to music during the day.
  • And more…

How do you use Web-based applications for productivity?

Keyboard Shortcuts in Butterfly

We’ve discussed the command line before, and people wanted a faster way to access commands.

Truth is, Project Butterfly had several keyboard shortcuts since the beginning – the same commands from AutoCAD. When you type a command in Butterfly you don’t have have to press Enter, the command will execute automatically.

We’ve prepared a quick reference of our commands that you can use with your keyboard:

Move: m / move
Rotate: ro / rotate
Scale: sc / scale
Mirror: mi / mirror
Offset: o / offset
Trim: tr / trim
Edit text: tedit
Explode: x / explode
Match Properties: ma / matchprop

Line: l / line
Polyline: pl / pline
Circle: c / circle
Rectangle: rec / rectangle
Ellipse: el / ellipse
Cloud: revcloud
Leader: le / leader
Arc: a / arc
Insert block: i / insert
Insert text: dt / dtext / text / mt / t
Linear dimension: dimlin / dimlinear
Aligned dimension: dal / dimali
Angular dimension: dimang / dimangular

Copy: cp / copy / co / CTRL+C
Cut: cutclip / CTRL+X
Paste: pasteclip / CTRL+V
Undo: u / undo / CTRL+Z
Redo: redo / CTRL+Y
Erase: e / erase / DEL key
Zoom window: z / zoom
Pan: p / pan
Ortho mode: ortho / F8
Snap mode: snap / os / F3
Line weight mode: F4

Color: col / color
Layers: la / layer
Linetype: lt / linetype

Layouts: lo / layout
Xrefs: er / xref

So start typing, and have fun with your commands.

Tell us what you think, we’d love to know.

1 38 39 40 41 42 44  Scroll to top