Skip to content

Scripting: It’s Not Just for Browser Apps

ADMIN | 20-08-2012

I mentioned C3D Toolkit, our JavaScript-based demo application, and said I’d discuss it more in another post.

Hexagon pattern 1

In my last post I mentioned C3D Toolkit, our JavaScript-based demo application, and said I’d discuss it more in another post.  Well, here it is :)

Those of you who are ACIS customers are probably familiar with acis3dt.exe – our Scheme-based demo application (which I’ll call A3DT).  For those of you who aren’t, it’s an interactive application, written in the mid-90s, that lets you view and manipulate ACIS models by typing script commands (Scheme expressions).  The view window provides mouse-driven picking and view manipulation, but anything you can do with the mouse can also be done through a Scheme expression.  There is also a helper application which can be used to edit scripts and send them to A3DT (either entirely or line-by-line) for execution, or scripts can be run from the command line in “batch” mode (for testing).

A3DT has been VERY useful over the years for ACIS, in many ways:

  • Most of our tests are written in scheme
  • Customers submit bugs as scheme scripts
  • Customers are encouraged to prototype their workflows in scheme, then examine the C++ behind the script (the extensions are shipped as source code) and use that to guide their application development.
  • Scheme is the primary demo tool for ACIS – our Technical Account Managers (TAMs) often find themselves writing scripts “on the fly” to answer specific customer questions about ACIS’ capabilities.
  • When developers want to “play with” ACIS (e.g. create 100,000 blocks to test performance) they do it in scheme.

And now, let’s fast-forward to when we began working on componentizing CGM.  In CGM we didn’t have such a scripting engine – instead we had an in-house unit testing engine that could run unit test executables.  If you think about it, this made perfect sense.  CGM was not developed as a stand-alone product; instead it was part of a GUI-based feature modeling application.  In other words, CATIA filled most of the roles for CGM that A3DT fills for ACIS. 

For CGM component, however, this was not sufficient.  We first noticed this when writing tests – we found ourselves trying to write unit test executables for tests that were really acceptance tests.  This was extremely expensive in developer time – being able to see the models you’re creating and do graphical picks on them is extremely important when writing tests of even mildly complicated workflows (e.g. create a block then fillet one of the edges).  A more technical way to think of this is that the overhead due to violations of Once and Only Once involved in setting up the input scenarios (which I’ve discussed in the context of design-by-contract) is prohibitively expensive. 

A more important problem is that unit tests don’t use the code the way that our customers do: in an application.  This is the heart of App Driven Development: you should try to use your own product in the way your customers will.

At the same time, our TAMs were used to having a demo application available for use in presenting our products to customers. 

To address these problems, we developed the C3D Toolkit application.  We chose JavaScript rather than Scheme as the scripting language, and we used a more modern application architecture and GUI, but at its heart C3D fills the same role as A3DT – an interactive GUI application that lets you play around with the modeler, while at the same time being able to capture complex workflows or demos in an executable script.

C3D Toolkit

One of the things that surprised me (but probably shouldn’t have) in all this is how rarely people think about scripting interfaces in terms of supplying a command-line interface to applications.  In our experience with A3DT (and now C3D), the primary utility is in the ability to sit in front of the application and interactively figure out, line-by-line, what you want to do, while capturing what you’ve figured out in a script.  In contrast, it seems like most people think of the utility of scripting in terms of being able to write scripts that will be processed in “batch” mode; in other words it’s very similar to programming, except you don’t have to recompile the executable when you change (or extend) the program.  I imagine that a lot of this is driven by the browser-based application market; in such applications the scripting language isn’t the actual interface that’s presented to the user; it’s simply an intermediate programming language that can be run on the browser.  I think ignoring the potential of scripting as an interactive interface is a mistake – there are a lot of benefits to having a scripting “hook” into your application.

You might also like...

5 Min read
3D Modeling
What is digital manufacturing? Here’s a simple digital manufacturing definition: the process of using computer systems...
5 Min read
CGM Modeler
Software components are like the stage crew at a big concert performance: the audience doesn’t see them, but their...
Application Lifecycle Management Flow
4 Min read
CGM Modeler
When you hear the term, Application Lifecycle Management (ALM), you likely think about the process that a software...
9 Min read
CGM Modeler
SLS in Additive Manufacturing is used to convert 3D CAD designs into physical parts, in a matter of hours.
8 Min read
CGM Modeler
There’s a lot of confusion around what the terms additive manufacturing and 3D printing mean.
4 Min read
3D Modeling
Additive manufacturing, often referred to as 3D printing, is a computer-controlled process for creating 3D objects.
5 Min read
CGM Modeler
Computational Fluid Dynamics (CFD) is a type of analysis that provides insight into solving complex problems, and...
2 Min read
CGM Modeler
WRL files are an extension of the Virtual Reality Modeling Language (VRML) format . VRML file types enable browser...
Voxel model example
3 Min read
CGM Modeler
Voxels are to 3D what pixels are to 2D. Firstly -- let’s examine what pixels actually are. Everything you see on your...
Point_cloud_torus
2 Min read
CGM Modeler
Point-cloud modeling is typically used in the process of 3D scanning objects. Rather than defining surfaces through...
Polygonal Modeling
2 Min read
CGM Modeler
Polygonal (or polyhedral) modeling is the most common type of modeling for video games and animation studios. This type...
aerodynamics-CFD
9 Min read
CGM Modeler
Computational fluid dynamics (CFD) is a science that uses data structures to solve issues of fluid flow -- like...
BREP Model example
2 Min read
CGM Modeler
BRep modeling, or Boundary Representation modeling, is, in CAD applications, the most common type of modeling. BRep is...
Feature Recognition Zoomed
5 Min read
CGM Modeler
IN THIS ARTICLE: What is FEA (Finite Element Analysis) Principles of Finite Element Analysis and Simulation Software A...
3YourMind and Spatial
3 Min read
3D Modeling
As manufacturers begin to rely more and more on additive manufacturing (AM), moving from a few select piece parts that...
Voxeldance and Spatial
2 Min read
3D InterOp
To the uninitiated, 3D printing may seem a simple process — download your CAD file and hit print. But the world of...
BIM_word_cloud_web
2 Min read
3D Modeling
The construction industry has long taken advantage of prebuilt components, from prehung doors to prefabbed roof...
Clash-Detection-fig-1
4 Min read
3D Modeling
A major benefit of constructing a building virtually is the cost savings gained by identifying errors in the design...